QOpenGLWindow - Window lags when animating via frameSwapped() signal.
-
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_3DRenderingThanks in advanced!
-
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?
-
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.
-
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.
-
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.
-
You could also try with one the nightly builds to see if it has been fixed in between
-
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.
-
No problem with the delays, as long as you can get further ;)