Good call Robert. makeCurrent() was/is failing.
So, what is the proper way to shut everything down? I can side-step
the issue by calling _viewer->getView(0)->setSceneData(0); ...this
has the side effect of not calling GraphicsContext::close(...), so I
avoid the crash...but this is obviously wrong and I'm sure this will
bite me later.
I'm using osgViewer::CompositeViewer in a single threaded
configuration. I looked at the osgViewer MFC example but didn't see
anything useful. Looked at the other osgViewer examples as well and
really didn't see anything that showed me how to properly shutdown
osgViewer.
So, how do I gracefully exit?
On Nov 20, 2007 2:45 AM, Robert Osfield <[EMAIL PROTECTED]> wrote:
> HI Sherman & David,
>
> This makes it sounds very much like a threading issue associated with
> making the graphics context current. In the GraphicsContext::close()
> method there is a section that does the flushing of deleted OpenGL
> objects, the code is:
>
> if (callCloseImplementation && _state.valid() && isRealized())
> {
> osg::notify(osg::INFO)<<"Closing still viable window
> "<<sharedContextExists<<"
> _state->getContextID()="<<_state->getContextID()<<std::endl;
>
> makeCurrent();
>
> osg::notify(osg::INFO)<<"Doing Flush"<<std::endl;
>
> // flush all the OpenGL object buffer for this context.
> double availableTime = 100.0f;
> double currentTime =
> _state->getFrameStamp()?_state->getFrameStamp()->getReferenceTime():0.0;
>
>
> osg::FrameBufferObject::flushDeletedFrameBufferObjects(_state->getContextID(),currentTime,availableTime);
>
> osg::RenderBuffer::flushDeletedRenderBuffers(_state->getContextID(),currentTime,availableTime);
> osg::Texture::flushAllDeletedTextureObjects(_state->getContextID());
> osg::Drawable::flushAllDeletedDisplayLists(_state->getContextID());
>
> osg::Drawable::flushDeletedVertexBufferObjects(_state->getContextID(),currentTime,availableTime);
>
> osg::VertexProgram::flushDeletedVertexProgramObjects(_state->getContextID(),currentTime,availableTime);
>
> osg::FragmentProgram::flushDeletedFragmentProgramObjects(_state->getContextID(),currentTime,availableTime);
>
> osg::Program::flushDeletedGlPrograms(_state->getContextID(),currentTime,availableTime);
>
> osg::Shader::flushDeletedGlShaders(_state->getContextID(),currentTime,availableTime);
>
> osg::notify(osg::INFO)<<"Done Flush "<<availableTime<<std::endl;
>
> _state->reset();
>
> releaseContext();
> }
>
> Now there is a makeCurrent() in there, but perhaps this is failing.
> It'd be interesting to focus on the success/failure of this call.
> makeCurrent() should return true on success so this would be something
> one could test against.
>
> Robert.
>
> Robert.
>
> _______________________________________________
> 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