A 2D tile-based sandbox game.
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 432B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include <swan-common/Vector2.h>
  3. #include <memory>
  4. struct SDL_Window;
  5. namespace Cygnet {
  6. struct WindowState;
  7. class Window {
  8. public:
  9. Window(const char *name, int w, int h);
  10. ~Window();
  11. void makeCurrent();
  12. void clear();
  13. void flip();
  14. void onResize(int w, int h);
  15. SwanCommon::Vec2i size() { return { w_, h_ }; }
  16. SDL_Window *sdlWindow();
  17. private:
  18. std::unique_ptr<WindowState> state_;
  19. int w_;
  20. int h_;
  21. };
  22. }