Open Source Tomb Raider Engine
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.

WindowSDL.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*!
  2. * \file include/WindowSDL.h
  3. * \brief SDL windowing implementation
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _WINDOW_SDL_H_
  8. #define _WINDOW_SDL_H_
  9. #include "SDL.h"
  10. #include "SDL_ttf.h"
  11. #include "Window.h"
  12. /*!
  13. * \brief SDL windowing implementation
  14. */
  15. class WindowSDL : public Window {
  16. public:
  17. /*!
  18. * \brief Constructs an object of WindowSDL
  19. */
  20. WindowSDL();
  21. /*!
  22. * \brief Deconstructs an object of WindowSDL
  23. */
  24. virtual ~WindowSDL();
  25. virtual void setDriver(const char *driver);
  26. virtual void setSize(unsigned int width, unsigned int height);
  27. virtual void setFullscreen(bool fullscreen);
  28. virtual void setMousegrab(bool grab);
  29. virtual int initialize();
  30. virtual void eventHandling();
  31. virtual void delay(clock_t ms);
  32. virtual void swapBuffersGL();
  33. virtual void setFont(const char *font);
  34. virtual int initializeFont();
  35. virtual void writeString(WindowString *s);
  36. private:
  37. bool mInit;
  38. char *mDriver;
  39. unsigned int mWidth;
  40. unsigned int mHeight;
  41. bool mFullscreen;
  42. bool mMousegrab;
  43. SDL_Window *mWindow; //!< This is the pointer to the SDL surface
  44. SDL_GLContext mGLContext; //!< The OpenGL Context
  45. bool mFontInit;
  46. char *mFontName;
  47. TTF_Font *mFont;
  48. };
  49. #endif