Ported all the demos and loaders across to use the new multitexturing API.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user