Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed an offset issue with glDrawTexiOES() when the viewport is set.
  • Loading branch information
slouken committed Nov 10, 2011
1 parent 1dad8d7 commit 37dd290
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/render/opengles/SDL_render_gles.c
Expand Up @@ -488,7 +488,7 @@ GLES_UpdateViewport(SDL_Renderer * renderer)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof((GLfloat) 0,
(GLfloat) renderer->viewport.w,
(GLfloat) renderer->viewport.w,
(GLfloat) renderer->viewport.h,
(GLfloat) 0, 0.0, 1.0);
return 0;
Expand Down Expand Up @@ -701,7 +701,8 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
cropRect[3] = -srcrect->h;
glTexParameteriv(GL_TEXTURE_2D, GL_TEXTURE_CROP_RECT_OES,
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);
} else {

Expand Down

0 comments on commit 37dd290

Please sign in to comment.