mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 06:40:07 +00:00
Implement FPS show message option (Debug Info Text) for most
graphics contexts using message queue
This commit is contained in:
parent
c0c6ecc6cb
commit
a98f0336df
@ -198,6 +198,9 @@ static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
char buf[128], buf_fps[128];
|
||||
gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps));
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static bool gfx_ctx_set_video_mode(
|
||||
|
@ -217,6 +217,9 @@ static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
char buf[128], buf_fps[128];
|
||||
gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps));
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||
|
@ -83,8 +83,10 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height)
|
||||
static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
char buf[128], buf_fps[128];
|
||||
if (gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps))
|
||||
RARCH_LOG("%s\n", buf);
|
||||
gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps));
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||
|
@ -165,13 +165,11 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height)
|
||||
|
||||
static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
gl_t *gl = (gl_t*)driver.video_data;
|
||||
char buf[128], buf_fps[128];
|
||||
if (gfx_get_fps(buf, sizeof(buf), true, buf_fps, sizeof(buf_fps)))
|
||||
XStoreName(g_dpy, g_win, buf);
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) &&
|
||||
gl->font_ctx)
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
|
@ -188,20 +188,12 @@ static void gfx_ctx_set_resize(unsigned width, unsigned height) { }
|
||||
|
||||
static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
gl_t *gl = (gl_t*)driver.video_data;
|
||||
char buf[128], buf_fps[128];
|
||||
|
||||
if (gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps)) &&
|
||||
(g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)) &&
|
||||
gl->font_ctx)
|
||||
{
|
||||
font_params_t params = {0};
|
||||
params.x = g_settings.video.msg_pos_x;
|
||||
params.y = 0.56f;
|
||||
params.scale = 1.04f;
|
||||
params.color = WHITE;
|
||||
gl->font_ctx->render_msg(gl, buf, ¶ms);
|
||||
}
|
||||
gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps));
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||
|
@ -111,6 +111,9 @@ static void gfx_ctx_update_window_title(void)
|
||||
{
|
||||
char buf[128], buf_fps[128]
|
||||
gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps));
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||
|
@ -280,6 +280,9 @@ static void gfx_ctx_update_window_title(void)
|
||||
char buf[128], buf_fps[128];
|
||||
if (gfx_get_fps(buf, sizeof(buf), false, buf_fps, sizeof(buf_fps)))
|
||||
SetWindowText(g_hwnd, buf);
|
||||
|
||||
if ((g_extern.lifecycle_mode_state & (1ULL << MODE_FPS_DRAW)))
|
||||
msg_queue_push(g_extern.msg_queue, buf_fps, 1, 1);
|
||||
}
|
||||
|
||||
static void gfx_ctx_get_video_size(unsigned *width, unsigned *height)
|
||||
|
Loading…
x
Reference in New Issue
Block a user