Blast-Radius Aware AI Code Review for Business-Critical Systems
LiveReview LiveReview Explore LiveReview

SDL_CreatePalette - Create a palette structure with the specified number of color entries.

Availability

       This function is available since SDL 3.2.0.

Description

       The palette entries are initialized to white.

Function Parameters

ncolors
              represents the number of color entries in the color palette.

Name

       SDL_CreatePalette - Create a palette structure with the specified number of color entries.

Return Value

       Returns  a  new SDL_Palette structure on success or NULL on failure (e.g. if there wasn't enough memory);
       call SDL_GetError() for more information.

See Also

SDL_DestroyPalette(3), SDL_SetPaletteColors(3), SDL_SetSurfacePalette(3)

Simple Directmedia Layer                           SDL 3.2.20                               SDL_CreatePalette(3)

Synopsis

#include<SDL3/SDL_pixels.h>SDL_Palette*SDL_CreatePalette(intncolors);

Thread Safety

       It is safe to call this function from any thread.

See Also