00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _FONT_H
00026
00027 #include <stdio.h>
00028 #include <GL/gl.h>
00029 #include <GL/glu.h>
00030 #include <SDL/SDL.h>
00031 #include <string>
00032 #include <iostream>
00033 #include <fstream>
00034
00035 #include "utility.h"
00036 #include "textures.h"
00037 #include "settings.h"
00038 #include "globals.h"
00039
00040 using namespace std;
00041
00042 class FONT
00043 {
00044 private:
00045 GLuint base;
00046 TEXTURE_HANDLE texture;
00047
00048 ofstream error_log;
00049
00050 int spacing[2][128];
00051
00052 bool loaded;
00053
00054 void GetSizing(int size, int & sx, int & sy);
00055
00056 public:
00057 FONT();
00058 ~FONT();
00059 void Load();
00060 void Print( float px, float py, const char *string, int set, int size, float opacity );
00061 void Print( float px, float py, const char *string, int set, int size, float r, float g, float b );
00062 void Print( float px, float py, const char *string, int set, int size, float r, float g, float b, float trans );
00063
00064 float Width(const char * str, int set, int size);
00065 float Height(const char * str, int set, int size);
00066 };
00067
00068 #define _FONT_H
00069 #endif