SDL_Vulkan_UnloadLibrary(3)

πŸ’… SDL_Vulkan_UnloadLibrary πŸ’…

okay bestie, welcome to the SDL3 functions corner of the manual, and today's main character is SDL_Vulkan_UnloadLibrary(3) β€” the girl whose whole job is saying bye to the Vulkan library you loaded earlier. 🫢


✨ NAME ✨

SDL_Vulkan_UnloadLibrary β€” unload the Vulkan library that was previously loaded by SDL_Vulkan_LoadLibrary().


✨ SYNOPSIS ✨

#include <SDL3/SDL_vulkan.h>

void SDL_Vulkan_UnloadLibrary(void);

✨ DESCRIPTION ✨

so here's the tea, and it's actually kinda important: SDL keeps a counter of how many times you've called this function. that means it's safe to call it multiple times, as long as it's paired with an equivalent number of calls to SDL_Vulkan_LoadLibrary. πŸ’–

and no, the library does not actually get unloaded the second you call this. it just chills there until there have been an equivalent number of calls to SDL_Vulkan_UnloadLibrary. counter girlies, we love them. πŸŽ€

⚠️ okay so THIS part is the serious one, no cap. once the library has actually been unloaded, if any Vulkan instances are still hanging around, they will likely crash the program. like, πŸ’€ levels of crash.

so before you call this function, do the cleanup era first: clean up any existing Vulkan resources, and destroy appropriate windows, renderers and GPU devices. ✨ order matters, bestie. tidy up, then say bye. 🧚


✨ THREAD SAFETY ✨

this function is not thread safe. πŸ™ˆ keep it on one thread, mwah.


✨ AVAILABILITY ✨

this function has been available since SDL 3.2.0. it's giving established. πŸ‘‘


✨ SEE ALSO ✨


and that's the whole page, periodt. brought to you by Simple Directmedia Layer, SDL 3.4.18, and this exact SDL_Vulkan_UnloadLibrary(3) moment in time. go forth, unload responsibly, and don't leave any Vulkan instances behind or they WILL ruin the vibe check. πŸŒΈπŸ’…πŸ¦‹

πŸ“¦ where this page comes from