summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--glcapture.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/glcapture.c b/glcapture.c
index 5ac6836..5344215 100644
--- a/glcapture.c
+++ b/glcapture.c
@@ -508,11 +508,16 @@ draw_indicator(const GLint view[4])
static void
swap_buffers(void)
{
- static __thread uint64_t last_time;
+ static __thread uint64_t last_time, fps_time;
const uint64_t ts = get_time_ns();
const uint32_t fps = (last_time > 0 ? 1.0 / ((ts - last_time) / 1e9) : TARGET_FPS);
last_time = ts;
+ if ((ts - fps_time) / 1e9 > 5.0) {
+ WARNX("FPS: %u", fps);
+ fps_time = ts;
+ }
+
void* (*procs[])(const char*) = {
(void*)_eglGetProcAddress,
(void*)_glXGetProcAddressARB,