00001 #ifndef XCLONE_DISPLAY_H 00002 #define XCLONE_DISPLAY_H 00003 00004 #include "includes.h" 00005 #include "Singleton.h" 00006 00007 class Display : public Singleton<Display> 00008 { 00009 friend class Singleton<Display>; 00010 00011 public: 00012 void init(); 00013 void deinit(); 00014 int getScreenWidth() const; 00015 int getScreenHeight() const; 00016 bool loadFont(string fileName); 00017 SDL_Surface* loadImage(string fileName, bool useAlpha = true); 00018 void draw(int x, int y, string text); 00019 void draw(int x, int y, SDL_Surface* source); 00020 void drawRect(SDL_Rect* rect, SDL_Color* color); 00021 void render(); 00022 00023 private: 00024 Display(); 00025 int _screenWidth; 00026 int _screenHeight; 00027 SDL_Surface* _screen; 00028 TTF_Font* _font; 00029 }; 00030 00031 #endif