How to make multiple QGLWidgets share the same QGLContext?
-
Sorry, I got another question. Can the sharing relationship be propagated and commutated? For example
@ QGLWidget * glWidget=new QGLWidget(QGLFormat::defaultFormat(),this);
QGLWidget * glWidget1=new QGLWidget(QGLFormat::defaultFormat(),this,glWidget);
QGLWidget * glWidget2=new QGLWidget(QGLFormat::defaultFormat(),this,glWidget1);@glWidget is the share widget of glWidget1. According to the Qt doc glWidget1 will share its OpenGL resources with glWidget, which can be accessed in glWidget. How about glWidget's OpenGL resources? Can they be accessed in glWidget1?
Then glWidget1 is passed as share widget to glWidget2, so how about the relationship between glWidget and glWidget2.Thanks!
-
When a gl widget has another one as sharing gl widget, both of them are pointing to a unique set of share-able resources (it's like sharing smart pointers): glWidget, glWidget1 and glWidget2 all work on a unique set of resources. So, yes glWidget can "access" glWidget1 and glWidget2, glWidget1 can "access" glWidget and glWidget2 and glWidget2 can "access" glWidget and glWidget1. For what I can say, there is no limitation in the number of gl widget sharing the same resources.
-
[quote author="tilsitt" date="1356098680"]When a gl widget has another one as sharing gl widget, both of them are pointing to a unique set of share-able resources (it's like sharing smart pointers): glWidget, glWidget1 and glWidget2 all work on a unique set of resources. So, yes glWidget can "access" glWidget1 and glWidget2, glWidget1 can "access" glWidget and glWidget2 and glWidget2 can "access" glWidget and glWidget1. For what I can say, there is no limitation in the number of gl widget sharing the same resources.[/quote]
Great! Thank you for being such a big help! :)
-
I have a problem in sharing a GLContext between two GLWidgets,
I have Dual monitor system which has got NVidia Graphics Card, Monitors are configured as Screen 0 & Screen 1 ( Separate X Screens). and i am trying to create one GLwidget on Screen 0 and the second GLWidget on Screen 1, if Both GLWidgets are at same screen i am able to share the context but if i create a second GLWidget on Screen 1 context is not sharing. Advance Thanks for any help. -
When a gl widget has another one as sharing gl widget, both of them are pointing to a unique set of share-able resources (it's like sharing smart pointers): glWidget, glWidget1 and glWidget2 all work on a unique set of resources. So, yes glWidget can "access" glWidget1 and glWidget2, glWidget1 can "access" glWidget and glWidget2 and glWidget2 can "access" glWidget and glWidget1. For what I can say, there is no limitation in the number of gl widget sharing the same resources.