From aee5bf7802f112111961faa824deb6f97ef80203 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Fri, 26 Mar 2021 15:32:22 +0000 Subject: add window subsystem --- src/window/Window.hpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/window/Window.hpp (limited to 'src/window/Window.hpp') diff --git a/src/window/Window.hpp b/src/window/Window.hpp new file mode 100644 index 0000000..fe3b054 --- /dev/null +++ b/src/window/Window.hpp @@ -0,0 +1,26 @@ +#ifndef ENGINE_WINDOW_H +#define ENGINE_WINDOW_H + +class GLFWwindow; + +class Window { + GLFWwindow *win; + int width, height; + + Window(GLFWwindow *a_win, int a_w, int a_h) : win(a_win), + width(a_w), height(a_h) { } +public: + ~Window() { } + GLFWwindow *GetWin() { return win; } + + static Window *Initialize(int width, int height, const char *title); + + void Resize(int w, int h); + void MakeContextCurrent(); + void SetCursorMode(int mode); + bool IsShouldClose(); + void SetShouldClose(int flag); + void SwapBuffers(); +}; + +#endif /* ENGINE_WINDOW_H */ -- cgit v1.2.3-18-g5258