00001 #ifndef SCREEN_H 00002 #define SCREEN_H 00003 00004 #include "SDL.h" 00005 #include "glfuncs.h" 00006 00007 #include <string> 00008 00009 class Object; 00010 00011 class Screen 00012 { 00013 public: 00014 static Screen* instance(); 00015 void drawLevel(int texture, GLfloat texCoords[4], SDL_Rect quad); 00016 void drawScreen(int texture, GLfloat texCoords[4], SDL_Rect quad); 00017 00018 void drawText(std::string text, int x, int y); 00019 00020 static void drawScramble(); 00021 static void drawPause(); 00022 static void drawLoading(); 00023 00024 void drawCutScene(std::string cutSceneText); 00025 00026 void move(int x, int y); 00027 00028 void update(); 00029 00030 void registerFollowObj(Object * o); 00031 Object* getFollowObj(){ return _followMe; }; 00032 00033 SDL_Rect getScreenRect() {return _screen;} 00034 00035 void recenter(); 00036 00037 static int height() {return HEIGHT;} 00038 static int width() {return WIDTH;} 00039 00040 static const int FRAMERATE = 60; 00041 00042 private: 00043 static Screen* _instance; 00044 SDL_Rect _screen; 00045 SDL_Rect _center; 00046 Screen(); 00047 00048 int _scram; 00049 GLfloat _scramCoords[4]; 00050 00051 int _pause; 00052 GLfloat _pauseCoords[4]; 00053 00054 int _loading; 00055 GLfloat _loadingCoords[4]; 00056 00057 Object * _followMe; 00058 00059 // fraction of the screen for the black bars 00060 static const int CSFRAC = 5; 00061 00062 static int HEIGHT ;//= 760; 00063 static int WIDTH ;//= 1024; 00064 }; 00065 00066 #endif
1.4.6-NO