mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +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
|
#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);
|
video_context_driver_swap_buffers(video_info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -272,6 +272,10 @@ static bool gdi_gfx_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
InvalidateRect(hwnd, NULL, false);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1272,6 +1272,10 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
gl_render_overlay(gl, video_info);
|
gl_render_overlay(gl, video_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (video_info->cb_update_window_title)
|
||||||
|
video_info->cb_update_window_title(
|
||||||
|
video_info->context_data, video_info);
|
||||||
|
|
||||||
#ifdef HAVE_FBO
|
#ifdef HAVE_FBO
|
||||||
/* Reset state which could easily mess up libretro core. */
|
/* Reset state which could easily mess up libretro core. */
|
||||||
if (gl->hw_render_fbo_init)
|
if (gl->hw_render_fbo_init)
|
||||||
|
@ -422,6 +422,10 @@ static bool vg_frame(void *data, const void *frame,
|
|||||||
vg_draw_message(vg, msg);
|
vg_draw_message(vg, msg);
|
||||||
#endif
|
#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);
|
video_context_driver_swap_buffers(video_info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -244,6 +244,10 @@ static bool vga_gfx_frame(void *data, const void *frame,
|
|||||||
if (msg)
|
if (msg)
|
||||||
font_driver_render_msg(video_info, NULL, msg, NULL);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1926,6 +1926,11 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
|
|
||||||
video_context_driver_swap_buffers(video_info);
|
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,
|
/* Handle spurious swapchain invalidations as soon as we can,
|
||||||
* i.e. right after swap buffers. */
|
* i.e. right after swap buffers. */
|
||||||
if (vk->should_resize)
|
if (vk->should_resize)
|
||||||
|
@ -2266,9 +2266,6 @@ void video_driver_frame(const void *data, unsigned width,
|
|||||||
|
|
||||||
if (video_info.fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(video_info.fps_text, 1, 1, false);
|
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)
|
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->runloop_is_slowmotion = is_slowmotion;
|
||||||
|
|
||||||
video_info->input_driver_nonblock_state = input_driver_is_nonblock_state();
|
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
|
#ifdef HAVE_THREADS
|
||||||
video_driver_threaded_unlock(is_threaded);
|
video_driver_threaded_unlock(is_threaded);
|
||||||
#endif
|
#endif
|
||||||
|
@ -74,6 +74,10 @@ enum display_flags
|
|||||||
|
|
||||||
typedef void (*gfx_ctx_proc_t)(void);
|
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
|
typedef struct video_info
|
||||||
{
|
{
|
||||||
/* Width of window.
|
/* Width of window.
|
||||||
@ -199,6 +203,8 @@ typedef struct video_frame_info
|
|||||||
float xmb_alpha_factor;
|
float xmb_alpha_factor;
|
||||||
|
|
||||||
char fps_text[128];
|
char fps_text[128];
|
||||||
|
update_window_title cb_update_window_title;
|
||||||
|
void *context_data;
|
||||||
} video_frame_info_t;
|
} video_frame_info_t;
|
||||||
|
|
||||||
typedef struct gfx_ctx_driver
|
typedef struct gfx_ctx_driver
|
||||||
@ -242,7 +248,7 @@ typedef struct gfx_ctx_driver
|
|||||||
float (*translate_aspect)(void*, unsigned, unsigned);
|
float (*translate_aspect)(void*, unsigned, unsigned);
|
||||||
|
|
||||||
/* Asks driver to update window title (FPS, etc). */
|
/* 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.
|
/* Queries for resize and quit events.
|
||||||
* Also processes events. */
|
* Also processes events. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user