View Full Version : Texture not updating in openGL

02-20-2018, 01:43 AM

I have a piece of code where I am changing the image for the texture. Even though the paint function(Qt) of the class is called, it doesn't change. I can remove and bring it back, but the changes are not visible unless I destroy and recreate the object. What might I be missing?


Dark Photon
02-20-2018, 05:37 AM
I haven't worked with OpenGL under Qt lately. Have you tried searching for some tips and tutorials based on the Qt interface you're using? For instance:

* https://stackoverflow.com/questions/5807886/how-to-work-with-opengl-and-qt

From a pure OpenGL perspective: 1) Update the texture (e.g. using an FBO), 2) Render the texture onto some geometry in the window framebuffer or "blit" the texture directly onto the window framebuffer, 3) Tell the windowing system that the window framebuffer is ready to display. However, you need to learn how the Qt interface you're using is making use of OpenGL to make the best use of it.