SDL_CreateGPUDevice

Function SDL_CreateGPUDevice 

Source
pub unsafe extern "C" fn SDL_CreateGPUDevice(
    format_flags: SDL_GPUShaderFormat,
    debug_mode: bool,
    name: *const c_char,
) -> *mut SDL_GPUDevice
Expand description

Creates a GPU context.

The GPU driver name can be one of the following:

  • “vulkan”: Vulkan
  • “direct3d12”: D3D12
  • “metal”: Metal
  • NULL: let SDL pick the optimal driver

§Parameters

  • format_flags: a bitflag indicating which shader formats the app is able to provide.
  • debug_mode: enable debug mode properties and validations.
  • name: the preferred GPU driver, or NULL to let SDL pick the optimal driver.

§Return value

Returns a GPU context on success or NULL on failure; call SDL_GetError() for more information.

§Availability

This function is available since SDL 3.2.0.

§See also