How do you get the frame rate in opengl/c++ ?
Printable View
How do you get the frame rate in opengl/c++ ?
ok heres the simplest way
~pseudo code!
Code:
// declare these where you need them
// FPS stores last seconds fps
// fcount is out current fps counter
int FPS = 0, int fcount;
// our timer for each second
long timetest = 0;
//later on...
drawframe();
fcount++;
if(timetest == timer)
{
timetest = timer + 1 sec; // set timer for next second
FPS = fcount; // set the FPS
fcount = 0; // clear the counter
}
GameTutorials has a tutorial on getting the FPS (in OGL). Exactly what yer lookin for :).
Whew i thought you meant "How to make first person shooter in OpenGL" :D