sdlSurfaceHasColorKey function

bool sdlSurfaceHasColorKey(
  1. Pointer<SdlSurface> surface
)

Returns whether the surface has a color key.

It is safe to pass a NULL surface here; it will return false.

\param surface the SDL_Surface structure to query. \returns true if the surface has a color key, false otherwise.

\since This function is available since SDL 3.1.3.

\sa SDL_SetSurfaceColorKey \sa SDL_GetSurfaceColorKey

extern SDL_DECLSPEC bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface)

Implementation

bool sdlSurfaceHasColorKey(Pointer<SdlSurface> surface) {
  final sdlSurfaceHasColorKeyLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlSurface> surface),
      int Function(Pointer<SdlSurface> surface)>('SDL_SurfaceHasColorKey');
  return sdlSurfaceHasColorKeyLookupFunction(surface) == 1;
}