Hi Michael,

One doesn't normally need to create a new context when resizing a
window.  Why do you need to in your case?

If you do close a context and assign a new one then you'll need to
make sure that you clean up all the OpenGL object handles that the
scene graph maintains when disposing of the one scene graph so when
you assign the new one it properly recreates all the OpenGL objects.
osgViewer has code to do automatically but it sounds like you are
doing stuff at a lower level so you'll need to recreate this.  See the
include/osg/Node for the osg::Node::releaseGLObjects(State*) method
that releases all the OpenGL objects for a given context, and
include/osg/GLObjects helper functions for cleaning up delete OpenGL
objects once they have been released from the scene graph.

Robert.

On 2 August 2012 11:58, michael kapelko <[email protected]> wrote:
> Hi.
> I want to have window resize with full screen in my OSG game, but I'm
> facing a problem. When I resize the window second time, the loaded
> resources are lost. The resize is done by first setting screen
> resolution and then creating graphics context.
> How can I implement window resize with full screen without reloading
> all game resources?
> Thanks.
>
> PS: Sample source code is attached.
>
> _______________________________________________
> 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

Reply via email to