mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-14 14:29:24 +00:00
Add video context driver update window title callback
to video_frame_info_t
This commit is contained in:
parent
668813cca9
commit
86ee08b7a7
@ -1461,6 +1461,10 @@ static bool d3d_frame(void *data, const void *frame,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
|
||||
return true;
|
||||
|
@ -272,6 +272,10 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
||||
|
||||
InvalidateRect(hwnd, NULL, false);
|
||||
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1272,6 +1272,10 @@ static bool gl_frame(void *data, const void *frame,
|
||||
gl_render_overlay(gl, video_info);
|
||||
#endif
|
||||
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
/* Reset state which could easily mess up libretro core. */
|
||||
if (gl->hw_render_fbo_init)
|
||||
|
@ -422,6 +422,10 @@ static bool vg_frame(void *data, const void *frame,
|
||||
vg_draw_message(vg, msg);
|
||||
#endif
|
||||
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
|
||||
return true;
|
||||
|
@ -244,6 +244,10 @@ static bool vga_gfx_frame(void *data, const void *frame,
|
||||
if (msg)
|
||||
font_driver_render_msg(video_info, NULL, msg, NULL);
|
||||
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1926,6 +1926,11 @@ static bool vulkan_frame(void *data, const void *frame,
|
||||
|
||||
video_context_driver_swap_buffers(video_info);
|
||||
|
||||
if (!vk->context->swap_interval_emulation_lock)
|
||||
if (video_info->cb_update_window_title)
|
||||
video_info->cb_update_window_title(
|
||||
video_info->context_data, video_info);
|
||||
|
||||
/* Handle spurious swapchain invalidations as soon as we can,
|
||||
* i.e. right after swap buffers. */
|
||||
if (vk->should_resize)
|
||||
|
@ -2266,9 +2266,6 @@ void video_driver_frame(const void *data, unsigned width,
|
||||
|
||||
if (video_info.fps_show)
|
||||
runloop_msg_queue_push(video_info.fps_text, 1, 1, false);
|
||||
|
||||
if (current_video_context && current_video_context->update_window_title)
|
||||
current_video_context->update_window_title(video_context_data, &video_info);
|
||||
}
|
||||
|
||||
void video_driver_display_type_set(enum rarch_display_type type)
|
||||
@ -2412,6 +2409,16 @@ void video_driver_build_info(video_frame_info_t *video_info)
|
||||
video_info->runloop_is_slowmotion = is_slowmotion;
|
||||
|
||||
video_info->input_driver_nonblock_state = input_driver_is_nonblock_state();
|
||||
|
||||
video_info->context_data = video_context_data;
|
||||
|
||||
video_info->cb_update_window_title = NULL;
|
||||
if (current_video_context)
|
||||
{
|
||||
if (current_video_context->update_window_title)
|
||||
video_info->cb_update_window_title = current_video_context->update_window_title;
|
||||
}
|
||||
|
||||
#ifdef HAVE_THREADS
|
||||
video_driver_threaded_unlock(is_threaded);
|
||||
#endif
|
||||
|
@ -74,6 +74,10 @@ enum display_flags
|
||||
|
||||
typedef void (*gfx_ctx_proc_t)(void);
|
||||
|
||||
typedef struct video_frame_info video_frame_info_t;
|
||||
|
||||
typedef void (*update_window_title)(void*, video_frame_info_t *video_info);
|
||||
|
||||
typedef struct video_info
|
||||
{
|
||||
/* Width of window.
|
||||
@ -199,6 +203,8 @@ typedef struct video_frame_info
|
||||
float xmb_alpha_factor;
|
||||
|
||||
char fps_text[128];
|
||||
update_window_title cb_update_window_title;
|
||||
void *context_data;
|
||||
} video_frame_info_t;
|
||||
|
||||
typedef struct gfx_ctx_driver
|
||||
@ -242,7 +248,7 @@ typedef struct gfx_ctx_driver
|
||||
float (*translate_aspect)(void*, unsigned, unsigned);
|
||||
|
||||
/* Asks driver to update window title (FPS, etc). */
|
||||
void (*update_window_title)(void*, video_frame_info_t *video_info);
|
||||
update_window_title update_window_title;
|
||||
|
||||
/* Queries for resize and quit events.
|
||||
* Also processes events. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user