sdlSetSurfacePalette function

int sdlSetSurfacePalette(
  1. Pointer<SdlSurface> surface,
  2. 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 0 on success or a negative error code on failure; call SDL_GetError() for more information.

\since This function is available since SDL 2.0.0.

extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette)

Implementation

int sdlSetSurfacePalette(
    Pointer<SdlSurface> surface, Pointer<SdlPalette> palette) {
  final sdlSetSurfacePaletteLookupFunction = libSdl2.lookupFunction<
      Int32 Function(Pointer<SdlSurface> surface, Pointer<SdlPalette> palette),
      int Function(Pointer<SdlSurface> surface,
          Pointer<SdlPalette> palette)>('SDL_SetSurfacePalette');
  return sdlSetSurfacePaletteLookupFunction(surface, palette);
}