Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
kantaki last edited by
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.
1313 last edited by
Where in code you said that you are using DoubleBuffer? SwapBuffer Only works when you use doubleBuffer.
kane last edited by
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.