Hi, Stephan Irgenfried You can get it in anything that runs in cull\draw traversals (cull \ draw callbacks, camera draw callbacks etc), and may be inside viewer realize method if you subclass viewer.
Cheers, Sergey. 22.02.2011, 18:17, "Stephan Irgenfried" <[email protected]>: > Hi, > i want to display my Graphics card OpenGL and GLSL supported version as a > string. > I tried to do this by retrieving the contextID from my view window and the > use the GL2Extensions class. > But whatever i try, the contextID is always 0. > I run a single-threaded app and everything is inside my main loop. > > Code: > > osg::ref_ptr<osgViewer::Viewer> viewer = new osgViewer::Viewer(); > viewer->setSceneData(root); > viewer->setUpViewOnSingleScreen(1); > viewer->setCameraManipulator(new osgGA::TrackballManipulator(),true); > viewer->realize(); > unsigned int contextID; > while(!viewer->done()) > { > viewer->frame(); > osg::GraphicsContext* gc = viewer->getCamera()->getGraphicsContext(); > contextID = gc->getState()->getContextID(); > } > > The GraphicsContext and the State are valid pointers, but the contextID is > always 0. > > I'm running OSG 2.9.10 on a Windows 7 64bit, NVIDIA GT 430, latest drivers, > two screens. > > What am i doing wrong? > What's the easiest way to just output the OpenGL and GLSL versions? > > Thank you! > > Cheers, > Stephan[/code] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=36965#36965 > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

