[Qt-interest] QGLWidget Starving Application Event Handler

Oliver.Knoll at comit.ch Oliver.Knoll at comit.ch
Thu Apr 8 09:04:27 CEST 2010


Marc Zinck wrote on Wednesday, April 07, 2010 6:15 PM:

> ...
> myQGLWidget has a signal called renderingComplete() which is emited
> at the end of paintGL(). 

The question "How do I measure FPS with [OpenGL/DirectX]" pops up every then and when and is not as simple as it might first appear. For example when paintGL() finishes that does *not* necessarily mean that the current frame has been fully drawn (unlike http://www.opengl.org/resources/faq/technical/performance.htm actually suggests, see chapter 22.020)! OpenGL calls are mostly asynchronously "wandering down the rendering pipepline", until the GPU decides to render. In theory you could issue a glFlush() after each paint, but you don't want to do that (for performance reasons).

So usually one renders "100 frames at full speed" and measures the time it takes to do so, then calculating the average time (FPS).

I know my comment does not answer your actual question, but maybe you should reconsider your design how you measure your FPS. And maybe that would then also solve your problem.

Cheers, Oliver
-- 
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22



More information about the Qt-interest-old mailing list