Example #1
0
void
ImageOverlay::postCTOR()
{
    _geode = new osg::Geode;

    _transform = new osg::MatrixTransform;
    _transform->addChild( _geode );

    // place the geometry under a drapeable node so it will project onto the terrain    
    DrapeableNode* d = new DrapeableNode( getMapNode() );
    addChild( d );

    d->addChild( _transform );

    init();

    if ( Registry::capabilities().supportsGLSL() )
    {
        ShaderGenerator gen;
        d->accept( gen );
        //// need a shader that supports one texture
        //VirtualProgram* vp = new VirtualProgram();
        //vp->setName( "imageoverlay");
        //vp->installDefaultColoringShaders(1);
        //d->getOrCreateStateSet()->setAttributeAndModes( vp, 1 );
    }

    ADJUST_UPDATE_TRAV_COUNT( this, 1 );
}