From 25307305a0138776d83691afd559ff82c085ff9e Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 5 Aug 2002 13:12:09 +0000 Subject: [PATCH] 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. --- src/Demos/osgreflect/osgreflect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Demos/osgreflect/osgreflect.cpp b/src/Demos/osgreflect/osgreflect.cpp index fa796b793..4147e4385 100644 --- a/src/Demos/osgreflect/osgreflect.cpp +++ b/src/Demos/osgreflect/osgreflect.cpp @@ -45,7 +45,7 @@ osg::StateSet* createMirrorTexturedState(const std::string& filename) { 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. 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; texture->setImage(image); - dstate->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON); + dstate->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON|osg::StateAttribute::PROTECTED); } return dstate;