Scroll to navigation

SDL_CreatePixelFormat(3) SDL3 FUNCTIONS SDL_CreatePixelFormat(3)

NAME

SDL_CreatePixelFormat - Create an SDL_PixelFormat
structure corresponding to a pixel format.

SYNOPSIS

#include "SDL3/SDL.h"
SDL_PixelFormat * SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format);

DESCRIPTION

Returned structure may come from a shared global cache (i.e. not newly allocated), and hence should not be modified, especially the palette. Weird errors such as Blitcombinationnotsupported may occur.

FUNCTION PARAMETERS

one of the SDL_PixelFormatEnum
values

RETURN VALUE

Returns the new SDL_PixelFormat
structure or NULL on failure; call SDL_GetError () for more information.

AVAILABILITY

This function is available since SDL 3.0.0.

SEE ALSO

SDL_DestroyPixelFormat(3), SDL_SetPixelFormatPalette(3)

SDL 3.1.0 SDL