SDL_Vulkan_DestroySurface(3)
π SDL_Vulkan_DestroySurface π
okay bestie, this one lives in the SDL3 FUNCTIONS section of the manual, and it's about one very specific little chore: destroying the Vulkan rendering surface of a window. yes that's the whole vibe. let's get into it π¦
β¨ NAME β¨
SDL_Vulkan_DestroySurface β Destroy the Vulkan rendering surface of a window.
like. it destroys it. it's in the name. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_vulkan.h>
void SDL_Vulkan_DestroySurface(VkInstance instance,
VkSurfaceKHR surface,
const struct VkAllocationCallbacks *allocator);
look at her. three lil arguments. so tidy. so iconic. π
π DESCRIPTION π
okay so here's the tea, and this part actually matters, don't skip it:
This should be called before SDL_DestroyWindow, if SDL_Vulkan_CreateSurface was called after SDL_CreateWindow. order is literally everything here, bestie, don't do it backwards π
Also β and this is a requirement, not a suggestion β the instance must have been created with extensions returned by SDL_Vulkan_GetInstanceExtensions() enabled, and surface must have been created successfully by an SDL_Vulkan_CreateSurface() call. no shortcuts, no improvised instances, that's the rule fr fr π«Ά
and about allocator: if it's NULL, Vulkan will use the system default allocator. this argument gets passed directly to Vulkan and isn't used by SDL itself at all β SDL is just the messenger, handing it over. π
π FUNCTION PARAMETERS π
instanceβ the Vulkan instance handle. the main character of this parameter list, honestly. β¨surfaceβ thevkSurfaceKHRhandle to destroy. this is the thing getting yeeted. πallocatorβ aVkAllocationCallbacksstruct, which lets the app set the allocator that destroys the surface. Can beNULL. so like, optional bestie, no pressure. π
β AVAILABILITY β
This function is available since SDL 3.2.0. so if you're on something older, no surface-destroying for you, sorry babe π
π SEE ALSO π
iykyk β the create side and the extensions side. this destroy function is the third member of that little trio. πΈ
lowkey reminder: clean up your surfaces before you destroy the window, or the order police will come for you. no cap. π¨
kisses, this page came to you from the Simple Directmedia Layer girlies, running SDL 3.4.18, and filed under SDL_Vulkan_DestroySurface(3) β mwah, go free your surfaces bestie πβ¨
π¦ 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