SDL_CreateTexture - Man Page

Create a texture for a rendering context.

Synopsis

#include <SDL3/SDL_render.h>

SDL_Texture * SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, SDL_TextureAccess access, int w, int h);

Description

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

Function 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

SDL_CreateTextureFromSurface(3), SDL_CreateTextureWithProperties(3), SDL_DestroyTexture(3), SDL_GetTextureSize(3), SDL_UpdateTexture(3)

Referenced By

SDL_CreateTextureFromSurface(3), SDL_CreateTextureWithProperties(3), SDL_DestroyTexture(3), SDL_Texture.3type(3).

SDL 3.2.16 Simple Directmedia Layer SDL3 FUNCTIONS