Zajo
15th March 2015, 06:54
I'm on Qt 5.4.0 on Windows. Using QOpenGLWidget, I need to postpone the creation of OpenGL buffers, etc. until after initializeGL has executed.
I call makeCurrent, then create buffers, etc. which works fine, but when paintGL is called I get OpenGL errors, as if the OpenGL handles I'm using to draw belong to a different context. Note that if exactly the same code executed from within initializeGL, I get no errors in paintGL.
So I downloaded the source code and traced into makeCurrent (since it is a void function and doesn't indicate success or failure, perhaps this should be added to the API), and observed that everything succeeds; and I've verified that the address of the context object is the same in the code that calls initializeGL and within the makeCurrent call.
Any idea what could be wrong?
I call makeCurrent, then create buffers, etc. which works fine, but when paintGL is called I get OpenGL errors, as if the OpenGL handles I'm using to draw belong to a different context. Note that if exactly the same code executed from within initializeGL, I get no errors in paintGL.
So I downloaded the source code and traced into makeCurrent (since it is a void function and doesn't indicate success or failure, perhaps this should be added to the API), and observed that everything succeeds; and I've verified that the address of the context object is the same in the code that calls initializeGL and within the makeCurrent call.
Any idea what could be wrong?