You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __GUI_SDL_HEADER__
  2. #define __GUI_SDL_HEADER__
  3. #include <stdio.h>
  4. #include <vector>
  5. #include "../components/base/basicMutex.h"
  6. #include "../components/base/basicThread.h"
  7. #include <SDL.h>
  8. #include <SDL_image.h>
  9. #include <SDL_ttf.h>
  10. #define SCREEN_WIDTH 800
  11. #define SCREEN_HEIGHT 600
  12. class sdlCoreWidget;
  13. typedef std::vector<sdlCoreWidget*> pWidgetVector;
  14. class classGUI_SDL: public basicThread{
  15. private:
  16. bool m_bInitOk;
  17. bool m_bWindowSystemOk;
  18. SDL_Window * m_pWindow;
  19. SDL_Renderer * m_pRenderer;
  20. SDL_Surface * m_pScreenSurface;
  21. SDL_Texture * m_pTexture;
  22. //basicMutex m_mProtector;
  23. SDL_mutex * m_pProtector;
  24. pWidgetVector m_vWidgets;
  25. public:
  26. static classGUI_SDL * getInstance();
  27. virtual void m_fThreadProc(void);
  28. void registerWidget(sdlCoreWidget * tPtr);
  29. void removeWidget( sdlCoreWidget * tPtr);
  30. bool setFullScreen( bool status );
  31. protected:
  32. classGUI_SDL();
  33. ~classGUI_SDL();
  34. static classGUI_SDL * m_pInstance;
  35. };
  36. #endif