Hi,

I have setup a viewer using an existing window (supplying the HWND to a
GraphicsWindowWin32). In my application, this window can be toggled on
and off. If I do nothing when this happens the GraphicsWindowWin32
complains of an invalid handle when swapping buffers. 

As such, I wish to recreate the context when the window is displayed. I
have tried simply calling close on the on the old GraphicsWindowWin32
and then creating a new instance with the new window handle and setting
this on the viewer (osgViewer::Viewer). When I do this, sometimes my
model displays with corrupt textures, but in all cases I get a 'GL is
out of memory' error. I am guessing that I am not cleaning up the old
context and its associated Texture Objects etc correctly.

My question is, what is the correct way of doing this? What methods do I
need to call to clean up all the old GL objects and make sure new ones
are created? Also, do I need to call these methods while the windows
handle is still valid, and do I need to do this on the rendering thread.

Cheers,

Brad



DISCLAIMER:---------------------------------------------------------------------------
This e-mail transmission and any documents, files and previous e-mail messages
attached to it are private and confidential. They may contain proprietary or 
copyright
material or information that is subject to legal professional privilege. They 
are for
the use of the intended recipient only.  Any unauthorised viewing, use, 
disclosure,
copying, alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted without 
the
written permission of the owner. If you have received this transmission in 
error, or
are not an authorised recipient, please immediately notify the sender by return 
email,
delete this message and all copies from your e-mail system, and destroy any 
printed
copies. Receipt by anyone other than the intended recipient should not be 
deemed a
waiver of any privilege or protection. Thales Australia does not warrant or 
represent
that this e-mail or any documents, files and previous e-mail messages attached 
are
error or virus free.
--------------------------------------------------------------------------------------

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

Reply via email to