Make it possible to reuse FPS logging in console ports
This commit is contained in:
parent
29d269b282
commit
ddc1e0fda7
|
@ -52,12 +52,7 @@ static float tv_to_fps(const struct timeval *tv, const struct timeval *new_tv, i
|
||||||
|
|
||||||
static unsigned gl_frames = 0;
|
static unsigned gl_frames = 0;
|
||||||
|
|
||||||
void gfx_window_title_reset(void)
|
bool gfx_get_fps(char *buf, size_t size)
|
||||||
{
|
|
||||||
gl_frames = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool gfx_window_title(char *buf, size_t size)
|
|
||||||
{
|
{
|
||||||
static struct timeval tv;
|
static struct timeval tv;
|
||||||
struct timeval new_tv;
|
struct timeval new_tv;
|
||||||
|
@ -81,6 +76,18 @@ bool gfx_window_title(char *buf, size_t size)
|
||||||
ret = true;
|
ret = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void gfx_window_title_reset(void)
|
||||||
|
{
|
||||||
|
gl_frames = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool gfx_window_title(char *buf, size_t size)
|
||||||
|
{
|
||||||
|
bool ret = gfx_get_fps(buf, size);
|
||||||
|
|
||||||
gl_frames++;
|
gl_frames++;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "../boolean.h"
|
#include "../boolean.h"
|
||||||
|
|
||||||
|
bool gfx_get_fps(char *buf, size_t size);
|
||||||
bool gfx_window_title(char *buf, size_t size);
|
bool gfx_window_title(char *buf, size_t size);
|
||||||
void gfx_window_title_reset(void);
|
void gfx_window_title_reset(void);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue