Hi Terry,

On Sun, Oct 18, 2009 at 11:12 PM, Terry Welsh <[email protected]> wrote:
> I'm working on and OSG/SDL application.  Resizing the window in Linux
> works fine, but resizing it in Windows causes the app to lose all its
> OpenGL objects.  Is there a recommended way to re-initialize all
> OpenGL objects?

I really wouldn't recommend using SDL for windowing...

In your case it does sound like SDL is deleting the original graphics
context and then recreating a completely new one on resize.

> So far I have been experimenting with SceneView's releaseAllGLObjects,
> flushAllDeletedGLObjects, and COMPILE_GLOBJECTS_AT_INIT.  But this has
> mostly led to crashes and hasn't fixed the problem.  Just thought I
> would take a break and see if anyone has any other suggestions....

The problem is that the scene graph itself is retaining handles to the
original OpenGL objects and still has this around when you try to
reapply them to a completely new graphics context, which
unsurprisingly causes problems.  The scene graph itself doesn't know
about the fact that you've changed the graphics context from
underneath it so you'll need to tell it but doing a
scenegraph->releaseGLObjects();   The SceneView methods just clean up
already released GL objects, so you'd call these after the scenegraph
release.

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

Reply via email to