65 line
1.2 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2011 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. #pragma once
  11. //
  12. // The SdlApp class
  13. // ----------------
  14. //
  15. #include <lol/math/vector.h>
  16. namespace lol
  17. {
  18. //-----------------------------------------------------------------------------
  19. class SdlAppDisplayData;
  20. class SdlAppDisplay
  21. {
  22. friend class ApplicationDisplay;
  23. public:
  24. SdlAppDisplay(char const *title, ivec2 resolution);
  25. virtual ~SdlAppDisplay();
  26. protected:
  27. virtual void set_resolution(ivec2 resolution);
  28. virtual ivec2 resolution() const;
  29. void SetPosition(ivec2 position);
  30. void Enable();
  31. void Disable();
  32. private:
  33. SdlAppDisplayData *data;
  34. };
  35. //-----------------------------------------------------------------------------
  36. class SdlAppData;
  37. class SdlApp
  38. {
  39. public:
  40. SdlApp(char const *title, ivec2 res, float fps);
  41. virtual ~SdlApp();
  42. void ShowPointer(bool show);
  43. void Tick();
  44. private:
  45. SdlAppData *data;
  46. };
  47. } /* namespace lol */