summaryrefslogtreecommitdiff
path: root/indra/llrender/llrendertarget.cpp
diff options
context:
space:
mode:
authorCinder Roxley <cinder.roxley@phoenixviewer.com>2013-06-27 21:35:23 -0600
committerCinder Roxley <cinder.roxley@phoenixviewer.com>2013-06-27 21:35:23 -0600
commit35b27d558caa8a719e6648e0bf3129629c1cc5fa (patch)
tree6a1d20ad270bd7df3141e91ec9ba0ff0a080a6fc /indra/llrender/llrendertarget.cpp
parent38c1cd2d29fa48b1a28a6ba1d7ef49ae00c9a5e0 (diff)
parent6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff)
Merged lindenlab/viewer-release into default
Diffstat (limited to 'indra/llrender/llrendertarget.cpp')
-rwxr-xr-x[-rw-r--r--]indra/llrender/llrendertarget.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 5fb4fc8e52..6e22712b94 100644..100755
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -53,11 +53,19 @@ void check_framebuffer_status()
bool LLRenderTarget::sUseFBO = false;
U32 LLRenderTarget::sCurFBO = 0;
+
+extern S32 gGLViewport[4];
+
+U32 LLRenderTarget::sCurResX = 0;
+U32 LLRenderTarget::sCurResY = 0;
+
LLRenderTarget::LLRenderTarget() :
mResX(0),
mResY(0),
mFBO(0),
mPreviousFBO(0),
+ mPreviousResX(0),
+ mPreviousResY(0),
mDepth(0),
mStencil(0),
mUseDepth(false),
@@ -390,13 +398,12 @@ void LLRenderTarget::bindTarget()
{
if (mFBO)
{
- mPreviousFBO = sCurFBO;
-
stop_glerror();
+ mPreviousFBO = sCurFBO;
glBindFramebuffer(GL_FRAMEBUFFER, mFBO);
sCurFBO = mFBO;
-
+
stop_glerror();
if (gGLManager.mHasDrawBuffers)
{ //setup multiple render targets
@@ -418,7 +425,12 @@ void LLRenderTarget::bindTarget()
stop_glerror();
}
+ mPreviousResX = sCurResX;
+ mPreviousResY = sCurResY;
glViewport(0, 0, mResX, mResY);
+ sCurResX = mResX;
+ sCurResY = mResY;
+
sBoundTarget = this;
}
@@ -489,6 +501,20 @@ void LLRenderTarget::flush(bool fetch_depth)
stop_glerror();
glBindFramebuffer(GL_FRAMEBUFFER, mPreviousFBO);
sCurFBO = mPreviousFBO;
+
+ if (mPreviousFBO)
+ {
+ glViewport(0, 0, mPreviousResX, mPreviousResY);
+ sCurResX = mPreviousResX;
+ sCurResY = mPreviousResY;
+ }
+ else
+ {
+ glViewport(gGLViewport[0],gGLViewport[1],gGLViewport[2],gGLViewport[3]);
+ sCurResX = gGLViewport[2];
+ sCurResY = gGLViewport[3];
+ }
+
stop_glerror();
}
}