mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
Pass video_frame_info_t to update_window_title
This commit is contained in:
parent
be2f921ee2
commit
3d92ce140e
@ -719,17 +719,16 @@ bool x11_connect(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void x11_update_window_title(void *data)
|
void x11_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
if (video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)))
|
if (video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps)))
|
||||||
XStoreName(g_x11_dpy, g_x11_win, buf);
|
XStoreName(g_x11_dpy, g_x11_win, buf);
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ bool x11_alive(void *data);
|
|||||||
|
|
||||||
bool x11_connect(void);
|
bool x11_connect(void);
|
||||||
|
|
||||||
void x11_update_window_title(void *data);
|
void x11_update_window_title(void *data, video_frame_info_t video_info);
|
||||||
|
|
||||||
bool x11_input_ctx_new(bool true_full);
|
bool x11_input_ctx_new(bool true_full);
|
||||||
|
|
||||||
|
@ -1461,7 +1461,7 @@ static bool d3d_frame(void *data, const void *frame,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
video_context_driver_update_window_title();
|
video_context_driver_update_window_title(video_info);
|
||||||
|
|
||||||
performance_counter_stop(&d3d_frame);
|
performance_counter_stop(&d3d_frame);
|
||||||
|
|
||||||
|
@ -1280,7 +1280,7 @@ static bool gl_frame(void *data, const void *frame,
|
|||||||
gl_render_overlay(gl);
|
gl_render_overlay(gl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
video_context_driver_update_window_title();
|
video_context_driver_update_window_title(video_info);
|
||||||
|
|
||||||
performance_counter_stop(&frame_run);
|
performance_counter_stop(&frame_run);
|
||||||
|
|
||||||
|
@ -125,7 +125,6 @@ static void *vg_init(const video_info_t *video,
|
|||||||
interval = video->vsync ? 1 : 0;
|
interval = video->vsync ? 1 : 0;
|
||||||
|
|
||||||
video_context_driver_swap_interval(&interval);
|
video_context_driver_swap_interval(&interval);
|
||||||
video_context_driver_update_window_title();
|
|
||||||
|
|
||||||
vg->mTexType = video->rgb32 ? VG_sXRGB_8888 : VG_sRGB_565;
|
vg->mTexType = video->rgb32 ? VG_sXRGB_8888 : VG_sRGB_565;
|
||||||
vg->keep_aspect = video->force_aspect;
|
vg->keep_aspect = video->force_aspect;
|
||||||
@ -425,7 +424,7 @@ static bool vg_frame(void *data, const void *frame,
|
|||||||
vg_draw_message(vg, msg);
|
vg_draw_message(vg, msg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
video_context_driver_update_window_title();
|
video_context_driver_update_window_title(video_info);
|
||||||
|
|
||||||
performance_counter_stop(&vg_fr);
|
performance_counter_stop(&vg_fr);
|
||||||
|
|
||||||
|
@ -1914,7 +1914,7 @@ static bool vulkan_frame(void *data, const void *frame,
|
|||||||
performance_counter_stop(&swapbuffers);
|
performance_counter_stop(&swapbuffers);
|
||||||
|
|
||||||
if (!vk->context->swap_interval_emulation_lock)
|
if (!vk->context->swap_interval_emulation_lock)
|
||||||
video_context_driver_update_window_title();
|
video_context_driver_update_window_title(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. */
|
||||||
|
@ -808,7 +808,7 @@ static bool xv_frame(void *data, const void *frame, unsigned width,
|
|||||||
true);
|
true);
|
||||||
XSync(g_x11_dpy, False);
|
XSync(g_x11_dpy, False);
|
||||||
|
|
||||||
x11_update_window_title(NULL);
|
x11_update_window_title(NULL, video_info);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -313,17 +313,16 @@ static bool android_gfx_ctx_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void android_gfx_ctx_update_window_title(void *data)
|
static void android_gfx_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -292,17 +292,16 @@ static bool gfx_ctx_qnx_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_qnx_update_window_title(void *data)
|
static void gfx_ctx_qnx_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128] = {0};
|
char buf[128];
|
||||||
char buf_fps[128] = {0};
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
(void)data;
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,18 +112,16 @@ static bool gfx_ctx_cgl_set_resize(void *data, unsigned width, unsigned height)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_cgl_update_window_title(void *data)
|
static void gfx_ctx_cgl_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
(void)data;
|
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,7 +415,7 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
|
|||||||
*height = CGRectGetHeight(size) * screenscale;
|
*height = CGRectGetHeight(size) * screenscale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cocoagl_gfx_ctx_update_window_title(void *data)
|
static void cocoagl_gfx_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_COCOA)
|
#if defined(HAVE_COCOA)
|
||||||
ui_window_cocoa_t view;
|
ui_window_cocoa_t view;
|
||||||
@ -423,7 +423,6 @@ static void cocoagl_gfx_ctx_update_window_title(void *data)
|
|||||||
#endif
|
#endif
|
||||||
static char buf_fps[128] = {0};
|
static char buf_fps[128] = {0};
|
||||||
static char buf[128] = {0};
|
static char buf[128] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
@ -435,7 +434,7 @@ static void cocoagl_gfx_ctx_update_window_title(void *data)
|
|||||||
if (window && *buf)
|
if (window && *buf)
|
||||||
window->set_title(&view, buf);
|
window->set_title(&view, buf);
|
||||||
#endif
|
#endif
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,11 +85,10 @@ static void gfx_ctx_d3d_swap_buffers(void *data)
|
|||||||
d3d_swap(d3d, d3dr);
|
d3d_swap(d3d, d3dr);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_d3d_update_title(void *data)
|
static void gfx_ctx_d3d_update_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buffer_fps[128];
|
char buffer_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
buf[0] = buffer_fps[0] = '\0';
|
buf[0] = buffer_fps[0] = '\0';
|
||||||
@ -102,7 +101,7 @@ static void gfx_ctx_d3d_update_title(void *data)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
{
|
{
|
||||||
#ifdef _XBOX
|
#ifdef _XBOX
|
||||||
MEMORYSTATUS stat;
|
MEMORYSTATUS stat;
|
||||||
|
@ -272,18 +272,17 @@ static bool gfx_ctx_drm_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_drm_update_window_title(void *data)
|
static void gfx_ctx_drm_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
|
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push( buf_fps, 1, 1, false);
|
runloop_msg_queue_push( buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,17 +95,16 @@ static bool gfx_ctx_emscripten_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_emscripten_update_window_title(void *data)
|
static void gfx_ctx_emscripten_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128] = {0};
|
char buf[128];
|
||||||
char buf_fps[128] = {0};
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
(void)data;
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,9 +48,10 @@ static bool gfx_ctx_null_set_resize(void *data, unsigned width, unsigned height)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_null_update_window_title(void *data)
|
static void gfx_ctx_null_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
|
(void)video_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height)
|
static void gfx_ctx_null_get_video_size(void *data, unsigned *width, unsigned *height)
|
||||||
|
@ -111,19 +111,16 @@ static bool gfx_ctx_khr_display_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_khr_display_update_window_title(void *data)
|
static void gfx_ctx_khr_display_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
(void)data;
|
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,17 +159,16 @@ static bool gfx_ctx_mali_fbdev_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_mali_fbdev_update_window_title(void *data)
|
static void gfx_ctx_mali_fbdev_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,17 +142,16 @@ static bool gfx_ctx_opendingux_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_opendingux_update_window_title(void *data)
|
static void gfx_ctx_opendingux_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,11 +307,10 @@ static void osmesa_ctx_get_video_size(void *data,
|
|||||||
*height = osmesa->height;
|
*height = osmesa->height;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void osmesa_ctx_update_window_title(void *data)
|
static void osmesa_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
static char buf[128] = {0};
|
static char buf[128] = {0};
|
||||||
static char buf_fps[128] = {0};
|
static char buf_fps[128] = {0};
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
gfx_ctx_osmesa_data_t *osmesa = (gfx_ctx_osmesa_data_t*)data;
|
||||||
|
|
||||||
if (!osmesa)
|
if (!osmesa)
|
||||||
@ -319,7 +318,7 @@ static void osmesa_ctx_update_window_title(void *data)
|
|||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps));
|
video_monitor_get_fps(buf, sizeof(buf), buf_fps, sizeof(buf_fps));
|
||||||
|
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,11 +198,10 @@ static bool gfx_ctx_ps3_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_ps3_update_window_title(void *data)
|
static void gfx_ctx_ps3_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
@ -210,7 +209,7 @@ static void gfx_ctx_ps3_update_window_title(void *data)
|
|||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,8 +165,8 @@ static void sdl_ctx_swap_interval(void *data, unsigned interval)
|
|||||||
static bool sdl_ctx_set_video_mode(void *data, unsigned width, unsigned height,
|
static bool sdl_ctx_set_video_mode(void *data, unsigned width, unsigned height,
|
||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
unsigned fsflag = 0;
|
unsigned fsflag = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||||
|
|
||||||
sdl->g_new_width = width;
|
sdl->g_new_width = width;
|
||||||
@ -267,15 +267,10 @@ static void sdl_ctx_get_video_size(void *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdl_ctx_update_window_title(void *data)
|
static void sdl_ctx_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
|
||||||
|
|
||||||
if (!sdl)
|
|
||||||
return;
|
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
@ -283,12 +278,15 @@ static void sdl_ctx_update_window_title(void *data)
|
|||||||
buf_fps, sizeof(buf_fps)))
|
buf_fps, sizeof(buf_fps)))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SDL2
|
#ifdef HAVE_SDL2
|
||||||
SDL_SetWindowTitle(sdl->g_win, buf);
|
gfx_ctx_sdl_data_t *sdl = (gfx_ctx_sdl_data_t*)data;
|
||||||
|
if (sdl)
|
||||||
|
SDL_SetWindowTitle(sdl->g_win, buf);
|
||||||
#else
|
#else
|
||||||
SDL_WM_SetCaption(buf, NULL);
|
SDL_WM_SetCaption(buf, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (settings->fps_show)
|
|
||||||
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,17 +105,16 @@ static bool gfx_ctx_vc_set_resize(void *data, unsigned width, unsigned height)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vc_update_window_title(void *data)
|
static void gfx_ctx_vc_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128] = {0};
|
char buf[128];
|
||||||
char buf_fps[128] = {0};
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
(void)data;
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,17 +146,16 @@ static bool gfx_ctx_vivante_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_vivante_update_window_title(void *data)
|
static void gfx_ctx_vivante_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128] = {0};
|
char buf[128];
|
||||||
char buf_fps[128] = {0};
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
|
|
||||||
(void)data;
|
buf[0] = buf_fps[0] = '\0';
|
||||||
|
|
||||||
video_monitor_get_fps(buf, sizeof(buf),
|
video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps));
|
buf_fps, sizeof(buf_fps));
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -720,11 +720,10 @@ static bool gfx_ctx_wl_set_resize(void *data, unsigned width, unsigned height)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wl_update_window_title(void *data)
|
static void gfx_ctx_wl_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
gfx_ctx_wayland_data_t *wl = (gfx_ctx_wayland_data_t*)data;
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
@ -733,7 +732,7 @@ static void gfx_ctx_wl_update_window_title(void *data)
|
|||||||
buf_fps, sizeof(buf_fps)))
|
buf_fps, sizeof(buf_fps)))
|
||||||
wl_shell_surface_set_title(wl->shell_surf, buf);
|
wl_shell_surface_set_title(wl->shell_surf, buf);
|
||||||
|
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,11 +386,10 @@ static bool gfx_ctx_wgl_set_resize(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gfx_ctx_wgl_update_window_title(void *data)
|
static void gfx_ctx_wgl_update_window_title(void *data, video_frame_info_t video_info)
|
||||||
{
|
{
|
||||||
char buf[128];
|
char buf[128];
|
||||||
char buf_fps[128];
|
char buf_fps[128];
|
||||||
settings_t *settings = config_get_ptr();
|
|
||||||
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
const ui_window_t *window = ui_companion_driver_get_window_ptr();
|
||||||
|
|
||||||
buf[0] = buf_fps[0] = '\0';
|
buf[0] = buf_fps[0] = '\0';
|
||||||
@ -398,7 +397,7 @@ static void gfx_ctx_wgl_update_window_title(void *data)
|
|||||||
if (window && video_monitor_get_fps(buf, sizeof(buf),
|
if (window && video_monitor_get_fps(buf, sizeof(buf),
|
||||||
buf_fps, sizeof(buf_fps)))
|
buf_fps, sizeof(buf_fps)))
|
||||||
window->set_title(&main_window, buf);
|
window->set_title(&main_window, buf);
|
||||||
if (settings->fps_show)
|
if (video_info.fps_show)
|
||||||
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
runloop_msg_queue_push(buf_fps, 1, 1, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,6 +452,7 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
bool fullscreen)
|
bool fullscreen)
|
||||||
{
|
{
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
video_frame_info_t video_info;
|
||||||
bool true_full = false;
|
bool true_full = false;
|
||||||
bool windowed_full = false;
|
bool windowed_full = false;
|
||||||
int val = 0;
|
int val = 0;
|
||||||
@ -563,8 +564,15 @@ static bool gfx_ctx_x_set_video_mode(void *data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
video_info.refresh_rate = settings->video.refresh_rate;
|
||||||
|
video_info.black_frame_insertion =
|
||||||
|
settings->video.black_frame_insertion;
|
||||||
|
video_info.hard_sync = settings->video.hard_sync;
|
||||||
|
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||||
|
video_info.fps_show = settings->fps_show;
|
||||||
|
|
||||||
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
||||||
x11_update_window_title(NULL);
|
x11_update_window_title(NULL, video_info);
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
||||||
|
@ -264,6 +264,7 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
|||||||
XEvent event;
|
XEvent event;
|
||||||
EGLint egl_attribs[16];
|
EGLint egl_attribs[16];
|
||||||
EGLint vid, num_visuals;
|
EGLint vid, num_visuals;
|
||||||
|
video_frame_info_t video_info;
|
||||||
EGLint *attr = NULL;
|
EGLint *attr = NULL;
|
||||||
bool windowed_full = false;
|
bool windowed_full = false;
|
||||||
bool true_full = false;
|
bool true_full = false;
|
||||||
@ -355,8 +356,15 @@ static bool gfx_ctx_xegl_set_video_mode(void *data,
|
|||||||
if (!egl_create_surface(&xegl->egl, (void*)g_x11_win))
|
if (!egl_create_surface(&xegl->egl, (void*)g_x11_win))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
video_info.refresh_rate = settings->video.refresh_rate;
|
||||||
|
video_info.black_frame_insertion =
|
||||||
|
settings->video.black_frame_insertion;
|
||||||
|
video_info.hard_sync = settings->video.hard_sync;
|
||||||
|
video_info.hard_sync_frames = settings->video.hard_sync_frames;
|
||||||
|
video_info.fps_show = settings->fps_show;
|
||||||
|
|
||||||
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
x11_set_window_attr(g_x11_dpy, g_x11_win);
|
||||||
x11_update_window_title(NULL);
|
x11_update_window_title(NULL, video_info);
|
||||||
|
|
||||||
if (fullscreen)
|
if (fullscreen)
|
||||||
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
x11_show_mouse(g_x11_dpy, g_x11_win, false);
|
||||||
|
@ -100,7 +100,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*);
|
void (*update_window_title)(void*, video_frame_info_t video_info);
|
||||||
|
|
||||||
/* Queries for resize and quit events.
|
/* Queries for resize and quit events.
|
||||||
* Also processes events. */
|
* Also processes events. */
|
||||||
@ -290,9 +290,9 @@ bool video_context_driver_set(const gfx_ctx_driver_t *data);
|
|||||||
|
|
||||||
void video_context_driver_destroy(void);
|
void video_context_driver_destroy(void);
|
||||||
|
|
||||||
#define video_context_driver_update_window_title() \
|
#define video_context_driver_update_window_title(video_info) \
|
||||||
if (current_video_context && current_video_context->update_window_title) \
|
if (current_video_context && current_video_context->update_window_title) \
|
||||||
current_video_context->update_window_title(video_context_data)
|
current_video_context->update_window_title(video_context_data, video_info)
|
||||||
|
|
||||||
#define video_context_driver_swap_buffers() \
|
#define video_context_driver_swap_buffers() \
|
||||||
if (current_video_context && current_video_context->swap_buffers) \
|
if (current_video_context && current_video_context->swap_buffers) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user