OpenGL+GLES renderers: Fixed incorrect clip rectangle coords (thanks, Marcel!).
authorRyan C. Gordon <icculus@icculus.org>
Mon, 28 Dec 2015 15:15:58 -0500
changeset 9977 f9cd179cf50e
parent 9976 9637657107a3
child 9978 a80ea42a4adc
OpenGL+GLES renderers: Fixed incorrect clip rectangle coords (thanks, Marcel!). Fixes Bugzilla #2700.
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
--- a/src/render/opengl/SDL_render_gl.c	Mon Dec 28 15:44:09 2015 -0400
+++ b/src/render/opengl/SDL_render_gl.c	Mon Dec 28 15:15:58 2015 -0500
@@ -1052,7 +1052,7 @@
             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);
--- a/src/render/opengles/SDL_render_gles.c	Mon Dec 28 15:44:09 2015 -0400
+++ b/src/render/opengles/SDL_render_gles.c	Mon Dec 28 15:15:58 2015 -0500
@@ -721,7 +721,7 @@
             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);
--- a/src/render/opengles2/SDL_render_gles2.c	Mon Dec 28 15:44:09 2015 -0400
+++ b/src/render/opengles2/SDL_render_gles2.c	Mon Dec 28 15:15:58 2015 -0500
@@ -418,7 +418,7 @@
             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);