зеркало из https://github.com/AvaloniaUI/angle.git
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:
Родитель
ace5e66358
Коммит
159acdf5f6
|
@ -323,6 +323,8 @@ class Context : public State
|
||||||
bool mInvalidOperation;
|
bool mInvalidOperation;
|
||||||
bool mOutOfMemory;
|
bool mOutOfMemory;
|
||||||
bool mInvalidFramebufferOperation;
|
bool mInvalidFramebufferOperation;
|
||||||
|
|
||||||
|
bool mHasBeenCurrent;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ class Surface
|
||||||
HWND getWindowHandle();
|
HWND getWindowHandle();
|
||||||
void swap();
|
void swap();
|
||||||
|
|
||||||
EGLint getWidth() const;
|
virtual EGLint getWidth() const;
|
||||||
EGLint getHeight() const;
|
virtual EGLint getHeight() const;
|
||||||
|
|
||||||
virtual IDirect3DSurface9 *getRenderTarget();
|
virtual IDirect3DSurface9 *getRenderTarget();
|
||||||
virtual IDirect3DSurface9 *getDepthStencil();
|
virtual IDirect3DSurface9 *getDepthStencil();
|
||||||
|
|
|
@ -142,6 +142,8 @@ Context::Context(const egl::Config *config)
|
||||||
mInvalidOperation = false;
|
mInvalidOperation = false;
|
||||||
mOutOfMemory = false;
|
mOutOfMemory = false;
|
||||||
mInvalidFramebufferOperation = false;
|
mInvalidFramebufferOperation = false;
|
||||||
|
|
||||||
|
mHasBeenCurrent = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::~Context()
|
Context::~Context()
|
||||||
|
@ -222,6 +224,21 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface)
|
||||||
framebufferZero->setDepthbuffer(GL_RENDERBUFFER, 0);
|
framebufferZero->setDepthbuffer(GL_RENDERBUFFER, 0);
|
||||||
framebufferZero->setStencilbuffer(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();
|
defaultRenderTarget->Release();
|
||||||
|
|
||||||
if (depthStencil)
|
if (depthStencil)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче