mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 15:29:55 +00:00
Make sure not to add duplicate viewports (Fixes #1832)
Wasn't a problem while testing reload() on linux. Maybe an implementation difference with Ogre's D3D rendersystem?
This commit is contained in:
parent
7b2070de5a
commit
f4b5662562
1 changed files with 2 additions and 0 deletions
|
@ -32,6 +32,7 @@ namespace Render
|
|||
void SelectionBuffer::setupRenderTarget()
|
||||
{
|
||||
mRenderTarget = mTexture->getBuffer()->getRenderTarget();
|
||||
mRenderTarget->removeAllViewports();
|
||||
Ogre::Viewport* vp = mRenderTarget->addViewport(mCamera);
|
||||
vp->setOverlaysEnabled(false);
|
||||
vp->setBackgroundColour(Ogre::ColourValue(0, 0, 0, 0));
|
||||
|
@ -65,6 +66,7 @@ namespace Render
|
|||
{
|
||||
Ogre::MaterialManager::getSingleton ().addListener (this);
|
||||
|
||||
mTexture->load();
|
||||
if (mRenderTarget == NULL)
|
||||
setupRenderTarget();
|
||||
|
||||
|
|
Loading…
Reference in a new issue