gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations.
authorAlex Szpakowski <slime73@gmail.com>
Mon, 26 Aug 2019 18:49:04 -0300
changeset 13037d465f3a64af6
parent 13036 f5e7a1b95ffd
child 13038 b5f5c317e652
gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations.
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
     1.1 --- a/src/render/opengl/SDL_render_gl.c	Mon Aug 26 10:08:25 2019 -0700
     1.2 +++ b/src/render/opengl/SDL_render_gl.c	Mon Aug 26 18:49:04 2019 -0300
     1.3 @@ -1166,9 +1166,9 @@
     1.4                      data->drawstate.clear_color = color;
     1.5                  }
     1.6  
     1.7 -                if (data->drawstate.cliprect_enabled) {
     1.8 +                if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) {
     1.9                      data->glDisable(GL_SCISSOR_TEST);
    1.10 -                    data->drawstate.cliprect_enabled_dirty = SDL_TRUE;
    1.11 +                    data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled;
    1.12                  }
    1.13  
    1.14                  data->glClear(GL_COLOR_BUFFER_BIT);
     2.1 --- a/src/render/opengles/SDL_render_gles.c	Mon Aug 26 10:08:25 2019 -0700
     2.2 +++ b/src/render/opengles/SDL_render_gles.c	Mon Aug 26 18:49:04 2019 -0300
     2.3 @@ -866,9 +866,9 @@
     2.4                      data->drawstate.clear_color = color;
     2.5                  }
     2.6  
     2.7 -                if (data->drawstate.cliprect_enabled) {
     2.8 +                if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) {
     2.9                      data->glDisable(GL_SCISSOR_TEST);
    2.10 -                    data->drawstate.cliprect_enabled_dirty = SDL_TRUE;
    2.11 +                    data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled;
    2.12                  }
    2.13  
    2.14                  data->glClear(GL_COLOR_BUFFER_BIT);
     3.1 --- a/src/render/opengles2/SDL_render_gles2.c	Mon Aug 26 10:08:25 2019 -0700
     3.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Mon Aug 26 18:49:04 2019 -0300
     3.3 @@ -1277,9 +1277,9 @@
     3.4                      data->drawstate.clear_color = color;
     3.5                  }
     3.6  
     3.7 -                if (data->drawstate.cliprect_enabled) {
     3.8 +                if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) {
     3.9                      data->glDisable(GL_SCISSOR_TEST);
    3.10 -                    data->drawstate.cliprect_enabled_dirty = SDL_TRUE;
    3.11 +                    data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled;
    3.12                  }
    3.13  
    3.14                  data->glClear(GL_COLOR_BUFFER_BIT);