No need to divide ot sth...
int fps = 0; int fpsTimer = 0; char *fpsText = new char[ 10 ];
bool running = true; do {
// handle input
int now = SDL_GetTicks();
if ( now > fpsTimer + 1000 ) // count fps in 1 sec (1000 ms)
{
sprintf( fpsText, "%d FPS", fps ); fpsTimer = now; fps = 0;
}
// draw goes here
// blit fps text
SDL_Flip( display ); fps++;
} while ( running );
--
qXy