Hi,

I integrated an overlays system into my code that essentially supports multiple 
overlays, each having multiple hud items. Each overlay uses an osg::Camera at 
its root. All this works very well, with the exception of the following issue: 
when I remove the overlay (i.e the root camera) from the  scene, I get a draw 
crash (this does not happen all the time, but very often) 

I made sure that the root of the scene (i.e Group node) has the data variance 
set to DYNAMIC.

Here is the overlay camera constructor code:


Code:

    setDataVariance( osg::Camera::DYNAMIC);
    setReferenceFrame( osg::Transform::ABSOLUTE_RF ); 
    setProjectionMatrix( osg::Matrix::ortho2D( -1, 1, -1, 1 ) );
    setViewMatrix( osg::Matrix::identity () ); 
    setClearMask( 0 ); 
    setRenderOrder( osg::Camera::POST_RENDER ); 
    // we don't want the camera to grab event focus from the viewers main 
camera(s).
    setAllowEventFocus(false);

    osg::StateSet* pStateSet = getOrCreateStateSet( );
    pStateSet->setMode( GL_DEPTH_TEST, osg::StateAttribute::OFF );
    pStateSet->setMode( GL_LIGHTING, osg::StateAttribute::OFF );
    pStateSet->setMode( GL_FOG, osg::StateAttribute::OFF );
    pStateSet->setMode( GL_CULL_FACE, osg::StateAttribute::OFF );
    pStateSet->setMode( GL_BLEND, osg::StateAttribute::OFF );




Cheers,
Guy

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=13067#13067





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to