Fixed an offset issue with glDrawTexiOES() when the viewport is set.

This commit is contained in:
Sam Lantinga 2011-11-10 00:22:01 -05:00
parent 51dad9cf5e
commit a6adb03997

View file

@ -701,7 +701,8 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
cropRect[3] = -srcrect->h; cropRect[3] = -srcrect->h;
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES, glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
cropRect); cropRect);
glDrawTexiOES(dstrect->x, h - dstrect->y - dstrect->h, 0, glDrawTexiOES(renderer->viewport.x + dstrect->x,
h - (renderer->viewport.y + dstrect->y) - dstrect->h, 0,
dstrect->w, dstrect->h); dstrect->w, dstrect->h);
} else { } else {