SDL_DestroySurface(3)
π SDL_DestroySurface β the manual page, bestie edition π
okay so this is a page from the SDL3 FUNCTIONS manual, and today's main character is SDL_DestroySurface. she's the cleanup crew. the girl who takes out the trash after the party. and honestly? we're obsessed. π
β¨ NAME β¨
SDL_DestroySurface β free a surface. that's it, that's the whole job. girlboss behaviour. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_surface.h>
void SDL_DestroySurface(SDL_Surface *surface);
look at her. no return value, no drama, no notes. she just does it. π
π¦ DESCRIPTION π¦
so you've got a surface, you're done with it, and now you need to let it go. this is the function that does that. closure, literally. π
and here's the part that lowkey slays: it is safe to pass NULL to this function. no crash, no panic, no "bestie why would you do that". she just handles it. so chill. so unbothered. β¨
π FUNCTION PARAMETERS π
surfaceβ theSDL_Surfaceto free. hand her the surface, she handles the rest. π«Ά
π₯ THREAD SAFETY π₯
No other thread should be using the surface when it is freed.
fr fr, this one matters. if some other thread is still touching that surface while you're freeing it, that's a vibe check you will NOT pass. make sure everybody's done with it first, then let it go. ππ«
π AVAILABILITY π
this function has been available since SDL 3.2.0. so if you're on 3.2.0 or later, she's there for you. iconic since day one. β
π SEE ALSO π
SDL_CreateSurface(3)β where the surface came from, the origin story π§SDL_CreateSurfaceFrom(3)β the other way to make one π
and that's the whole page, no cap. go forth and free your surfaces responsibly. πΈ
Simple Directmedia Layer β SDL 3.4.18 β mwah, love you, bye bestie ππ SDL_DestroySurface(3)
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms