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





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to