Avoid creating extra texture unit states on the video material

This commit is contained in:
Chris Robinson 2012-12-15 04:17:28 -08:00
parent d50698d7d1
commit da44141b95

View file

@ -949,7 +949,10 @@ VideoPlayer::VideoPlayer(Ogre::SceneManager* sceneMgr)
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
mVideoMaterial->getTechnique(0)->getPass(0)->createTextureUnitState()->setTextureName("black.png");
if(mVideoMaterial->getTechnique(0)->getPass(0)->getNumTextureUnitStates() == 0)
mVideoMaterial->getTechnique(0)->getPass(0)->createTextureUnitState()->setTextureName("black.png");
else
mVideoMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("black.png");
mRectangle = new Ogre::Rectangle2D(true);
mRectangle->setCorners(-1.0, 1.0, 1.0, -1.0);