From 9706b174847143402db4150e0d497d4f8a152151 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 21 May 2025 16:04:36 +0200 Subject: Add the FPS macro Used to calculate FPS. --- CMakeLists.txt | 1 + src/main/engine/engine.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 006cbf4..21ad1bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ project(tris) set(OpenGL_GL_PREFERENCE GLVND) find_package(OpenGL REQUIRED) +#add_definitions(-DX11 -DFPS) add_definitions(-DX11) add_executable(tris diff --git a/src/main/engine/engine.c b/src/main/engine/engine.c index 18c39b5..d8314c9 100644 --- a/src/main/engine/engine.c +++ b/src/main/engine/engine.c @@ -125,7 +125,9 @@ engine_calculate_fps() end = time(NULL); if (end - start >= 1.0) { +#ifdef FPS printf("FPS: %d\n", frames); +#endif frames = 0; start = time(NULL); } -- cgit v1.2.3