diff options
author | 2025-05-21 16:04:36 +0200 | |
---|---|---|
committer | 2025-05-21 16:04:36 +0200 | |
commit | 9706b174847143402db4150e0d497d4f8a152151 (patch) | |
tree | bb528816fe1ef8723d88001f7fa726ea556f9fb7 | |
parent | ce91cfc683355441bb4c62b6942aaf6db4675fdf (diff) | |
download | tris-9706b174847143402db4150e0d497d4f8a152151.tar.gz tris-9706b174847143402db4150e0d497d4f8a152151.zip |
Add the FPS macro
Used to calculate FPS.
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/main/engine/engine.c | 2 |
2 files changed, 3 insertions, 0 deletions
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); } |