diff --git a/src/graphic/Fast3D/Fast3dWindow.cpp b/src/graphic/Fast3D/Fast3dWindow.cpp index d0304c997..3d3183a98 100644 --- a/src/graphic/Fast3D/Fast3dWindow.cpp +++ b/src/graphic/Fast3D/Fast3dWindow.cpp @@ -158,6 +158,10 @@ bool Fast3dWindow::IsFrameReady() { return mWindowManagerApi->is_frame_ready(); } +void Fast3dWindow::HandleEvents() { + mWindowManagerApi->handle_events(); +} + void Fast3dWindow::SetCursorVisibility(bool visible) { mWindowManagerApi->set_cursor_visibility(visible); } diff --git a/src/graphic/Fast3D/Fast3dWindow.h b/src/graphic/Fast3D/Fast3dWindow.h index 716c12d89..855570300 100644 --- a/src/graphic/Fast3D/Fast3dWindow.h +++ b/src/graphic/Fast3D/Fast3dWindow.h @@ -16,6 +16,7 @@ class Fast3dWindow : public Ship::Window { void StartFrame() override; void EndFrame() override; bool IsFrameReady() override; + void HandleEvents() override; void SetCursorVisibility(bool visible) override; uint32_t GetWidth() override; uint32_t GetHeight() override; diff --git a/src/graphic/Fast3D/gfx_pc.cpp b/src/graphic/Fast3D/gfx_pc.cpp index bb466bef7..2e4e6444a 100644 --- a/src/graphic/Fast3D/gfx_pc.cpp +++ b/src/graphic/Fast3D/gfx_pc.cpp @@ -4123,12 +4123,15 @@ struct GfxRenderingAPI* gfx_get_current_rendering_api() { return gfx_rapi; } +void gfx_handle_window_events() { + gfx_wapi->handle_events(); +} + bool gfx_is_frame_ready() { return gfx_wapi->is_frame_ready(); } void gfx_start_frame() { - gfx_wapi->handle_events(); gfx_wapi->get_dimensions(&gfx_current_window_dimensions.width, &gfx_current_window_dimensions.height, &gfx_current_window_position_x, &gfx_current_window_position_y); if (gfx_current_dimensions.height == 0) { diff --git a/src/graphic/Fast3D/gfx_pc.h b/src/graphic/Fast3D/gfx_pc.h index 77e9072b9..ef08c428b 100644 --- a/src/graphic/Fast3D/gfx_pc.h +++ b/src/graphic/Fast3D/gfx_pc.h @@ -235,6 +235,7 @@ void gfx_start_frame(); // Since this function is "exposted" to the games, it needs to take a normal Gfx void gfx_run(Gfx* commands, const std::unordered_map& mtx_replacements); +void gfx_handle_window_events(); bool gfx_is_frame_ready(); void gfx_end_frame(); void gfx_set_target_ucode(UcodeHandlers ucode); diff --git a/src/window/Window.h b/src/window/Window.h index f3035bb6c..9bebf613e 100644 --- a/src/window/Window.h +++ b/src/window/Window.h @@ -38,6 +38,7 @@ class Window { virtual void StartFrame() = 0; virtual void EndFrame() = 0; virtual bool IsFrameReady() = 0; + virtual void HandleEvents() = 0; virtual void SetCursorVisibility(bool visible) = 0; virtual uint32_t GetWidth() = 0; virtual uint32_t GetHeight() = 0;