Fixed bug 3569 - GL_UpdateViewport leaves PROJECTION matrix selected
authorSam Lantinga <slouken@libsdl.org>
Fri, 27 Jan 2017 21:23:27 -0800
changeset 1086171d8f9afb690
parent 10860 7f08396c7581
child 10862 f8343b61abf7
Fixed bug 3569 - GL_UpdateViewport leaves PROJECTION matrix selected

Tom Seddon

GL_ActivateRenderer may call GL_UpdateViewport, which leaves the GL_PROJECTION matrix selected. But after GL_ResetState, the GL_MODELVIEW matrix is selected, suggesting that's the intended default state.

It seems at least like these should be consistent. Presumably GL_UpdateViewport should be doing a glMatrixMode(GL_MODELVIEW) before it finishes.
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Fri Jan 27 21:16:38 2017 -0800
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Fri Jan 27 21:23:27 2017 -0800
     1.3 @@ -1041,6 +1041,8 @@
     1.4                             0.0, 1.0);
     1.5          }
     1.6      }
     1.7 +    data->glMatrixMode(GL_MODELVIEW);
     1.8 +
     1.9      return GL_CheckError("", renderer);
    1.10  }
    1.11  
     2.1 --- a/src/render/opengles/SDL_render_gles.c	Fri Jan 27 21:16:38 2017 -0800
     2.2 +++ b/src/render/opengles/SDL_render_gles.c	Fri Jan 27 21:23:27 2017 -0800
     2.3 @@ -692,6 +692,8 @@
     2.4                             0.0, 1.0);
     2.5          }
     2.6      }
     2.7 +    data->glMatrixMode(GL_MODELVIEW);
     2.8 +
     2.9      return 0;
    2.10  }
    2.11