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 385B

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