mirror of
https://github.com/yawut/SDL.git
synced 2026-08-26 18:55:32 -05:00
Don't try to clear errors in GL_ActivateRenderer() before we MakeCurrent.
Otherwise, if we destroyed a different renderer, next time this one draws, it'll clear errors forever (GL_INVALID_OPERATION for having no current context, at least on Windows), hanging up the program in an infinite loop. Fixes Bugzilla #1775.
This commit is contained in:
@@ -277,7 +277,6 @@ GL_ActivateRenderer(SDL_Renderer * renderer)
|
||||
{
|
||||
GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
|
||||
|
||||
GL_ClearErrors(renderer);
|
||||
if (SDL_CurrentContext != data->context) {
|
||||
if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
|
||||
return -1;
|
||||
@@ -286,6 +285,9 @@ GL_ActivateRenderer(SDL_Renderer * renderer)
|
||||
|
||||
GL_UpdateViewport(renderer);
|
||||
}
|
||||
|
||||
GL_ClearErrors(renderer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user