SDL_CreateTextureWithProperties

Function SDL_CreateTextureWithProperties 

Source
pub unsafe extern "C" fn SDL_CreateTextureWithProperties(
    renderer: *mut SDL_Renderer,
    props: SDL_PropertiesID,
) -> *mut SDL_Texture
Expand description

Create a texture for a rendering context with the specified properties.

These are the supported properties:

With the direct3d11 renderer:

With the direct3d12 renderer:

With the metal renderer:

With the opengl renderer:

With the opengles2 renderer:

With the vulkan renderer:

With the GPU renderer:

  • SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_POINTER: the SDL_GPUTexture associated with the texture, if you want to wrap an existing texture.
  • [SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_UV_NUMBER]: the SDL_GPUTexture associated with the UV plane of an NV12 texture, if you want to wrap an existing texture.
  • [SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_U_NUMBER]: the SDL_GPUTexture associated with the U plane of a YUV texture, if you want to wrap an existing texture.
  • [SDL_PROP_TEXTURE_CREATE_GPU_TEXTURE_V_NUMBER]: the SDL_GPUTexture associated with the V plane of a YUV texture, if you want to wrap an existing texture.

§Parameters

  • renderer: the rendering context.
  • props: the properties to use.

§Return value

Returns the created texture or NULL on failure; call SDL_GetError() for more information.

§Thread safety

This function should only be called on the main thread.

§Availability

This function is available since SDL 3.2.0.

§See also