Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

WindowSDL.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 delay(clock_t ms);
  39. virtual void swapBuffersGL();
  40. virtual void setFont(const char *font);
  41. virtual int initializeFont();
  42. virtual void writeString(WindowString *s);
  43. private:
  44. bool mInit;
  45. char *mDriver;
  46. unsigned int mWidth;
  47. unsigned int mHeight;
  48. bool mFullscreen;
  49. bool mMousegrab;
  50. SDL_Window *mWindow; //!< This is the pointer to the SDL surface
  51. SDL_GLContext mGLContext; //!< The OpenGL Context
  52. bool mFontInit;
  53. char *mFontName;
  54. TTF_Font *mFont;
  55. GLuint mFontTexture;
  56. };
  57. #endif