Hi Peter, GraphicsContext::ScreenIdentifier struct has the displayNum, screenNum and hostName member varaibles. GraphicsContext::Traits subclasses from ScreenIdentifier.
You can set the displayNum, screenNum and hostName on a Traits then request the creation of the graphics context that fullfills these traits via osg::GraphicsContext::createGraphicsContext(traits); I'm not sure where the best place for initializing of ScreenIndentifer from the DISPLAY env var under X11 system. Potentially it could be done in the default constructor of ScreenIndentifier, although I'm wary of this as it perhaps is a bit overzelous for apps that don't wish to honour the DISPLAY variable, and opt in scheme might be more friendly. Moving the reading of DISPLAY into osgViewer::View::setUp* might be better, and allow OSG examples and default set up viewers to honour DISPLAY, and leave it up to end users to decide whether to opt into honour the DISPLAY variable if they wish for Traits they set up themselves. Either way adding a convenince method into ScreenIdentifier to read the DISPLAY variable is the first step. Robert. On 8/2/07, Peter Gebauer <[EMAIL PROTECTED]> wrote: > Hello! > > Could someone add support for the DISPLAY variable and some command line > switch to set the display? Pretty please with a cherry on top! :) > > I tried looking at the source code for osg::GraphicsContext as well as the > osgViewer::View/Viewer code, but my C++ and understand of OSG finer detail > is not good enough at the moment. (working on it!) > > It'd be great to have this as a fix for the 2.2 release, it's no hurry > though. > Meanwhile, how does one use osg::GraphicsContext to set the display? All I > see is the getDisplay method and I can't find anything named "display" in > Traits. I'm clueless. > > /Peter > > > On 2007-08-02 (Thu) 12:40, Robert Osfield wrote: > > Hi Rich, > > > > You can set the display number programatically via > > GraphicsContext::Traits right now, but as yet I haven't added support > > into osgViewer for automatically reading the DISPLAY variable. > > > > Robert. > > > > On 8/2/07, Rich Walker <[EMAIL PROTECTED]> wrote: > > > > > > Probably a stupid question, but I can't find an answer anywhere obvious. > > > > > > I have a machine running two X servers - :0 is 16bpp and :1 is 24bpp. I > > > want to run an OSG example on :1 > > > > > > With X environment variable > > > DISPLAY=:1.0 > > > all the OSG examples display on :0, even if run from an xterm in :1. > > > > > > Any ideas? > > > > > > cheers, Rich. > > > > > > -- > > > rich walker | Shadow Robot Company | [EMAIL PROTECTED] > > > technical director 251 Liverpool Road | > > > need a Hand? London N1 1LX | +UK 20 7700 2487 > > > www.shadowrobot.com/hand/overview.shtml > > > > > > > > > _______________________________________________ > > > 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 > > > _______________________________________________ > 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

