mirror of
https://github.com/yawut/SDL.git
synced 2026-09-08 09:06:29 -05:00
Fixed bug 1844 - glScissor calls are wrong - Patch attached
Martin Gerhardy the coordinate system from sdl is not correctly transformed to the coordinate system of opengl. glScissor expects them to be a little bit different. Attached is a patch that fixes this
This commit is contained in:
@@ -794,7 +794,8 @@ GL_UpdateClipRect(SDL_Renderer * renderer)
|
||||
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
data->glEnable(GL_SCISSOR_TEST);
|
||||
data->glScissor(rect->x, rect->h - rect->y, rect->w, rect->h);
|
||||
int lowerLeft = renderer->viewport.h - rect->y - rect->h;
|
||||
data->glScissor(rect->x, lowerLeft, rect->w, rect->h);
|
||||
} else {
|
||||
data->glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
@@ -645,7 +645,8 @@ GLES_UpdateClipRect(SDL_Renderer * renderer)
|
||||
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
data->glEnable(GL_SCISSOR_TEST);
|
||||
data->glScissor(rect->x, rect->h - rect->y, rect->w, rect->h);
|
||||
int lowerLeft = renderer->viewport.h - rect->y - rect->h;
|
||||
data->glScissor(rect->x, lowerLeft, rect->w, rect->h);
|
||||
} else {
|
||||
data->glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
@@ -288,7 +288,8 @@ GLES2_UpdateClipRect(SDL_Renderer * renderer)
|
||||
|
||||
if (!SDL_RectEmpty(rect)) {
|
||||
rdata->glEnable(GL_SCISSOR_TEST);
|
||||
rdata->glScissor(rect->x, rect->h - rect->y, rect->w, rect->h);
|
||||
int lowerLeft = renderer->viewport.h - rect->y - rect->h;
|
||||
rdata->glScissor(rect->x, lowerLeft, rect->w, rect->h);
|
||||
} else {
|
||||
rdata->glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user