Function fermium::vulkan::SDL_Vulkan_CreateSurface[][src]

pub unsafe extern "C" fn SDL_Vulkan_CreateSurface(
    window: *mut SDL_Window,
    instance: VkInstance,
    surface: *mut VkSurfaceKHR
) -> SDL_bool

Create a Vulkan rendering surface for a window.

  • [in] window SDL_Window to which to attach the rendering surface.
  • [in] instance handle to the Vulkan instance to use.
  • [out] surface pointer to a VkSurfaceKHR handle to receive the handle of the newly created surface.

Returns: SDL_TRUE on success, SDL_FALSE on error.

VkInstance instance;
SDL_Window *window;

// create instance and window

// create the Vulkan surface
VkSurfaceKHR surface;
if(!SDL_Vulkan_CreateSurface(window, instance, &surface))
    handle_error();

window should have been created with the SDL_WINDOW_VULKAN flag.

instance should have been created with the extensions returned by SDL_Vulkan_CreateSurface enabled.

See Also: SDL_Vulkan_GetInstanceExtensions