您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

74 行
1.3 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright © 2010—2019 Sam Hocevar <sam@hocevar.net>
  5. //
  6. // Lol Engine is free software. It comes without any warranty, to
  7. // the extent permitted by applicable law. You can redistribute it
  8. // and/or modify it under the terms of the Do What the Fuck You Want
  9. // to Public License, Version 2, as published by the WTFPL Task Force.
  10. // See http://www.wtfpl.net/ for more details.
  11. //
  12. #pragma once
  13. //
  14. // The SdlApp class
  15. // ----------------
  16. //
  17. #include <lol/math/vector.h>
  18. #if LOL_USE_SDL
  19. # if HAVE_SDL2_SDL_H
  20. # include <SDL2/SDL.h>
  21. # elif HAVE_SDL_H
  22. # include <SDL.h>
  23. # endif
  24. #endif
  25. namespace lol
  26. {
  27. namespace sdl
  28. {
  29. class app
  30. {
  31. public:
  32. app(char const *title, ivec2 res, float fps);
  33. virtual ~app();
  34. void ShowPointer(bool show);
  35. void Tick();
  36. };
  37. class app_display
  38. {
  39. friend class lol::ApplicationDisplay;
  40. public:
  41. app_display(char const *title, ivec2 resolution);
  42. virtual ~app_display();
  43. protected:
  44. virtual void set_resolution(ivec2 resolution);
  45. virtual ivec2 resolution() const;
  46. void SetPosition(ivec2 position);
  47. void Enable();
  48. void Disable();
  49. private:
  50. #if LOL_USE_SDL
  51. SDL_Window *m_window;
  52. SDL_GLContext m_glcontext;
  53. #endif
  54. };
  55. } /* namespace sdl */
  56. } /* namespace lol */