QT and OpenGL for games
-
wrote on 15 Dec 2012, 17:38 last edited by
I already asked something similar on SO http://stackoverflow.com/questions/13892384/qt-and-opengl-for-game-development
The first reply says that for games its recommended to use something like GLFW over QT because the latencies of the QT eventloop are somewhat unpredictable.
Can you confirm this?
In general what other pro and cons do I have with QT vs GLFW / SDL?
-
wrote on 16 Dec 2012, 01:02 last edited by
I think that answer over on SO is misleading.
- Signals and slots typically do not use the event loop at all. Think of them as function calls. There are exceptions to that rule, though.
- If signals/slots were using the event loop, then that would improve latency as you do less before going back to the event loop.
As with all event loops you need to make sure not to block it for too long. That is true with all event loops out there, independent of whether it is the one in Qt, GLFW or SDL.
-
wrote on 17 Dec 2012, 08:50 last edited by
I agree with Tobias. In fact Qt5 with QWindow, QOpenGLContext and friends is actually a very nice alternative to SDL, glut etc.
How you keep the event loop responsive is entirely down to what you do in the main thread. You can of course offload your rendering to a worker thread - Qt Quick 2 does exactly this.
1/3