From Alexandre Amalric, "I'm using osg svn version 2.9.5 and I've apparently found a bug in osgPlugin logo.

When using more than one view logosCullCallback function is called without checking context ID from the cull visitor is equal to logo _contextID variable. It involves updating logo's viewport with different sizes.
So I made a fix well working, at least the way I use the plugin."

Note, from Robert Osfield, changed code to return true to signal culling of logo when being applied to a window that it wasn't assigned to.
This commit is contained in:
Robert Osfield
2009-07-14 12:22:47 +00:00
parent cc37d7f439
commit 65c8357f76

View File

@@ -39,6 +39,15 @@ class Logos: public osg::Drawable
{
Logos *logos = dynamic_cast <Logos *>(drawable);
osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor *>(visitor);
if (!cv) return true;
unsigned int contextID = cv->getState()!=0 ? cv->getState()->getContextID() : 0;
if(contextID != logos->getContextID())
{
// logo not appropiate for window assigned to the cull visitor so cull it.
return true;
}
if( logos != NULL && cv != NULL )
{
osg::Viewport *vp = cv->getViewport();
@@ -168,7 +177,9 @@ class Logos: public osg::Drawable
}
osg::Viewport *getViewport() { return _viewport.get(); }
void setContextID( unsigned int id ) { _contextID = id; }
unsigned int getContextID() { return _contextID; }
bool hasLogos()
{