Hi,
I'd like to ask you for help with an osg::Program we use in an osg scene
graph in our application.
We use osg with Qt where we have built a Multiple Document Interface.
Every window has it's own osgQt::GLWidget. We share OpenGL Shaders in
osg::Program among different windows using singleton pattern class.
If a window is closed and the node with a shader was connected to the
scene graph for this window then a PerContextProgram destructor is
correctly called and the program for the closed window context is
deleted. Problem emerges when we disconnect the node with the shader
first and then close the window. In this case a PerContextProgram
destructor isn't called and the object resides in the list of the
osg::Program's PerContextProgram list. After this if a new window is
created and (most likely) gets the GlContext id of the previously closed
window then a new shader program isn't created for this context because
a PerContextProgram was left in the Program's list with the same
GlContext id. Therefore when the node with the shader is traversed for
rendering an error "glValidateProgram FAILED "programName" id=3
contextID=0" occures. Also inspecting the shader programs in the
contexts using gDEBugger shows that the program is available only in the
deleted context but not in the currently used context.
Is this a correct behaviour when PerContextProgram isn't destroyed for
disconnected nodes or is it a bug?
Thank you!
Cheers
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org