diff options
| author | hachem <im@hachem.wtf> | 2025-08-12 18:41:26 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-12 18:41:26 +0200 |
| commit | 8cf6858a6cd958f31521c4ce680cf2011bfb7cc3 (patch) | |
| tree | 56492ce9db686b719ec16f51b7a7078c41443899 /src/Core/Window.h | |
| parent | a2ec7dabd48a70ea69623406ddd0f8f97af403c8 (diff) | |
[add]: Camera
Diffstat (limited to 'src/Core/Window.h')
| -rw-r--r-- | src/Core/Window.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/Core/Window.h b/src/Core/Window.h index f954ed6..c1cda2d 100644 --- a/src/Core/Window.h +++ b/src/Core/Window.h @@ -15,16 +15,24 @@ namespace Donut ~Window(); bool ShouldClose() const; - void OnUpdate() const; + void OnUpdate() const; + + void SetEventCallback(const EventCallbackFn& callback) + { + m_EventHandler.SetEventCallback(callback); + } - void SetEventCallback(const EventCallbackFn& callback) { m_EventHandler.SetEventCallback(callback); } EventHandler& GetEventHandler() { return m_EventHandler; } - unsigned int GetWidth() const { return m_Width; } + unsigned int GetWidth() const { return m_Width; } unsigned int GetHeight() const { return m_Height; } void* GetNativeWindow() const { return m_Window; } + void SetCursorLocked(bool locked); + void SetCursorVisible(bool visible); + bool IsCursorLocked() const { return m_CursorLocked; } + bool IsCursorVisible() const { return m_CursorVisible; } private: void Init(); void Shutdown(); @@ -39,7 +47,6 @@ namespace Donut static void GLFWMouseButtonCallback(GLFWwindow* window, int button, int action, int mods); static void GLFWMouseScrollCallback(GLFWwindow* window, double xOffset, double yOffset); static void GLFWCursorPosCallback(GLFWwindow* window, double xPos, double yPos); - private: GLFWwindow* m_Window; EventHandler m_EventHandler; @@ -48,5 +55,7 @@ namespace Donut unsigned int m_Width; unsigned int m_Height; bool m_IsClosed; + bool m_CursorLocked = false; + bool m_CursorVisible = true; }; }
\ No newline at end of file |
