Hi Bob,

The osgViewer library does support sharing of contexts - via the
osg::GraphicsContext::Traits::sharedContext variable this is used for
things like RTT pbuffer set up.  In SVN there is also an example of
sharing contexts in the applications/osgviewer/osgviewer.cpp.

The osgViewer also has native support for X11 windowing, as well as
other native windowing toolkits.  The support is all there but I can't
walk you through trying to integrate things with your app, I can only
point you in the right direction.  Spend some time with the code and
the examples, these should give a better idea of how things hang
together.

Robert.

On 6/22/07, Buckley, Bob CTR MDA/IC <[EMAIL PROTECTED]> wrote:
Classification:  UNCLASSIFIED
Caveats: NONE


Representative:

 Display *dsp(XOpenDisplay(NULL));
 XVisualInfo *vi = glXChooseVisual(dsp, DefaultScreen(dsp), visBuf));
 GLXContext ctxt = glXCreateContext(dsp, vi, None, True));
 XSetWindowAttributes attr;
 Window win = XCreateWindow(dsp, RootWindow(dsp, vi->screen), 0, 0,
1280, 1024,
    0, vi->depth, InputOutput, vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &attr);
 XSetStandardProperties(dsp, win, "3D", "3D", None, argv, argc, NULL);
 XMapWindow(dsp, win0);

The above code is user code so that they do their own window management
(placement, size, event handling, etc.).

I'm porting an app over from Performer that plugged XWindows in as so:

 pwin->setWinType   (PFPWIN_TYPE_X);
 pwin->setWSWindow  (dsp, win);
 pwin->setWSDrawable(dsp, win);
 pwin->setGLCxt     (ctxt);

So, if I can emulate this behavior I'm good to go.

If not, I'd have OSG create my windows sharing a single GLXContext
amongst them internally.
But, I don't know how to share that single GLXContext internally. I
suspect it's very simple to do.
I'd also have to expose window management to my end users.
Unfortunately, I don't have a good handle on the scope of what to
expose.
The GLUT windowing interface comes to mind as generic, robust, and
elligant.

Bob

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Friday, June 22, 2007 12:14 PM
To: osg users
Subject: Re: [osg-users] GLXContext Sharing (UNCLASSIFIED)

On 6/22/07, Buckley, Bob CTR MDA/IC <[EMAIL PROTECTED]> wrote:
> Unfortunately, I'm new enough to OSG that I don't have any idea how to

> do either.
> Can you point me to specifics?

What are you using for creating and managing your windows at present?
Do you do the X11 windowing yourself?

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

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

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

Reply via email to