Ported all the demos and loaders across to use the new multitexturing API.

This commit is contained in:
Robert Osfield
2002-07-10 11:22:24 +00:00
parent 46af97727a
commit c1fc3dcdb9
19 changed files with 105 additions and 50 deletions

View File

@@ -56,9 +56,9 @@ Node *makeBase( void )
StateSet *dstate = new StateSet;
dstate->setMode( GL_LIGHTING, StateAttribute::OFF );
dstate->setAttributeAndModes( tex, StateAttribute::ON );
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON );
dstate->setAttribute( new TexEnv );
dstate->setTextureAttribute(0, new TexEnv );
// clear the depth to the far plane.
osg::Depth* depth = new osg::Depth;

View File

@@ -104,8 +104,8 @@ Node *makeSky( void )
StateSet *dstate = new StateSet;
dstate->setAttributeAndModes( tex, StateAttribute::OFF );
dstate->setAttribute( new TexEnv );
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::OFF );
dstate->setTextureAttribute(0, new TexEnv );
dstate->setMode( GL_LIGHTING, StateAttribute::OFF );
dstate->setMode( GL_CULL_FACE, StateAttribute::ON );

View File

@@ -156,8 +156,8 @@ Node *makeTank( void )
tex->setImage(osgDB::readImageFile("Images/tank.rgb"));
StateSet *dstate = new StateSet;
dstate->setAttributeAndModes( tex, StateAttribute::ON );
dstate->setAttribute( new TexEnv );
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON );
dstate->setTextureAttribute(0, new TexEnv );
gset->setStateSet( dstate );
geode->addDrawable( gset );

View File

@@ -117,8 +117,8 @@ Node *makeTerrain( void )
StateSet *dstate = new StateSet;
dstate->setMode( GL_LIGHTING, StateAttribute::OFF );
dstate->setAttributeAndModes( tex, StateAttribute::ON );
dstate->setAttribute( new TexEnv );
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON );
dstate->setTextureAttribute(0, new TexEnv );
geom->setStateSet( dstate );

View File

@@ -221,8 +221,8 @@ Node *makeTrees( void )
StateSet *dstate = new StateSet;
dstate->setAttributeAndModes( tex, StateAttribute::ON );
dstate->setAttribute( new TexEnv );
dstate->setTextureAttributeAndModes(0, tex, StateAttribute::ON );
dstate->setTextureAttribute(0, new TexEnv );
dstate->setAttributeAndModes( new Transparency, StateAttribute::ON );

View File

@@ -98,7 +98,7 @@ osg::Node* createTexturedItem(const osg::Vec3& offset,osg::Texture* texture,osg:
// create the StateSet to store the texture data
osg::StateSet* stateset = osgNew osg::StateSet;
stateset->setAttributeAndModes(texture,osg::StateAttribute::ON);
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
// turn the face culling off so you can see the texture from
// all angles.

View File

@@ -53,7 +53,7 @@ osg::StateSet* createMirrorTexturedState(const std::string& filename)
{
osg::Texture* texture = new osg::Texture;
texture->setImage(image);
dstate->setAttributeAndModes(texture,osg::StateAttribute::ON);
dstate->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
}
return dstate;

View File

@@ -139,7 +139,7 @@ osg::Node* createTexturedItem(const osg::Vec3& offset,osg::Texture* texture,osg:
// create the StateSet to store the texture data
osg::StateSet* stateset = new osg::StateSet;
stateset->setAttributeAndModes(texture,osg::StateAttribute::ON);
stateset->setTextureAttributeAndModes(0,texture,osg::StateAttribute::ON);
// turn the face culling off so you can see the texture from
// all angles.