From faf9b672222b719d89a31257ca5cd1f218d23b2d Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 16 Oct 2025 20:03:18 +0200 Subject: [PATCH] fix: relative mouse mode resets --- engine/src/window/window.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/src/window/window.cpp b/engine/src/window/window.cpp index 3716bbe..ba66723 100644 --- a/engine/src/window/window.cpp +++ b/engine/src/window/window.cpp @@ -31,6 +31,8 @@ Window::Window(const char* title, int width, int height) { } SDL_SetWindowRelativeMouseMode(m_handle, true); + SDL_Rect boundaries = {0, 0, m_width, m_height}; + SDL_SetWindowMouseRect(m_handle, &boundaries); m_context = SDL_GL_CreateContext(m_handle); @@ -121,6 +123,9 @@ void Window::ProcessEvents() { width, height); Dispatch(WindowResized{ m_width, m_height }); + SDL_SetWindowRelativeMouseMode(m_handle, true); + SDL_Rect boundaries = {0, 0, m_width, m_height}; + SDL_SetWindowMouseRect(m_handle, &boundaries); } break; default: break;