Add GFX_CTL_UPDATE_WINDOW_TITLE

This commit is contained in:
twinaphex 2016-02-13 08:50:22 +01:00
parent f079ca29e4
commit ef1b0b0965
5 changed files with 11 additions and 13 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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);