[osg-users] Forcing a scene to rebind textures

Robert Osfield robert.osfield at gmail.com
Sun May 10 11:51:55 PDT 2015

Hi Phillipe.

When a graphics context is detroyed a releaseGLObjects() on the scene
graph should be called.  When a context is destroyed outwith the
control of the core OSG then calling
osg::discardAllGLObjects(contextID) should be done to make sure any
cached GL objects handles and discarded for that context.

The osgViewer library tries to do this all for you, but if you've
implement your own context setup/destruction then it won't have all
the control to do this automatically.


On 10 May 2015 at 13:12, philippe renon <philippe_renon at yahoo.fr> wrote:
> Hi,
> I am using osg 3.2.1 in a Qt application. Sometimes, for reasons too long to
> explain here, Qt will destroy the OpenGL context used by a scene. After that
> I see rendering problems and logs has warnings similar to this one:
> WRN: [OSG WARN] Warning: detected OpenGL error 'invalid enumerant' at After
> Renderer::compile
> The rendering issues are caused by missing textures. The geometry looks fine
> though.
> Is there a way to force a complete scene to rebind its textures or do I need
> to destroy and rebuild the scene?
> Philippe.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list