Hi Stephan,

If you only have one graphics context the ContextID for this graphics
context will be 0.  The OSG uses the C convention of starting at 0 for
almost all arrays.

Robert.

On Tue, Feb 22, 2011 at 3:17 PM, Stephan Irgenfried
<[email protected]> wrote:
> 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

Reply via email to