From 0c2637384227fc95661f934c47a5ff7be9dfbfc9 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Mon, 26 Aug 2019 18:49:04 -0300 Subject: [PATCH] gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations. --- src/render/opengl/SDL_render_gl.c | 4 ++-- src/render/opengles/SDL_render_gles.c | 4 ++-- src/render/opengles2/SDL_render_gles2.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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);