SDL_Vulkan_CreateSurface(3)
π SDL_Vulkan_CreateSurface(3) π
okay bestie, welcome to the SDL3 FUNCTIONS section of the manual, and today's main character is SDL_Vulkan_CreateSurface β she makes Vulkan rendering surfaces for windows, and she's kind of a big deal π
β¨ NAME β¨
SDL_Vulkan_CreateSurface</p> β create a Vulkan rendering surface for a window. that's it, that's the gig π¦
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_vulkan.h>
bool SDL_Vulkan_CreateSurface(SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR *surface);
look at that signature. gorgeous. no notes π
π DESCRIPTION π
okay so first things first, there are two prerequisites and you literally cannot skip them:
- your
windowhas to have been created with theSDL_WINDOW_VULKANflag, no cap - your
instancehas to have been created with the extensions thatSDL_Vulkan_GetInstanceExtensions()hands back, all enabled and everything
like, do those two things or this whole vibe check fails, fr fr π
and then: if allocator is NULL, Vulkan just uses the system default allocator, easy. that argument gets passed straight through to Vulkan β SDL itself doesn't touch it, doesn't look at it, doesn't have opinions about it. it's giving "middleman who does nothing" π
π«Ά FUNCTION PARAMETERS π«Ά
windowβ the window you're attaching the Vulkan surface to. the chosen one πinstanceβ the Vulkan instance handle. your golden ticket βallocatorβ aVkAllocationCallbacksstruct, which lets the app pick the allocator that creates the surface. it can beNULL. your call bestie β¨surfaceβ a pointer to aVkSurfaceKHRhandle where the newly created surface gets output. she's an out-param, she's doing the work π
π₯ RETURN VALUE π₯
returns true on success or false on failure β and if it's false, go call SDL_GetError() for the tea, she'll tell you what went wrong π
π AVAILABILITY π
this function has been available since SDL 3.2.0 β so if you're on anything older, sorry babe, no surface for you π
π SEE ALSO π
(create her, then eventually clean up after her. balance. π§)
and that's the whole page bestie, mwah π this came to you courtesy of Simple Directmedia Layer, version SDL 3.4.18 β go forth and surface responsibly, ily πβ¨π¦
π¦ 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