forked from mirror/openmw-tes3mp
re-use the texture across preview instances
This commit is contained in:
parent
e2b1329620
commit
4453459378
1 changed files with 5 additions and 2 deletions
|
@ -54,10 +54,13 @@ namespace MWRender
|
||||||
mCamera->setNearClipDistance (0.01);
|
mCamera->setNearClipDistance (0.01);
|
||||||
mCamera->setFarClipDistance (1000);
|
mCamera->setFarClipDistance (1000);
|
||||||
|
|
||||||
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
|
mTexture = Ogre::TextureManager::getSingleton().getByName (mName);
|
||||||
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
|
if (mTexture.isNull ())
|
||||||
|
mTexture = Ogre::TextureManager::getSingleton().createManual(mName,
|
||||||
|
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mSizeX, mSizeY, 0, Ogre::PF_A8R8G8B8, Ogre::TU_RENDERTARGET);
|
||||||
|
|
||||||
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
|
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
|
||||||
|
mRenderTarget->removeAllViewports ();
|
||||||
mViewport = mRenderTarget->addViewport(mCamera);
|
mViewport = mRenderTarget->addViewport(mCamera);
|
||||||
mViewport->setOverlaysEnabled(false);
|
mViewport->setOverlaysEnabled(false);
|
||||||
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
|
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
|
||||||
|
|
Loading…
Reference in a new issue