Hi Aitor You need to use a drawCallback to make sure you have access to the glContext (the context has been made current). I use the attached to gather lots of gl info in one shot. Most of the infomation is avaliable through other osg structures I just find it's nice to have it all in one place.
Attach the GLSupportCallback as te final draw callback of you viewers camera. Then after calling frame the info will have been gathered. Cheers Tom Message: 9 > Date: Tue, 02 Nov 2010 09:45:33 +0100 > From: "Aitor Ardanza" <[email protected]> > To: [email protected] > Subject: [osg-users] glGetString(GL_VENDOR) return null > Message-ID: <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > Hi, > > I've been reading similar problems, but I have not Found the solution ... > the viewer is set in singlethreaded, and I added the GraphicsContext at the > camera properly ... > > > > Code: > // construct the viewer. > int width = 800; > int height = 600; > osgViewer::Viewer viewer; > viewer.addEventHandler(keh); > viewer.setCameraManipulator(new osgGA::TrackballManipulator()); > viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded); > int xoffset = 40; > int yoffset = 40; > osg::ref_ptr<osg::GraphicsContext::Traits> traits = new > osg::GraphicsContext::Traits; > traits->x = xoffset + 0; > traits->y = yoffset + 0; > traits->width = 600; > traits->height = 480; > traits->windowDecoration = true; > traits->doubleBuffer = true; > traits->sharedContext = 0; > > osg::ref_ptr<osg::GraphicsContext> gc = > osg::GraphicsContext::createGraphicsContext(traits.get()); > osg::ref_ptr<osg::Camera> camera = new osg::Camera; > camera->setGraphicsContext(gc.get()); > camera->setViewport(new osg::Viewport(0,0, traits->width, traits->height)); > GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; > camera->setDrawBuffer(buffer); > camera->setReadBuffer(buffer); > > // add this slave camera to the viewer, with a shift left of the projection > matrix > viewer.setCamera(camera.get()); > > viewer.setSceneData(scene); > viewer.realize(); > > const char* vendorString = reinterpret_cast<const > char*>(glGetString(GL_VENDOR)); //return NULL > > > > Why I can't access the graphics card info? > > Thank you! > > Cheers, > Aitor > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=33289#33289 > > > > > >
SystemInfo.h
Description: Binary data
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

