Skip to content

Commit

Permalink
Disable FPS output
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed Feb 2, 2022
1 parent b44e8ef commit dbf6427
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/SDLU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ struct BufferedKey
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)
Expand Down Expand Up @@ -439,14 +434,21 @@ void SDLU_Present()

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
}

0 comments on commit dbf6427

Please sign in to comment.