From f893ce3d3ed4b9d27e48cda6fe7f8c61bacba7bd Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 28 Dec 2015 15:15:58 -0500 Subject: [PATCH] OpenGL+GLES renderers: Fixed incorrect clip rectangle coords (thanks, Marcel!). Fixes Bugzilla #2700. --- src/render/opengl/SDL_render_gl.c | 2 +- src/render/opengles/SDL_render_gles.c | 2 +- src/render/opengles2/SDL_render_gles2.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 6b825665b..0430a25eb 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1052,7 +1052,7 @@ GL_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST); diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index 18329d798..c66018dee 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -721,7 +721,7 @@ GLES_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST); diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index b911b66a5..87d7b3df2 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -418,7 +418,7 @@ GLES2_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST);