QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
I want to use Qt5 with OpenGL. I saw the talk from Sean Harmer on youtube.
Someone was able to recreate the code from the talk.
But if I try to execute it I get the following error message " QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined ", and a transparent window appears.
The code that is causing this error is probably:
Any idea why I get this error?
The main problem is that the window is transparent. My guess is that this problem is related to the error message.
Where in code you said that you are using DoubleBuffer? SwapBuffer Only works when you use doubleBuffer.
The problem is, if the window is shown in the application but it is not in the window management system, it is a non exposed window. You cant swap the buffer on it.
You have to do the first draw after exposeEvent occurs or check if( !isExposed ) on window before you draw.