fix: getmouse pos uses the member vars correctly and removed const

This commit is contained in:
2026-04-17 11:54:42 +02:00
parent 31f57eddf7
commit 4cd1528343
2 changed files with 7 additions and 7 deletions

View File

@@ -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};
}

View File

@@ -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