SDL_Vulkan_G...tanceProcAddr(3)

πŸ’… SDL_Vulkan_GetVkGetInstanceProcAddr πŸ’…

okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_Vulkan_GetVkGetInstanceProcAddr. yes the name is long. no we are not shortening it. she earned every character. πŸŽ€


✨ NAME ✨

SDL_Vulkan_GetVkGetInstanceProcAddr β€” get the address of the vkGetInstanceProcAddr function. that's it, that's the whole job. fetch the pointer. slay. πŸ¦‹


✨ SYNOPSIS ✨

#include <SDL3/SDL_vulkan.h>

SDL_FunctionPointer SDL_Vulkan_GetVkGetInstanceProcAddr(void);

look at her. no arguments. takes absolutely nothing from you, gives you a function pointer back. queen behavior. πŸ‘‘


✨ DESCRIPTION ✨

so here's the tea: you gotta call this after you've either called SDL_Vulkan_LoadLibrary() or created an SDL_Window with the SDL_WINDOW_VULKAN flag. do it before that and, like, no. πŸ™ˆ

the actual type of the returned function pointer is PFN_vkGetInstanceProcAddr, but β€” and this is the part that trips people up β€” that type isn't available here, because the Vulkan headers are not included in this header. so you have to cast the return value yourself. for example:

vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr();

cast it. don't forget to cast it. i'm literally begging you to cast it. πŸ’…


✨ RETURN VALUE ✨

returns the function pointer for vkGetInstanceProcAddr, or NULL on failure. if you get NULL, call SDL_GetError() for more info β€” she will tell you what went wrong, no cap. 😭


✨ AVAILABILITY ✨

this function has been available since SDL 3.2.0. so if you're on anything older, bestie, that's a vibe check fail. πŸ’€


and that's the whole page!! stay hydrated, cast your pointers, and go build something iconic πŸŒˆπŸ’œ

β€” with love from the Simple Directmedia Layer girlies, SDL 3.4.18 edition πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from