Fixed YUV texture update with a subrect in OpenGL ES 2.0 - thanks Sylvain!
authorSam Lantinga <slouken@libsdl.org>
Wed, 25 Jun 2014 21:06:47 -0700
changeset 8959 9dbfb553c555
parent 8958 ef544b7b4c4f
child 8960 bd5d3388da09
Fixed YUV texture update with a subrect in OpenGL ES 2.0 - thanks Sylvain!
src/render/opengles2/SDL_render_gles2.c
--- a/src/render/opengles2/SDL_render_gles2.c	Wed Jun 25 22:38:40 2014 -0400
+++ b/src/render/opengles2/SDL_render_gles2.c	Wed Jun 25 21:06:47 2014 -0700
@@ -694,8 +694,8 @@
 
     data->glBindTexture(tdata->texture_type, tdata->texture_v);
     GLES2_TexSubImage2D(data, tdata->texture_type,
-                    rect->x,
-                    rect->y,
+                    rect->x / 2,
+                    rect->y / 2,
                     rect->w / 2,
                     rect->h / 2,
                     tdata->pixel_format,
@@ -704,8 +704,8 @@
 
     data->glBindTexture(tdata->texture_type, tdata->texture_u);
     GLES2_TexSubImage2D(data, tdata->texture_type,
-                    rect->x,
-                    rect->y,
+                    rect->x / 2,
+                    rect->y / 2,
                     rect->w / 2,
                     rect->h / 2,
                     tdata->pixel_format,