SDL_VULKAN_GETINSTANCEEXTENSIONS(3)

πŸ’– SDL_Vulkan_GetInstanceExtensions πŸ’–

okay bestie, welcome to the SDL3 functions corner of the manual, this one's a total baddie. ✨


🌸 NAME 🌸

SDL_Vulkan_GetInstanceExtensions β€” grab the Vulkan instance extensions you need for vkCreateInstance.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_vulkan.h>

char const * const * SDL_Vulkan_GetInstanceExtensions(Uint32 *count);

✨ DESCRIPTION ✨

so like, timing matters here, okay? 🫢 You call this after either calling SDL_Vulkan_LoadLibrary() or creating an SDL_Window with the SDL_WINDOW_VULKAN flag. Do it in that order or it's giving chaos. πŸ’…

On return, the variable that count points to gets filled in with the number of elements returned β€” and that number is exactly what you want for VkInstanceCreateInfo::enabledExtensionCount. Meanwhile the returned array itself is the vibe for VkInstanceCreateInfo::ppEnabledExtensionNames, so you can go call Vulkan's vkCreateInstance API. iconic, honestly. πŸ”₯

⚠️ and this is the important part: do NOT free the returned array. It is owned by SDL, it is not yours, hands off, we do not touch. 😭

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • count β€” a pointer that gets filled in with the number of extensions returned. yes queen, that many. πŸ’–

πŸ’… RETURN VALUE πŸ’…

Returns an array of extension name strings on success 🌈, and NULL on failure πŸ’€ β€” if that happens, call SDL_GetError() for more info, she'll tell you everything.


⭐ AVAILABILITY ⭐

This function has been available since SDL 3.2.0. no cap.


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! this lil' manual page is brought to you by Simple Directmedia Layer πŸ’œ shipping with SDL 3.4.18 🌸 go forth and create your instance, mwah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from