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).

Qt Code:
  1. QGLFormat format;
  2. QGLContext* context = new QGLContext(format);
  3. //GlWorld inherits from QGLWidget...
  4. GlWorld world1(context);
  5. MySprite single_sprite;
  6.  
  7. world1.InstallSprite2D(&single_sprite);
  8. world1.show();
  9. world1.run();
  10.  
  11.  
  12. // Application Crashes at the
  13. // creation of world2... not sure why?
  14. // QGLcontext, QWidget*, QGLWidget*
  15. GlWorld world2(context, NULL, &world1);
  16. world2.InstallSprite2D(&single_sprite);
  17. world2.show();
  18. world2.run();
  19.  
  20. Part of class definition...
  21. GlWorld::GlWorld(QGLContext* context,
  22. QWidget *parent, QGLWidget* shared) : QGLWidget(context, parent, shared)
  23. {
  24. ...
  25. ..
  26. }
To copy to clipboard, switch view to plain text mode 

Any help would be great... but a working example would probably be most helpful.
thanks in advance...