Skip to content

Commit

Permalink
SDL_render_gl.c: GL_RunCommandQueue: always set viewport_dirty on macOS
Browse files Browse the repository at this point in the history
Without this, moving the window changes the viewport and causes contents
to render stretched.

Fixes #1504
  • Loading branch information
ericwa authored and icculus committed Nov 27, 2021
1 parent 4f683f0 commit b786c10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/render/opengl/SDL_render_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1169,6 +1169,12 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic
}
}

#ifdef __MACOSX__
// On macOS, moving the window seems to invalidate the OpenGL viewport state,
// so don't bother trying to persist it across frames; always reset it.
// Workaround for: https://github.com/libsdl-org/SDL/issues/1504
data->drawstate.viewport_dirty = SDL_TRUE;
#endif

while (cmd) {
switch (cmd->command) {
Expand Down

0 comments on commit b786c10

Please sign in to comment.