diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index c32f2dc16..d3ad24f05 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1166,9 +1166,9 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic data->drawstate.clear_color = color; } - if (data->drawstate.cliprect_enabled) { + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; } data->glClear(GL_COLOR_BUFFER_BIT); diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index 95c8bb9ab..dd5610b63 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -866,9 +866,9 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert data->drawstate.clear_color = color; } - if (data->drawstate.cliprect_enabled) { + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; } data->glClear(GL_COLOR_BUFFER_BIT); diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 028227f75..e035c1f97 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1277,9 +1277,9 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver data->drawstate.clear_color = color; } - if (data->drawstate.cliprect_enabled) { + if (data->drawstate.cliprect_enabled || data->drawstate.cliprect_enabled_dirty) { data->glDisable(GL_SCISSOR_TEST); - data->drawstate.cliprect_enabled_dirty = SDL_TRUE; + data->drawstate.cliprect_enabled_dirty = data->drawstate.cliprect_enabled; } data->glClear(GL_COLOR_BUFFER_BIT);