diff options
Diffstat (limited to 'sdl/pyramid.c')
-rw-r--r-- | sdl/pyramid.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sdl/pyramid.c b/sdl/pyramid.c index 35cd1c6..90f513c 100644 --- a/sdl/pyramid.c +++ b/sdl/pyramid.c @@ -287,23 +287,28 @@ int main(int argc, char **argv) SetupRC(); +#ifdef STAT_FPS /* fps counter */ Uint32 startclock = 0; Uint32 deltaclock = 0; Uint32 current_fps = 0; +#endif for (;;) { +#ifdef STAT_FPS startclock = SDL_GetTicks(); +#endif processEvents(); render(); - +#ifdef STAT_FPS deltaclock = SDL_GetTicks() - startclock; if (deltaclock != 0 ) current_fps = 1000 / deltaclock; static char buffer[30] = { 0 }; sprintf(buffer, "Textured Pyramid: %04d fps", current_fps); - SDL_WM_SetCaption(buffer, NULL); + SDL_WM_SetCaption(buffer, NULL); +#endif } return 0; |