Corrects scissor & viewport initialization.
TRAC #11134
Takes viewport/scissor dimensions from surface at first makeCurrent, rather
than from display at context construction.
Author: Shannon Woods
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/trunk@58 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Context.cpp b/src/libGLESv2/Context.cpp
index c2b0614..a717fc5 100644
--- a/src/libGLESv2/Context.cpp
+++ b/src/libGLESv2/Context.cpp
@@ -142,6 +142,8 @@
mInvalidOperation = false;
mOutOfMemory = false;
mInvalidFramebufferOperation = false;
+
+ mHasBeenCurrent = false;
}
Context::~Context()
@@ -222,6 +224,21 @@
framebufferZero->setDepthbuffer(GL_RENDERBUFFER, 0);
framebufferZero->setStencilbuffer(GL_RENDERBUFFER, 0);
+ if(!mHasBeenCurrent)
+ {
+ viewportX = 0;
+ viewportY = 0;
+ viewportWidth = surface->getWidth();
+ viewportHeight = surface->getHeight();
+
+ scissorX = 0;
+ scissorY = 0;
+ scissorWidth = surface->getWidth();
+ scissorHeight = surface->getHeight();
+
+ mHasBeenCurrent = true;
+ }
+
defaultRenderTarget->Release();
if (depthStencil)