Single QGLContext across multiple QGLWidgets
I'm having some serious issues trying to figure out how I successfully share a single QGLContext across multiple QGLWidgets. I want to share resources (display lists, vertex buffer objects, textures, etc) across both to optimize data loading (i.e. only create a single large VBO to draw in multiple gl windows).
Code:
//GlWorld inherits from QGLWidget...
GlWorld world1(context);
MySprite single_sprite;
world1.InstallSprite2D(&single_sprite);
world1.show();
world1.run();
// Application Crashes at the
// creation of world2... not sure why?
// QGLcontext, QWidget*, QGLWidget*
GlWorld world2(context, NULL, &world1);
world2.InstallSprite2D(&single_sprite);
world2.show();
world2.run();
Part of class definition...
{
...
..
}
Any help would be great... but a working example would probably be most helpful.
thanks in advance...
Re: Single QGLContext across multiple QGLWidgets
No one have any ideas on this?
Re: Single QGLContext across multiple QGLWidgets
What does GlWorld::run() do?