src/render/opengl/SDL_render_gl.c
changeset 7486 c074c0b23916
parent 7420 fe82b639c4d6
child 7502 6ff02ff3cf06
equal deleted inserted replaced
7485:6ffa71faa50b 7486:c074c0b23916
   275 static int
   275 static int
   276 GL_ActivateRenderer(SDL_Renderer * renderer)
   276 GL_ActivateRenderer(SDL_Renderer * renderer)
   277 {
   277 {
   278     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
   278     GL_RenderData *data = (GL_RenderData *) renderer->driverdata;
   279 
   279 
   280     GL_ClearErrors(renderer);
       
   281     if (SDL_CurrentContext != data->context) {
   280     if (SDL_CurrentContext != data->context) {
   282         if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
   281         if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) {
   283             return -1;
   282             return -1;
   284         }
   283         }
   285         SDL_CurrentContext = data->context;
   284         SDL_CurrentContext = data->context;
   286 
   285 
   287         GL_UpdateViewport(renderer);
   286         GL_UpdateViewport(renderer);
   288     }
   287     }
       
   288 
       
   289     GL_ClearErrors(renderer);
       
   290 
   289     return 0;
   291     return 0;
   290 }
   292 }
   291 
   293 
   292 /* This is called if we need to invalidate all of the SDL OpenGL state */
   294 /* This is called if we need to invalidate all of the SDL OpenGL state */
   293 static void
   295 static void