0
votes

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.

2
What do you mean by "update the window continuously" ?Shumush
I want to load the texture and display it and then load the second texture and display it and so on. now it updates the window every time the mouse moves. I am also using qt and OpenGL.user3178756
Then you should look at your main loop, if it waits for an event or if it polls for an event. I think qt waits for an event by default, hence blocking your loop. But i'm not sure.Shumush
How are you updating your window with your actual code?rgmt
Please edit your question to show what you have tried so far. You should include a minimal reproducible example of the code that you are having problems with, then we can try to help with the specific problem. You should also read How to Ask.Toby Speight

2 Answers

2
votes

If you mean swap the buffers you need to call your platform specific swap function (wglSwapBuffers, glXSwapBuffers etc.) every frame and make sure vsync is disabled. If you mean let the window resize it's not an open gl specific question, that's down to the windowing system, also.

1
votes

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.