Skip to content

Commit

Permalink
expose handle_events on fast3dwindow
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez committed Jan 9, 2025
1 parent d035e9c commit 534ffa1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/graphic/Fast3D/Fast3dWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions src/graphic/Fast3D/Fast3dWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/graphic/Fast3D/gfx_pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/graphic/Fast3D/gfx_pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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*, MtxF>& mtx_replacements);
void gfx_handle_window_events();
bool gfx_is_frame_ready();
void gfx_end_frame();
void gfx_set_target_ucode(UcodeHandlers ucode);
Expand Down
1 change: 1 addition & 0 deletions src/window/Window.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 534ffa1

Please sign in to comment.