Added an example of the use of the PROTECTED modes and attributes into

the osgreflect demo so that toggling texturing on or off won't affect
the mirror planes texturing.
This commit is contained in:
Robert Osfield 2002-08-05 13:12:09 +00:00
parent 70724c353f
commit 25307305a0

View File

@ -45,7 +45,7 @@
osg::StateSet* createMirrorTexturedState(const std::string& filename) osg::StateSet* createMirrorTexturedState(const std::string& filename)
{ {
osg::StateSet* dstate = new osg::StateSet; osg::StateSet* dstate = new osg::StateSet;
dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF); dstate->setMode(GL_CULL_FACE,osg::StateAttribute::OFF|osg::StateAttribute::PROTECTED);
// set up the texture. // set up the texture.
osg::Image* image = osgDB::readImageFile(filename.c_str()); osg::Image* image = osgDB::readImageFile(filename.c_str());
@ -53,7 +53,7 @@ osg::StateSet* createMirrorTexturedState(const std::string& filename)
{ {
osg::Texture* texture = new osg::Texture; osg::Texture* texture = new osg::Texture;
texture->setImage(image); texture->setImage(image);
dstate->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); dstate->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON|osg::StateAttribute::PROTECTED);
} }
return dstate; return dstate;