[Qt-interest] QGLWidget 30 fps maximum on Windows XP
Oliver.Knoll at comit.ch
Oliver.Knoll at comit.ch
Wed Jan 19 10:04:20 CET 2011
On 2011-01-18 Andy andy fillebrown wrote:
> I should add that every example I've tried from qml, qt3d, and other various qt-labs
> projects -- all max out at 30 fps, too. Is 30 fps the
> max on Windows XP? Does anybody know of a project I can look at that
> does animations faster than 30 fps?
How exactly do you control your animation, with some "Qt animation framework" or other timer-based trigger? It could very well be that all these Qt examples use some kind of "QTimer" based animation with an interval of 1/30 second (but I am really just guessing here!).
That said, if you would run your "scene calculation" in a separate thread "at full speed" (maybe only sync'ing against the refresh rate of your screen, so e.g. not exceeding your 60 Hz of your LCD screen) and trigger a "repaint" whenever you have re-calculated the scene (and then wait until that frame has gone down the graphic pipeline, until re-calculating the next scene frame), you should be able to reach a FPS which is only limited by your GPU/CPU power! If you do this with "raw OpenGL" inside a QGLWidget based widget I currently would not know how "Qt" would limit here the framerate to 30 FPS (which really sounds to me like there is some QTimer in the background, triggering the animation).
Cheers, Oliver
p.s. Note that determining the point when a GL image has actually been completely rendered can be quite tricky, since most GL calls are asynchronous. It's been a while since I did GL animations, but I think at that time I unblocked the calculation thread each time QWidget::paint() was done, as to re-calculate the next scene frame (taking into account the delta time which had passed since the last calculation).
--
Oliver Knoll
Dipl. Informatik-Ing. ETH
COMIT AG - ++41 79 520 95 22
More information about the Qt-interest-old
mailing list