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.

Window.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*!
  2. * \file include/Window.h
  3. * \brief Windowing interface
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _WINDOW_H_
  8. #define _WINDOW_H_
  9. #include <ctime>
  10. typedef struct {
  11. char *text;
  12. unsigned int x;
  13. unsigned int y;
  14. int w;
  15. int h;
  16. float scale;
  17. unsigned char color[4];
  18. } WindowString;
  19. /*!
  20. * \brief Windowing interface
  21. */
  22. class Window {
  23. public:
  24. /*!
  25. * \brief Deconstructs an object of Window
  26. */
  27. virtual ~Window();
  28. virtual void setDriver(const char *driver) = 0;
  29. virtual void setSize(unsigned int width, unsigned int height) = 0;
  30. virtual void setFullscreen(bool fullscreen) = 0;
  31. virtual void setMousegrab(bool grab) = 0;
  32. virtual int initialize() = 0;
  33. virtual void eventHandling() = 0;
  34. virtual void delay(clock_t ms) = 0;
  35. virtual void swapBuffersGL() = 0;
  36. virtual int initializeGL();
  37. virtual void resizeGL();
  38. virtual void glEnter2D();
  39. virtual void glExit2D();
  40. virtual void setFont(const char *font) = 0;
  41. virtual int initializeFont() = 0;
  42. virtual void writeString(WindowString *s) = 0;
  43. unsigned int mWidth;
  44. unsigned int mHeight;
  45. protected:
  46. bool mInit;
  47. char *mDriver;
  48. bool mFullscreen;
  49. bool mMousegrab;
  50. bool mFontInit;
  51. char *mFontName;
  52. };
  53. #endif