From 0622ac4b6ef44fd127a4c5a13709505a92b0c53e Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:54:24 +0100 Subject: [PATCH] wiiu: Update Fast3D APIs --- src/graphic/Fast3D/gfx_gx2.cpp | 19 +++++++++++----- src/graphic/Fast3D/gfx_wiiu.cpp | 40 +++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/graphic/Fast3D/gfx_gx2.cpp b/src/graphic/Fast3D/gfx_gx2.cpp index 8998fe0df..45eaf5f10 100644 --- a/src/graphic/Fast3D/gfx_gx2.cpp +++ b/src/graphic/Fast3D/gfx_gx2.cpp @@ -721,12 +721,17 @@ void gfx_gx2_start_draw_to_framebuffer(int fb, float noise_scale) { current_framebuffer = fb; } -void gfx_gx2_clear_framebuffer(void) { +void gfx_gx2_clear_framebuffer(bool color, bool depth) { Framebuffer& buffer = framebuffers[current_framebuffer]; - GX2ClearColor(&buffer.color_buffer, 0.0f, 0.0f, 0.0f, 1.0f); - GX2ClearDepthStencilEx(&buffer.depth_buffer, buffer.depth_buffer.depthClear, buffer.depth_buffer.stencilClear, - GX2_CLEAR_FLAGS_BOTH); + if (color) { + GX2ClearColor(&buffer.color_buffer, 0.0f, 0.0f, 0.0f, 1.0f); + } + + if (depth) { + GX2ClearDepthStencilEx(&buffer.depth_buffer, buffer.depth_buffer.depthClear, buffer.depth_buffer.stencilClear, + GX2_CLEAR_FLAGS_BOTH); + } gfx_wiiu_set_context_state(); } @@ -891,6 +896,9 @@ ImGui_ImplGX2_Texture* gfx_gx2_texture_for_imgui(uint32_t texture_id) { return &tex->imtex; } +void gfx_gx2_enable_srgb_mode() { +} + struct GfxRenderingAPI gfx_gx2_api = { gfx_gx2_get_name, gfx_gx2_get_max_texture_size, gfx_gx2_get_clip_parameters, @@ -926,6 +934,7 @@ struct GfxRenderingAPI gfx_gx2_api = { gfx_gx2_get_name, gfx_gx2_select_texture_fb, gfx_gx2_delete_texture, gfx_gx2_set_texture_filter, - gfx_gx2_get_texture_filter }; + gfx_gx2_get_texture_filter, + gfx_gx2_enable_srgb_mode }; #endif diff --git a/src/graphic/Fast3D/gfx_wiiu.cpp b/src/graphic/Fast3D/gfx_wiiu.cpp index 13cf38847..51ada5548 100644 --- a/src/graphic/Fast3D/gfx_wiiu.cpp +++ b/src/graphic/Fast3D/gfx_wiiu.cpp @@ -344,7 +344,36 @@ static void gfx_wiiu_get_active_window_refresh_rate(uint32_t* refresh_rate) { *refresh_rate = 60; } -static void gfx_wiiu_show_cursor(bool hide) { +static void gfx_wiiu_set_cursor_visibility(bool hide) { +} + +static void gfx_wiiu_set_mouse_pos(int32_t x, int32_t y) { +} + +static void gfx_wiiu_get_mouse_pos(int32_t* x, int32_t* y) { + *x = 0; + *y = 0; +} + +static void gfx_wiiu_get_mouse_delta(int32_t* x, int32_t* y) { + *x = 0; + *y = 0; +} + +static void gfx_wiiu_get_mouse_wheel(float* x, float* y) { + *x = 0; + *y = 0; +} + +static bool gfx_wiiu_get_mouse_state(uint32_t btn) { + return false; +} + +static void gfx_wiiu_set_mouse_capture(bool capture) { +} + +static bool gfx_wiiu_is_mouse_captured() { + return false; } static void gfx_wiiu_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bool (*on_key_up)(int scancode), @@ -473,7 +502,14 @@ struct GfxWindowManagerAPI gfx_wiiu = { gfx_wiiu_set_fullscreen_changed_callback, gfx_wiiu_set_fullscreen, gfx_wiiu_get_active_window_refresh_rate, - gfx_wiiu_show_cursor, + gfx_wiiu_set_cursor_visibility, + gfx_wiiu_set_mouse_pos, + gfx_wiiu_get_mouse_pos, + gfx_wiiu_get_mouse_delta, + gfx_wiiu_get_mouse_wheel, + gfx_wiiu_get_mouse_state, + gfx_wiiu_set_mouse_capture, + gfx_wiiu_is_mouse_captured, gfx_wiiu_get_dimensions, gfx_wiiu_handle_events, gfx_wiiu_start_frame,