00001 #ifndef _HUDBASE_H_ 00002 #define _HUDBASE_H_ 00003 00004 #include <GL/gl.h> 00005 00006 #include "SDL.h" 00007 #include "SDL_ttf.h" 00008 00009 #include "Config.h" 00010 00015 class HudBase 00016 { 00017 public: 00018 HudBase(); 00019 virtual ~HudBase(); 00020 00024 virtual void draw() = 0; 00025 00029 void start2DMode(); 00033 void end2DMode(); 00034 00038 GLuint GLLoadTexture(SDL_Surface *surface, GLfloat *texcoord); 00042 int powerOfTwo(int input); 00043 00044 protected: 00048 void deleteTextures(); 00049 00050 // font 00051 TTF_Font *_font; 00052 00053 // width and height of the texture 00054 int _width, _height; 00055 // coordiantes 00056 GLfloat _coordinates[4]; 00057 // texture id 00058 GLuint _textureList[100]; 00059 int _numTextures; 00060 00061 // top left corner for positioning 00062 double _topPosition, _leftPosition; 00063 }; 00064 00065 #endif