From 8cf6858a6cd958f31521c4ce680cf2011bfb7cc3 Mon Sep 17 00:00:00 2001 From: hachem Date: Tue, 12 Aug 2025 18:41:26 +0200 Subject: [add]: Camera --- src/Core/Window.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/Core/Window.h') 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 -- cgit v1.3