MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / SDL_DestroyTexture

Function SDL_DestroyTexture

lib/sdl2/src/render/SDL_render.c:3160–3201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3158}
3159
3160void
3161SDL_DestroyTexture(SDL_Texture * texture)
3162{
3163 SDL_Renderer *renderer;
3164
3165 CHECK_TEXTURE_MAGIC(texture, );
3166
3167 renderer = texture->renderer;
3168 if (texture == renderer->target) {
3169 SDL_SetRenderTarget(renderer, NULL); /* implies command queue flush */
3170 } else {
3171 FlushRenderCommandsIfTextureNeeded(texture);
3172 }
3173
3174 texture->magic = NULL;
3175
3176 if (texture->next) {
3177 texture->next->prev = texture->prev;
3178 }
3179 if (texture->prev) {
3180 texture->prev->next = texture->next;
3181 } else {
3182 renderer->textures = texture->next;
3183 }
3184
3185 if (texture->native) {
3186 SDL_DestroyTexture(texture->native);
3187 }
3188#if SDL_HAVE_YUV
3189 if (texture->yuv) {
3190 SDL_SW_DestroyYUVTexture(texture->yuv);
3191 }
3192#endif
3193 SDL_free(texture->pixels);
3194
3195 renderer->DestroyTexture(renderer, texture);
3196
3197 SDL_FreeSurface(texture->locked_surface);
3198 texture->locked_surface = NULL;
3199
3200 SDL_free(texture);
3201}
3202
3203void
3204SDL_DestroyRenderer(SDL_Renderer * renderer)

Callers 15

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
DrawFunction · 0.85
LoadSpriteFunction · 0.85
unifont_cleanupFunction · 0.85
_RedrawFunction · 0.85
mainFunction · 0.85
DrawCompositeFunction · 0.85
DrawFunction · 0.85
render_testBlitFunction · 0.85

Calls 5

SDL_SetRenderTargetFunction · 0.85
SDL_SW_DestroyYUVTextureFunction · 0.85
SDL_freeFunction · 0.85
SDL_FreeSurfaceFunction · 0.85

Tested by 15

DrawFunction · 0.68
LoadSpriteFunction · 0.68
unifont_cleanupFunction · 0.68
_RedrawFunction · 0.68
mainFunction · 0.68
DrawCompositeFunction · 0.68
DrawFunction · 0.68
render_testBlitFunction · 0.68
render_testBlitColorFunction · 0.68
render_testBlitAlphaFunction · 0.68
render_testBlitBlendFunction · 0.68
_hasTexColorFunction · 0.68