PDA

View Full Version : Access VAO across library boundaries via sharing QGLWidget contexts?



cbamber85
30th March 2011, 09:01
Hi,

I have a CAD-like Qt-based application that dynamically loads it's viewports from external libraries built using Qt's plugin architecture. The viewports can share data by sharing QGLWidgets as contexts (in a hierarchy) that contain various 'levels' of state and data:


A globally accessible shader context, this holds a context that is invisible and never rendered to, but allows shaders to be compiled.


A document accessible model context that holds the per project geometry data for sharing across viewports, again invisible and never rendered to.


Finally, a viewport context that actually does the rendering from which camera the viewport represents.

When I run the application, the plugin loads without error, but the resulting viewports throw a GL_INVALID_OPERATION error when I try to glBindVertexArray() for drawing my viewport grid. This all worked before I migrated my default viewport into a separate dynamic library!

My viewport plugin uses a QGLWidget context that is created in a different library, when I try to bind a vertex array object (built in the same library) whilst that context is active but called from my plugin library, OpenGL does not recognise the address.

My computer science knowledge isn't great, so in short - can I access/call OpenGL objects from external dynamically loaded libraries?

Thanks

cbamber85
31st March 2011, 19:52
Discovered (embarassingly) that is wasn't the problem at all, and it was just me being dim. Please delete this thread moderators!