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