sdlVideo.h

Go to the documentation of this file.
00001 #ifndef SDL_VIDEO_H
00002 #define SDL_VIDEO_H
00003 
00013 #include "sdlBase.h"
00014 #include "focusComponentInterface.h"
00015 #include <SDL_thread.h>
00016 #include <map>
00017 
00018 
00022 class SDL_Video : private SDL_Base {
00023   enum { FPS = 60 };
00024   static bool activated;
00025   SDL_Thread* thread;
00026   char* titleName;
00027   SDL_Surface* iconSurface;
00028   static Uint32 pre_ticks;
00029   static bool cursor_hide;
00030   static int wait_msec_max;
00031   static int wait_msec;
00032 
00033   typedef void (*call_t)(unsigned long);
00034   static call_t callback;
00035   static bool initialized;
00036   unsigned long active_ticks;
00037   static int input_index;
00038 
00039   static SDL_Surface* createScreen(void);
00040   static int updateThread(void* dummy);
00041   static void changeFocus(void);
00042 
00043 protected:
00044   enum { ScreenWidth = 640, ScreenHeight = 480 };
00045   static bool fullscreen;       
00046   static bool fullscreen_trigger;
00047   static SDL_Surface *screen;   
00048   static SDL_mutex *mutex;      
00050   typedef std::list<ComponentInterface*> drawList; 
00051   static std::map<char,drawList> draws; 
00052   static std::vector<FocusComponentInterface*> inputList;
00053 
00057   void registerEventHandler(call_t function);
00058 
00062   static void lock(void);
00063 
00067   static void unlock(void);
00068 
00069 public:
00070   SDL_Video(void);
00071   virtual ~SDL_Video(void);
00072 
00078   void activate(bool on);
00079 
00086   void setTitle(const char *title, const char *icon);
00087 
00093   void autoHideCursor(int waitMsec);
00094 
00102   static void blitSurface(SDL_Surface* surface,
00103                           const VXV::Rect& size, const VXV::Grid& pos);
00104 
00111   static void fillRect(const VXV::Rect& rect, unsigned long color);
00112 
00118   unsigned long getTicks(void);
00119 
00120   void delInputComponent(ComponentInterface* component);
00121 
00122   static void toggleFocus(void);
00123   void setFocus(FocusComponentInterface* component);
00124 };
00125 
00126 #endif /* !SDL_VIDEO_H */
00127 

Generated on Mon Apr 13 22:52:02 2009 by  doxygen 1.5.7.1