Hi Martin, On 21 July 2012 11:08, GeeKer Wang <[email protected]> wrote: > In GLUT, there is a function glutGetWindow to get the current context ID. > > As far as I know, OSG get contextID for osg::RenderInfo in application. > > Are there other ways to get cureent GraphicContext ID in a thread?
All rendering code in the OSG gets passed either a RenderInfo object which has the osg::State object for the current context or gets passed the osg::State object directly, the osg::State has a getContextID() method. For none rendering code there isn't a current context so there isn't a single ContextID that is appropriate, rather you have to decide which active GraphicsContext in the viewer is appropriate, so just get the windows from the viewer and then examine then for their osg::State object and ContextID. However, one must ask what your want the ContextID for, it's also nothing to do with any context ID that GLUT might want to manage, the osg::State::ContextID only has meaning with the OSG. Robert. _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

