Hi Eric,

On 2/7/07, E. Wing <[EMAIL PROTECTED]> wrote:
So I thought I would try supporting shared contexts with
SimpleViewerCocoa. But the SimpleViewer API seems to discourage this
as the SimpleViewer constructor automatically increments the
contextID.

Currently, my workaround looks like this:
        simpleViewer = new osgViewer::SimpleViewer;
    simpleViewer->getSceneView()->getState()->setContextID(0);
        osg::DisplaySettings::instance()->setMaxNumberOfGraphicsContexts(1);

Is this the best way of dealing with it?

SimpleViewer does what SimpleViewer is.  It assumes that nothing
clever is being done behind the scenes and works to hide the
complexities of managing multiple graphics contexts and has no
knowledge of sharing contexts.

I'm hesitant to add extra API to SimpleViewer to provide for this
possibility as it soon becomes WasASimpleViewer.

I certainly want to support shared contexts with the main osgViewer
classes though, this will be done entirely through the GraphicsContext
base class that does allow for sharing, and even manages the contextID
automatically.  I'll need to check up on the status of the
GraphicsWindow implementation to see if they implement it properly.

It would be good to extend the ability to reuse existing windows in
the GraphicsWindow* implementations too.  Andre has added support
under Windows already, but I haven't done this for X11 yet, and I
presume GraphicsWindowCarbon is also lacking.  Could you have a look
to see what it would take under OSX?

I'd like to make it easier for users to use the full blown viewer
classes, and all the threading, multiple window and multiple view
support that it entails.  SimpleViewer is something I see for just
very straightforward viewer needs.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to