mirror of https://github.com/encounter/SDL.git
Fixed bug 4542 - Image flipped vertically when rendering on texture
Have to recompute viewport because projection/glOrtho is different wether rendering is on target texture or not
This commit is contained in:
parent
28f54ee439
commit
b28e956b8c
|
@ -773,6 +773,8 @@ GL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
return SDL_SetError("Render targets not supported by OpenGL");
|
||||
}
|
||||
|
||||
data->drawstate.viewport_dirty = SDL_TRUE;
|
||||
|
||||
if (texture == NULL) {
|
||||
data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
return 0;
|
||||
|
|
|
@ -503,6 +503,8 @@ GLES_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
return SDL_SetError("Can't enable render target support in this renderer");
|
||||
}
|
||||
|
||||
data->drawstate.viewport_dirty = SDL_TRUE;
|
||||
|
||||
if (texture == NULL) {
|
||||
data->glBindFramebufferOES(GL_FRAMEBUFFER_OES, data->window_framebuffer);
|
||||
return 0;
|
||||
|
|
|
@ -1748,6 +1748,8 @@ GLES2_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
GLES2_TextureData *texturedata = NULL;
|
||||
GLenum status;
|
||||
|
||||
data->drawstate.viewport_dirty = SDL_TRUE;
|
||||
|
||||
if (texture == NULL) {
|
||||
data->glBindFramebuffer(GL_FRAMEBUFFER, data->window_framebuffer);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue