Reputation: 129
I have an Qt based OpenGLES2.0 application, where I want to capture the FPS.
my application draw same geometry for 16 times and then try to know the FPS.
How can I make sure glDrawElements()
has finished its job ?
I want to get the correct FPS.
Is there any way to make the glDrawElements()
synchronous or Pooling the glDrawElements()
complete?
Upvotes: 2
Views: 4935
Reputation: 129
Start the timer in initializeGL. frameTime.start();
in PaintGL
paintGL ()
{
draw_your_geometry();
++frameCount;
if (frameTime.elapsed() >= 1000)
{
double fps = frameCount / ((double)frameTime.elapsed()/1000.0);
}
}
Upvotes: 4