Function SDL_CreateTexture

pub unsafe extern "C" fn SDL_CreateTexture(
    renderer: *mut SDL_Renderer,
    format: SDL_PixelFormat,
    access: SDL_TextureAccess,
    w: i32,
    h: i32,
) -> *mut SDL_Texture
Available on crate feature dep_sdl3 only.
Expand description

Create a texture for a rendering context.

The contents of a texture when first created are not defined.

§Parameters

  • renderer: the rendering context.
  • format: one of the enumerated values in SDL_PixelFormat.
  • access: one of the enumerated values in SDL_TextureAccess.
  • w: the width of the texture in pixels.
  • h: the height of the texture in pixels.

§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