Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QOpenGLWindow - Window lags when animating via frameSwapped() signal.
Forum Updated to NodeBB v4.3 + New Features

QOpenGLWindow - Window lags when animating via frameSwapped() signal.

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TReed0803
    wrote on last edited by
    #1

    I've been teaching myself OpenGL via Qt5's new QOpenGL* classes. So far I'm very impressed!

    I noticed however, that when animating my windowed application by using the frameSwapped() signal to call update() slot, the window lags when I try to drag or move it around. I want to be able to animate via the VSync, and I had thought that this should work. Should I instead be using QTimer?

    The "documentation":http://doc-snapshot.qt-project.org/qt5-dev/qopenglwindow.html seems to imply that you don't want to use QTimer, and that after SwapBuffer is called "an update can be scheduled again by calling update()"

    My thought is that the following code would be appropriate:

    @
    connect(this, SIGNAL(frameSwapped()), this, SLOT(update()));
    @

    However, this causes moving/dragging the window to lag noticeably on my machine.

    If it helps, you can find my full source code here:
    "https://github.com/TReed0803/QtOpenGL/tree/master/2_3DRendering":https://github.com/TReed0803/QtOpenGL/tree/master/2_3DRendering

    Thanks in advanced!

    1 Reply Last reply
    0
    • T Offline
      T Offline
      TReed0803
      wrote on last edited by
      #2

      Hey everyone, looking again at the documentation for the SIGNAL frameSwapped() under QOpenGLWindow, I'm confident that this is the intended usage of the SIGNAL.

      I will proceed with this setup, but I am still bothered by the lag in physically moving/resizing the window that this produces. Do you guys think that I can write up a bug report on it?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi and welcome to devnet,

        It sounds indeed strange. You should also try the #qt channel IRC. You might catch some the OpenGL guys there who may have an answer.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TReed0803
          wrote on last edited by
          #4

          Hey SGaist,

          I think it's a Window's specific issue. The same code runs without any problem on my Mac Mini. I have refrained from posting more until I see whether it's "just my machine" or indeed a problem with QOpenGLWindow on Windows 8.1 systems.

          The same problems do NOT occur on OS X.

          I will post again when I test the code on other machines.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            TReed0803
            wrote on last edited by
            #5

            For anyone wondering, I have found a workaround which I document in a blog post of mine, here ("http://www.trentreed.net/blog/week-in-development/":http://www.trentreed.net/blog/week-in-development/)

            I will post again when I figure out more.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You could also try with one the nightly builds to see if it has been fixed in between

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • T Offline
                T Offline
                TReed0803
                wrote on last edited by
                #7

                Hey SGaist,

                Thanks for the replies. :)

                I had reported it to the developer mailing list and someone responded. It looks like it should be fixed in the next version, but I haven't had time to grab a nightly to test it out. Just checking back in to let people know it shouldn't be an issue for long.

                As soon as I can confirm the change and test to see that everything is better, I will confirm this as SOLVED. Sorry for the delay.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  No problem with the delays, as long as you can get further ;)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved