Hi André,

The Node::releaseGLObjects(State*) is responsible for cleaning all
OpenGL objects associated with a graphics context, and
osg::GraphicsContext is now implemented to call this on all the
Camera's associated with it.  On destruction the ContextID's are also
cleaned up.  This clean up operation should allow one to create
windows on demand, including reuse of ContextID's.   I did testing
with repeatedly create and destructing viewers and associated windows
and it did work solidly under X11, but...

In the your email your mention about per context Extension objects and
this sends alarm bells off for me as currently there is no mechanism
for destruction the Extension objects and recreating them.  Under all
platforms except Windows the function pointers doing change when you
change delete and recreate graphics context, but under Windows each
context has a separate function pointer, even though its really just
the same function so.... we'll need to force the destruction of the
Extension objects too.

The questions is how to do this....  The easist way might be to have a
singleton tracking all the Extension objects for each context so we
have a single entry point in destructing all of the ones for a
particular context.

Another issue lurking is that current ContextID's are the same for
contexts that are shared, and since the Extension objects also use the
ContextID to get the approrpiate one for that context it also forces
the assumption that not only are OpenGL objects shared, but function
pointers too.  Do you know if this is a safe assumption?

Robert.



On 1/25/07, André Garneau <[EMAIL PROTECTED]> wrote:
Hi Robert,

I've been investigating the reasons windows moved from one screen (i.e.
display adapter) to another do not render properly (on the Win32 platform)
and came to the conclusion that under Windows we basically need to rebuild
the window completely from scratch when it is moved to a new display adapter
(because we need to change its pixel format relative to the new target
adapter and in Windows you cannot change the pixel format more than once).

My current idea for targeting this is to close and re-initialize the
graphics context to have it setup properly for the new display adapter since
such things as GL extensions, display lists, etc. need to be rebuilt as
well.

Looking at the code, I'm realizing that this may involve more work on the
core OSG side, since not everything related to a given context ID seem to be
cleaned up when it is freed (for example GL Extensions for the old context
ID seem to be retained, display lists in drawables also, textures, etc.)

This leads me to believe that the current code does not (for the moment)
support the dynamic reuse of a previously access context ID; it will
reallocate it but will not cleanup the previous information it held
completely.

Am I right on this or is there some code that will take care of disposing
all such data when a contextID is freed ?

André



_______________________________________________
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