I've got multiple instances of QGLWidget running in my Qt project, and like typical GUI-related graphics programming, each of them appear to have their own context as I am able to set different clear colors once at each initialization of my QGLWidget subclasses, and they retain each frame as the frames update. This means, my engine's internal state manager designed to cut down on redundant GL calls would be invalidated since it's a static class. I can fix that by making this an instanced class, but what concerns me is how I'd manage textures. Each viewport (which also has its own GL context) will be rendering a different scene, but I want to share the models, textures and shaders across all scenes instead of loading them once per context, as I'm assuming needs to happen. Is this the case? Is there a way to share OpenGL buffer objects across multiple contexts?
Sharing OpenGL Buffers Across QGLWidgets
Crossbones+ - Reputation: 7718
Posted 06 August 2014 - 02:38 AM
Edited by BitMaster, 06 August 2014 - 02:38 AM.
Members - Reputation: 965
Posted 01 September 2014 - 09:41 PM
I was looking through my posts, and realized I didn't respond back to you. I read your post when I was at the gym a weeks ago when you posted it, tried it, and it worked. You solved me issue, and it's fixed a few things. Sorry for leaving you hanging on the results. Thank you!