From 4cd15283434d2817d34a53ab347d693c8743a4bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hatvani=20Tam=C3=A1s?= Date: Fri, 17 Apr 2026 11:54:42 +0200 Subject: [PATCH] fix: getmouse pos uses the member vars correctly and removed const --- SakuraCore/src/Window.cpp | 8 ++++---- SakuraCore/src/Window.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/SakuraCore/src/Window.cpp b/SakuraCore/src/Window.cpp index 7609303..21897c5 100644 --- a/SakuraCore/src/Window.cpp +++ b/SakuraCore/src/Window.cpp @@ -209,13 +209,13 @@ void Window::RaiseEvent(Event &event) { // TODO: this need testing because i am really not sure this is correct // should this be static or go somewhere else | probably in application? -auto Window::GetMousePos() const { +auto Window::GetMousePos() { struct result { - float *x; - float *y; + float x; + float y; }; - SDL_GetMouseState(m_MouseXPos, m_MouseYPos); + SDL_GetMouseState(&m_MouseXPos, &m_MouseYPos); return result{m_MouseXPos, m_MouseYPos}; } diff --git a/SakuraCore/src/Window.h b/SakuraCore/src/Window.h index 38d88d8..96d1d9e 100644 --- a/SakuraCore/src/Window.h +++ b/SakuraCore/src/Window.h @@ -39,7 +39,7 @@ public: void RaiseEvent(Event &event); bool ShouldClose() const; - auto GetMousePos() const; + auto GetMousePos(); SDL_Window *GetHandle() const { return m_Handle; } @@ -47,8 +47,8 @@ private: WindowData m_Data; SDL_Window *m_Handle = nullptr; SDL_WindowFlags m_Flags; - float *m_MouseXPos = nullptr; - float *m_MouseYPos = nullptr; + float m_MouseXPos; + float m_MouseYPos; }; } // namespace SakuraVNE