[Qt-interest] QGLWidget 30 fps maximum on Windows XP
andy fillebrown
andy.fillebrown at gmail.com
Wed Jan 19 11:32:29 CET 2011
Hi Oliver,
Yes, some examples trigger animations with timers, but others set
QGLFormat::swapInterval to 1 and use a separate thread to swap the
front/back buffer which should allow the app to reach at least the
screen's refresh rate. Specifically, the qml-scenegraph project from
qt-labs uses this method (afaik). Curiously, I've not found any
method that can exceed 30 fps when my machine is on Windows XP (I'm
using Fraps to determine fps, btw), but I discovered today that
Windows 7 does not have this limitation and the qml-scenegraph
examples all run faster than 60 fps on that OS (according to Fraps,
anyway).
Regardless of how the fps is calculated, I can't see the individual
frames on Win7 like I can on XP, so it seems as though achieving a
velvet fps on XP is not possible on my machine when using QGLWidget.
No worries -- I'll just switch over to Win7 for development. I'm
overdue on that anyway =)
I am curious to know why the 30 fps ceiling on Windows XP is there,
though. Other non-qt apps don't have this limitation -- why does Qt?
As I said, though, I'm switching over to Win7, so the question isn't
pressing anymore.
Cheers,
~ andy.f
On Wed, Jan 19, 2011 at 4:04 AM, <Oliver.Knoll at comit.ch> wrote:
> 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
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list