c - How to calculate FPS in OpenGL? -


void calculateframerate() {         static float framespersecond    = 0.0f;       // store our fps     static float lasttime   = 0.0f;       // hold time last frame     float currenttime = gettickcount() * 0.001f;         ++framespersecond;     if( currenttime - lasttime > 1.0f )     {         lasttime = currenttime;         if(show_fps == 1) fprintf(stderr, "\ncurrent frames per second: %d\n\n", (int)framespersecond);         framespersecond = 0;     } } 

should call function in void play(void) or void display(void)?

or not make difference?

you should put in display loop. here's article explains intricacies of game loops should read.


Comments

Popular posts from this blog

how to build hyperlink for query string in php -

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

queue - mq_receive: message too long -