src/render/opengles2/SDL_render_gles2.c
changeset 6178 1fc633857667
parent 6171 7b9126fde949
child 6188 e82023802002
equal deleted inserted replaced
6177:645cb51a75cb 6178:1fc633857667
   176         SDL_CurrentContext = NULL;
   176         SDL_CurrentContext = NULL;
   177     }
   177     }
   178 
   178 
   179     if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
   179     if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
   180         /* According to Apple documentation, we need to finish drawing NOW! */
   180         /* According to Apple documentation, we need to finish drawing NOW! */
   181 	glFinish();
   181         glFinish();
   182     }
   182     }
   183 }
   183 }
   184 
   184 
   185 static int
   185 static int
   186 GLES2_UpdateViewport(SDL_Renderer * renderer)
   186 GLES2_UpdateViewport(SDL_Renderer * renderer)
   204 
   204 
   205     /* Deallocate everything */
   205     /* Deallocate everything */
   206     if (rdata) {
   206     if (rdata) {
   207         GLES2_ActivateRenderer(renderer);
   207         GLES2_ActivateRenderer(renderer);
   208 
   208 
   209 	{
   209         {
   210 	    GLES2_ShaderCacheEntry *entry;
   210             GLES2_ShaderCacheEntry *entry;
   211 	    GLES2_ShaderCacheEntry *next;
   211             GLES2_ShaderCacheEntry *next;
   212 	    entry = rdata->shader_cache.head;
   212             entry = rdata->shader_cache.head;
   213 	    while (entry)
   213             while (entry)
   214 	    {
   214             {
   215                 glDeleteShader(entry->id);
   215                 glDeleteShader(entry->id);
   216                 next = entry->next;
   216                 next = entry->next;
   217                 SDL_free(entry);
   217                 SDL_free(entry);
   218                 entry = next;
   218                 entry = next;
   219 	    }
   219             }
   220 	}
   220         }
   221 	{
   221         {
   222 	    GLES2_ProgramCacheEntry *entry;
   222             GLES2_ProgramCacheEntry *entry;
   223 	    GLES2_ProgramCacheEntry *next;
   223             GLES2_ProgramCacheEntry *next;
   224             entry = rdata->program_cache.head;
   224             entry = rdata->program_cache.head;
   225             while (entry) {
   225             while (entry) {
   226                 glDeleteProgram(entry->id);
   226                 glDeleteProgram(entry->id);
   227                 next = entry->next;
   227                 next = entry->next;
   228                 SDL_free(entry);
   228                 SDL_free(entry);
   229                 entry = next;
   229                 entry = next;
   230             }
   230             }
   231 	}
   231         }
   232         if (rdata->context) {
   232         if (rdata->context) {
   233             SDL_GL_DeleteContext(rdata->context);
   233             SDL_GL_DeleteContext(rdata->context);
   234         }
   234         }
   235         if (rdata->shader_formats) {
   235         if (rdata->shader_formats) {
   236             SDL_free(rdata->shader_formats);
   236             SDL_free(rdata->shader_formats);