Commit e01700a9 authored by hybrid's avatar hybrid

Fix MRT disabling. Bug found and fixed by hendu.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4219 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 8106d420
......@@ -4121,7 +4121,8 @@ bool COpenGLDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuff
#endif
// check if we should set the previous RT back
if (RenderTargetTexture != texture)
if ((RenderTargetTexture != texture) ||
(CurrentTarget==ERT_MULTI_RENDER_TEXTURES))
{
setActiveTexture(0, 0);
ResetRenderStates=true;
......@@ -4135,6 +4136,7 @@ bool COpenGLDriver::setRenderTarget(video::ITexture* texture, bool clearBackBuff
// we want to set a new target. so do this.
glViewport(0, 0, texture->getSize().Width, texture->getSize().Height);
RenderTargetTexture = static_cast<COpenGLTexture*>(texture);
// calls glDrawBuffer as well
RenderTargetTexture->bindRTT();
CurrentRendertargetSize = texture->getSize();
CurrentTarget=ERT_RENDER_TEXTURE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment