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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #include "global.h"
  11. /*!
  12. * \brief Windowing interface
  13. */
  14. class Window {
  15. public:
  16. /*!
  17. * \brief Deconstructs an object of Window
  18. */
  19. virtual ~Window();
  20. virtual void setDriver(const char *driver) = 0;
  21. virtual void setSize(unsigned int width, unsigned int height) = 0;
  22. virtual void setFullscreen(bool fullscreen) = 0;
  23. virtual void setMousegrab(bool grab) = 0;
  24. virtual int initialize() = 0;
  25. virtual void eventHandling() = 0;
  26. virtual void setTextInput(bool on) = 0;
  27. virtual void delay(clock_t ms) = 0;
  28. virtual void swapBuffersGL() = 0;
  29. virtual int initializeGL();
  30. virtual void resizeGL();
  31. virtual void glEnter2D();
  32. virtual void glExit2D();
  33. virtual void setFont(const char *font) = 0;
  34. virtual int initializeFont() = 0;
  35. virtual void writeString(WindowString *s) = 0;
  36. virtual void drawText(unsigned int x, unsigned int y, float scale, unsigned char *color, const char *s, ...)
  37. __attribute__((format(printf, 6, 0))) = 0;
  38. unsigned int mWidth;
  39. unsigned int mHeight;
  40. protected:
  41. bool mInit;
  42. char *mDriver;
  43. bool mFullscreen;
  44. bool mMousegrab;
  45. bool mFontInit;
  46. char *mFontName;
  47. };
  48. #endif