From 3d5f4a690108bffb008b990524275021738aec07 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 25 Jun 2014 21:06:47 -0700 Subject: [PATCH] Fixed YUV texture update with a subrect in OpenGL ES 2.0 - thanks Sylvain! --- src/render/opengles2/SDL_render_gles2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index a980024b9..b30e35c06 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -694,8 +694,8 @@ GLES2_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, 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 @@ GLES2_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture, 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,