Important: Please read the Qt Code of Conduct -

QT and OpenGL for games

  • I already asked something similar on SO

    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?

  • Moderators

    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.

  • 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.

Log in to reply