/****************************************************************************** * File - window.h * Author - Joey Pollack * Date - 2021/09/01 (y/m/d) * Mod Date - 2021/09/01 (y/m/d) * Description - Manages the window system using GLFW. This is where GLFW * is initialized. I think this file can completely hide GLFW * but I'm not yet sure... ******************************************************************************/ #ifndef WINDOW_H_ #define WINDOW_H_ #include #include #include #include #include namespace lunarium { class Window { public: Window(); OpRes Initialize(const State& state); bool IsInit() const; GLFWwindow* GetWindow(); bool IsKeyDown(int key, bool mouse_button = false) const; glm::vec2 GetCursorPos() const; void SetCursorPos(glm::vec2 pos); void Resize(int width, int height); // TODO: See https://www.glfw.org/docs/latest/window_guide.html#window_full_screen void ChangeDisplayMode(bool fullscreen, int xPos, int yPos, int width, int height); bool IsFullScreen() const; void GetFramebufferSize(int* width, int* height) const; void GetPosition(int* x, int* y) const; void Hide(); void Show(); void SetShouldCloseFlag(bool should_close); bool ShouldWindowClose() const; static void PollEvents(); void SwapBuffers(); void Shutdown(); private: // There can only be 1 window for now static bool mbIsInit; GLFWwindow* mpWindow; }; } #endif // WINDOW_H_