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
parent ace5e663
......@@ -323,6 +323,8 @@ class Context : public State
bool mInvalidOperation;
bool mOutOfMemory;
bool mInvalidFramebufferOperation;
bool mHasBeenCurrent;
};
}
......
......@@ -29,8 +29,8 @@ class Surface
HWND getWindowHandle();
void swap();
EGLint getWidth() const;
EGLint getHeight() const;
virtual EGLint getWidth() const;
virtual EGLint getHeight() const;
virtual IDirect3DSurface9 *getRenderTarget();
virtual IDirect3DSurface9 *getDepthStencil();
......
......@@ -142,6 +142,8 @@ Context::Context(const egl::Config *config)
mInvalidOperation = false;
mOutOfMemory = false;
mInvalidFramebufferOperation = false;
mHasBeenCurrent = false;
}
Context::~Context()
......@@ -222,6 +224,21 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
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)
......
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