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
This commit is contained in:
daniel@transgaming.com
2010-03-21 04:31:24 +00:00
parent ace5e66358
commit 159acdf5f6
3 changed files with 21 additions and 2 deletions

View File

@@ -323,6 +323,8 @@ class Context : public State
bool mInvalidOperation;
bool mOutOfMemory;
bool mInvalidFramebufferOperation;
bool mHasBeenCurrent;
};
}

View File

@@ -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();

View File

@@ -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)