Search code examples
c++qtopenglglew

update Opengl window continuously


I'm using Qt and OpenGL and GLEW to map a texture on a quad and render it. I want to change the texture for each frame and update the window continuously. How can I force it to update continuously?

The problem is solved as mentioned in the comments by adding a timer and connecting it to a slot to signal update function.


Solution

  • If you are using qt to create the window and manage the events like when the mouse is moving, it may cause the application to wait for an event to happen before re-drawing the window. I think you could use a QTimer object and connect its timeout signal to your update function.

    Otherwise, if you handle events with some waitEvent() function, change it with a non-blocking version.