gl/gles/gles2 render: fix SDL_RenderClear being affected by the clip rect in some situations.

This commit is contained in:
Alex Szpakowski 2019-08-26 18:49:04 -03:00
parent ce3b16fc9e
commit 0c26373842
3 changed files with 6 additions and 6 deletions

View File

@ -1166,9 +1166,9 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
data->drawstate.clear_color = color; 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->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); data->glClear(GL_COLOR_BUFFER_BIT);

View File

@ -866,9 +866,9 @@ GLES_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vert
data->drawstate.clear_color = color; 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->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); data->glClear(GL_COLOR_BUFFER_BIT);

View File

@ -1277,9 +1277,9 @@ GLES2_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
data->drawstate.clear_color = color; 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->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); data->glClear(GL_COLOR_BUFFER_BIT);