Compare commits

...

3 Commits

3 changed files with 9 additions and 9 deletions

View File

@@ -147,7 +147,7 @@ void Application::Run() {
m_ImGui->Begin(); m_ImGui->Begin();
SDL_SetRenderScale(m_Renderer, io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y); SDL_SetRenderScale(m_Renderer, io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
SDL_SetRenderDrawColor(m_Renderer, (Uint8)111, (Uint8)232, (Uint8)168, (Uint8)0); SDL_SetRenderDrawColor(m_Renderer, (Uint8)111, (Uint8)232, (Uint8)168, (Uint8)255);
SDL_RenderClear(m_Renderer); SDL_RenderClear(m_Renderer);
for (auto &layer : m_LayerStack) { for (auto &layer : m_LayerStack) {

View File

@@ -185,7 +185,7 @@ void Window::RemoveFlags(std::span<const SDL_WindowFlags> flags) {
break; break;
} }
m_Flags |= flag; m_Flags &= flag;
} }
} }
@@ -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};
} }

View File

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