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.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 setTextInput(bool on);
  32. virtual void delay(clock_t ms);
  33. virtual void swapBuffersGL();
  34. virtual void setFont(const char *font);
  35. virtual int initializeFont();
  36. virtual void writeString(WindowString *s);
  37. virtual void drawText(unsigned int x, unsigned int y, float scale, const float color[4], const char *s, ...)
  38. __attribute__((format(printf, 6, 0)));
  39. private:
  40. SDL_Window *mWindow; //!< This is the pointer to the SDL surface
  41. SDL_GLContext mGLContext; //!< The OpenGL Context
  42. TTF_Font *mFont;
  43. unsigned int mFontTexture;
  44. bool mTextInput;
  45. WindowString tempText;
  46. };
  47. #endif