ref: dbf642749d4890bced0a237d5c512ff0f8083b51
parent: b44e8ef6381ebd4a2579a22bf8ff1b427ee9437f
author: Iliyas Jorio <[email protected]>
date: Wed Feb 2 16:36:30 EST 2022
Disable FPS output
--- a/src/SDLU.cpp
+++ b/src/SDLU.cpp
@@ -47,11 +47,6 @@
static MBoolean s_interestedInTyping = false;
static std::deque<BufferedKey> s_keyBuffer;
-// To compute frames per second
-static int s_fpsAccumulator = 0;
-static int s_fpsSampleStart = 0;
-const int k_fpsSampleInterval = 500;
-
int SDLUi_EventFilter(void*, SDL_Event *event)
{
switch (event->type)
@@ -439,14 +434,21 @@
SDL_RenderCopy(g_renderer, g_windowTexture, widescreen ? &g_widescreenCrop : NULL, NULL);
SDL_RenderPresent(g_renderer);
-
+
+#if 0
+ static int s_fpsAccumulator = 0;
+ static int s_fpsSampleStart = 0;
+ const int k_fpsSampleInterval = 500;
+
s_fpsAccumulator++;
int now = SDL_GetTicks();
int elapsed = now - s_fpsSampleStart;
- if (elapsed > k_fpsSampleInterval) {
+ if (elapsed > k_fpsSampleInterval)
+ {
float fps = s_fpsAccumulator / (elapsed / 1000.0f);
printf("FPS: %.1f\n", fps);
s_fpsAccumulator = 0;
s_fpsSampleStart = now;
}
+#endif
}