diff --git a/src/gx/glsdl/CGxDeviceGLSDL.cpp b/src/gx/glsdl/CGxDeviceGLSDL.cpp index 16eba2c..89f7444 100644 --- a/src/gx/glsdl/CGxDeviceGLSDL.cpp +++ b/src/gx/glsdl/CGxDeviceGLSDL.cpp @@ -1268,6 +1268,8 @@ void CGxDeviceGLSDL::SceneClear(uint32_t mask, CImVector color) { } void CGxDeviceGLSDL::ScenePresent() { + this->m_GLSDLWindow.DispatchEvents(); + if (this->m_context) { // TODO diff --git a/src/gx/glsdl/GLSDLWindow.cpp b/src/gx/glsdl/GLSDLWindow.cpp index fd30db3..492eccd 100644 --- a/src/gx/glsdl/GLSDLWindow.cpp +++ b/src/gx/glsdl/GLSDLWindow.cpp @@ -209,7 +209,9 @@ void GLSDLWindow::Create(const char* title, const GLSDLWindowRect& rect, GLTextu void GLSDLWindow::Swap() { SDL_GL_SwapWindow(this->m_sdlWindow); +} +void GLSDLWindow::DispatchEvents() { SDL_Event event; while (SDL_PollEvent(&event)) { this->DispatchSDLEvent(event); diff --git a/src/gx/glsdl/GLSDLWindow.hpp b/src/gx/glsdl/GLSDLWindow.hpp index 4897743..915d34a 100644 --- a/src/gx/glsdl/GLSDLWindow.hpp +++ b/src/gx/glsdl/GLSDLWindow.hpp @@ -30,6 +30,7 @@ class GLSDLWindow { void Create(const char* title, const GLSDLWindowRect& rect, GLTextureFormat depthFormat, uint32_t sampleCount); void Destroy(); void Swap(); + void DispatchEvents(); void DispatchSDLEvent(const SDL_Event& event); void DispatchSDLKeyboardEvent(const SDL_Event& event); void DispatchSDLMouseMotionEvent(const SDL_Event& event);