MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / SDL_DestroyRenderer

Function SDL_DestroyRenderer

deps/SDL2/src/render/SDL_render.c:3203–3251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3201}
3202
3203void
3204SDL_DestroyRenderer(SDL_Renderer * renderer)
3205{
3206 SDL_RenderCommand *cmd;
3207
3208 CHECK_RENDERER_MAGIC(renderer, );
3209
3210 SDL_DelEventWatch(SDL_RendererEventWatch, renderer);
3211
3212 if (renderer->render_commands_tail != NULL) {
3213 renderer->render_commands_tail->next = renderer->render_commands_pool;
3214 cmd = renderer->render_commands;
3215 } else {
3216 cmd = renderer->render_commands_pool;
3217 }
3218
3219 renderer->render_commands_pool = NULL;
3220 renderer->render_commands_tail = NULL;
3221 renderer->render_commands = NULL;
3222
3223 while (cmd != NULL) {
3224 SDL_RenderCommand *next = cmd->next;
3225 SDL_free(cmd);
3226 cmd = next;
3227 }
3228
3229 SDL_free(renderer->vertex_data);
3230
3231 /* Free existing textures for this renderer */
3232 while (renderer->textures) {
3233 SDL_Texture *tex = renderer->textures; (void) tex;
3234 SDL_DestroyTexture(renderer->textures);
3235 SDL_assert(tex != renderer->textures); /* satisfy static analysis. */
3236 }
3237
3238 if (renderer->window) {
3239 SDL_SetWindowData(renderer->window, SDL_WINDOWRENDERDATA, NULL);
3240 }
3241
3242 /* It's no longer magical... */
3243 renderer->magic = NULL;
3244
3245 /* Free the target mutex */
3246 SDL_DestroyMutex(renderer->target_mutex);
3247 renderer->target_mutex = NULL;
3248
3249 /* Free the renderer instance */
3250 renderer->DestroyRenderer(renderer);
3251}
3252
3253int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
3254{

Callers 15

mainFunction · 0.85
loopFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
WatchGameControllerFunction · 0.85
WatchJoystickFunction · 0.85
WatchJoystickFunction · 0.85
loopFunction · 0.85
CleanupDestroyRendererFunction · 0.85
mainFunction · 0.85
SDLTest_CommonEventFunction · 0.85

Calls 5

SDL_DelEventWatchFunction · 0.85
SDL_freeFunction · 0.85
SDL_DestroyTextureFunction · 0.85
SDL_SetWindowDataFunction · 0.85
SDL_DestroyMutexFunction · 0.50

Tested by 12

loopFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
WatchGameControllerFunction · 0.68
WatchJoystickFunction · 0.68
WatchJoystickFunction · 0.68
loopFunction · 0.68
CleanupDestroyRendererFunction · 0.68
mainFunction · 0.68
SDLTest_CommonEventFunction · 0.68
SDLTest_CommonQuitFunction · 0.68