diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 643f2488a..f8fe0c4b5 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -290,7 +290,8 @@ GL_ActivateRenderer(SDL_Renderer * renderer) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - if (SDL_CurrentContext != data->context) { + if (SDL_CurrentContext != data->context || + SDL_GL_GetCurrentContext() != data->context) { if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { return -1; } @@ -310,7 +311,7 @@ GL_ResetState(SDL_Renderer *renderer) { GL_RenderData *data = (GL_RenderData *) renderer->driverdata; - if (SDL_CurrentContext == data->context) { + if (SDL_GL_GetCurrentContext() == data->context) { GL_UpdateViewport(renderer); } else { GL_ActivateRenderer(renderer);