Skip to content

Commit

Permalink
wiiu: Update Fast3D APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryOderNichts committed Jan 2, 2025
1 parent 13ef722 commit 0622ac4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/graphic/Fast3D/gfx_gx2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
40 changes: 38 additions & 2 deletions src/graphic/Fast3D/gfx_wiiu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 0622ac4

Please sign in to comment.