setPalette method

bool setPalette(
  1. Pointer<SdlPalette> palette
)

Set the palette used by a surface.

A single palette can be shared with many surfaces.

\param surface the SDL_Surface structure to update. \param palette the SDL_Palette structure to use. \returns true on success or false on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

\sa SDL_CreatePalette \sa SDL_GetSurfacePalette

extern SDL_DECLSPEC bool SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)

Implementation

bool setPalette(Pointer<SdlPalette> palette) {
  return sdlSetSurfacePalette(this, palette);
}