diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index da8ce8312a..091064ce37 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -1504,7 +1504,7 @@ static bool d3d_frame(void *data, const void *frame, } #endif - gfx_ctx_update_window_title(); + gfx_ctx_ctl(GFX_CTL_UPDATE_WINDOW_TITLE, NULL); retro_perf_stop(&d3d_frame); diff --git a/gfx/drivers/gl.c b/gfx/drivers/gl.c index fc940ff091..e453e307da 100644 --- a/gfx/drivers/gl.c +++ b/gfx/drivers/gl.c @@ -1815,7 +1815,7 @@ static bool gl_frame(void *data, const void *frame, gl_render_overlay(gl); #endif - gfx_ctx_update_window_title(); + gfx_ctx_ctl(GFX_CTL_UPDATE_WINDOW_TITLE, NULL); retro_perf_stop(&frame_run); diff --git a/gfx/drivers/vg.c b/gfx/drivers/vg.c index 6a9703bd74..b217519715 100644 --- a/gfx/drivers/vg.c +++ b/gfx/drivers/vg.c @@ -109,7 +109,7 @@ static void *vg_init(const video_info_t *video, const input_driver_t **input, vo gfx_ctx_swap_interval(video->vsync ? 1 : 0); - gfx_ctx_update_window_title(); + gfx_ctx_ctl(GFX_CTL_UPDATE_WINDOW_TITLE, NULL); vg->mTexType = video->rgb32 ? VG_sXRGB_8888 : VG_sRGB_565; vg->keep_aspect = video->force_aspect; @@ -353,7 +353,7 @@ static bool vg_frame(void *data, const void *frame, vg_draw_message(vg, msg); #endif - gfx_ctx_update_window_title(); + gfx_ctx_ctl(GFX_CTL_UPDATE_WINDOW_TITLE, NULL); retro_perf_stop(&vg_fr); diff --git a/gfx/video_context_driver.c b/gfx/video_context_driver.c index cc9c6a8cd2..b7d63743f0 100644 --- a/gfx/video_context_driver.c +++ b/gfx/video_context_driver.c @@ -104,12 +104,6 @@ const char *gfx_ctx_get_ident(void) return ctx->ident; } -void gfx_ctx_update_window_title(void) -{ - if (current_video_context->update_window_title) - current_video_context->update_window_title(video_context_data); -} - void gfx_ctx_get_video_output_size(unsigned *width, unsigned *height) { if (!current_video_context || !current_video_context->get_video_output_size) @@ -418,6 +412,11 @@ bool gfx_ctx_ctl(enum gfx_ctx_ctl_state state, void *data) { switch (state) { + case GFX_CTL_UPDATE_WINDOW_TITLE: + if (!current_video_context || !current_video_context->update_window_title) + return false; + current_video_context->update_window_title(video_context_data); + break; case GFX_CTL_SWAP_BUFFERS: if (!current_video_context || !current_video_context->swap_buffers) return false; diff --git a/gfx/video_context_driver.h b/gfx/video_context_driver.h index 0c9fc56a80..a201f1f68d 100644 --- a/gfx/video_context_driver.h +++ b/gfx/video_context_driver.h @@ -57,7 +57,8 @@ enum gfx_ctx_ctl_state GFX_CTL_FOCUS, GFX_CTL_FREE, GFX_CTL_SWAP_BUFFERS, - GFX_CTL_HAS_WINDOWED + GFX_CTL_HAS_WINDOWED, + GFX_CTL_UPDATE_WINDOW_TITLE }; typedef void (*gfx_ctx_proc_t)(void); @@ -228,8 +229,6 @@ bool gfx_ctx_check_window(bool *quit, bool *resize, bool gfx_ctx_suppress_screensaver(bool enable); -void gfx_ctx_update_window_title(void); - void gfx_ctx_get_video_size(unsigned *width, unsigned *height); bool gfx_ctx_set_resize(unsigned width, unsigned height);