SDL_SetSurfaceColorKey

Set the color key (transparent pixel) in a surface.

The color key defines a pixel value that will be treated as transparent in a blit. For example, one can use this to specify that cyan pixels should be considered transparent, and therefore not rendered.

It is a pixel of the format used by the surface, as generated by SDL_MapRGB().

extern (C) nothrow @nogc extern
bool
SDL_SetSurfaceColorKey

Parameters

surface SDL_Surface*

the SDL_Surface structure to update.

enabled bool

true to enable color key, false to disable color key.

key Uint32

the transparent pixel.

Return Value

Type: bool

true on success or false on failure; call SDL_GetError() for more information.

See Also

Meta