fix: getmouse pos uses the member vars correctly and removed const
This commit is contained in:
@@ -209,13 +209,13 @@ void Window::RaiseEvent(Event &event) {
|
|||||||
|
|
||||||
// TODO: this need testing because i am really not sure this is correct
|
// TODO: this need testing because i am really not sure this is correct
|
||||||
// should this be static or go somewhere else | probably in application?
|
// should this be static or go somewhere else | probably in application?
|
||||||
auto Window::GetMousePos() const {
|
auto Window::GetMousePos() {
|
||||||
struct result {
|
struct result {
|
||||||
float *x;
|
float x;
|
||||||
float *y;
|
float y;
|
||||||
};
|
};
|
||||||
|
|
||||||
SDL_GetMouseState(m_MouseXPos, m_MouseYPos);
|
SDL_GetMouseState(&m_MouseXPos, &m_MouseYPos);
|
||||||
|
|
||||||
return result{m_MouseXPos, m_MouseYPos};
|
return result{m_MouseXPos, m_MouseYPos};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ public:
|
|||||||
void RaiseEvent(Event &event);
|
void RaiseEvent(Event &event);
|
||||||
|
|
||||||
bool ShouldClose() const;
|
bool ShouldClose() const;
|
||||||
auto GetMousePos() const;
|
auto GetMousePos();
|
||||||
|
|
||||||
SDL_Window *GetHandle() const { return m_Handle; }
|
SDL_Window *GetHandle() const { return m_Handle; }
|
||||||
|
|
||||||
@@ -47,8 +47,8 @@ private:
|
|||||||
WindowData m_Data;
|
WindowData m_Data;
|
||||||
SDL_Window *m_Handle = nullptr;
|
SDL_Window *m_Handle = nullptr;
|
||||||
SDL_WindowFlags m_Flags;
|
SDL_WindowFlags m_Flags;
|
||||||
float *m_MouseXPos = nullptr;
|
float m_MouseXPos;
|
||||||
float *m_MouseYPos = nullptr;
|
float m_MouseYPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace SakuraVNE
|
} // namespace SakuraVNE
|
||||||
|
|||||||
Reference in New Issue
Block a user