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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #ifdef __APPLE__
  12. #include <OpenGL/gl.h>
  13. #include <OpenGL/glu.h>
  14. #else
  15. #include <GL/gl.h>
  16. #include <GL/glu.h>
  17. #endif
  18. #include "Window.h"
  19. /*!
  20. * \brief SDL windowing implementation
  21. */
  22. class WindowSDL : public Window {
  23. public:
  24. /*!
  25. * \brief Constructs an object of WindowSDL
  26. */
  27. WindowSDL();
  28. /*!
  29. * \brief Deconstructs an object of WindowSDL
  30. */
  31. virtual ~WindowSDL();
  32. virtual void setDriver(const char *driver);
  33. virtual void setSize(unsigned int width, unsigned int height);
  34. virtual void setFullscreen(bool fullscreen);
  35. virtual void setMousegrab(bool grab);
  36. virtual int initialize();
  37. virtual void eventHandling();
  38. virtual void setTextInput(bool on);
  39. virtual void delay(clock_t ms);
  40. virtual void swapBuffersGL();
  41. virtual void setFont(const char *font);
  42. virtual int initializeFont();
  43. virtual void writeString(WindowString *s);
  44. private:
  45. SDL_Window *mWindow; //!< This is the pointer to the SDL surface
  46. SDL_GLContext mGLContext; //!< The OpenGL Context
  47. TTF_Font *mFont;
  48. GLuint mFontTexture;
  49. bool mTextInput;
  50. };
  51. #endif