1SDL_SetColorKey(3)             SDL API Reference            SDL_SetColorKey(3)
2
3
4

NAME

6       SDL_SetColorKey - Sets the color key (transparent pixel) in a blittable
7       surface and RLE acceleration.
8

SYNOPSIS

10       #include "SDL.h"
11
12       int SDL_SetColorKey(SDL_Surface *surface, Uint32 flag, Uint32 key);
13

DESCRIPTION

15        Sets the color key (transparent pixel)  in  a  blittable  surface  and
16       enables or disables RLE blit acceleration.
17
18       RLE  acceleration  can  substantially  speed up blitting of images with
19       large horizontal runs of transparent pixels (i.e.,  pixels  that  match
20       the  key  value).  The key must be of the same pixel format as the sur‐
21       face, SDL_MapRGB is often useful for obtaining an acceptable value.
22
23       If flag is SDL_SRCCOLORKEY then key is the transparent pixel  value  in
24       the source image of a blit.
25
26       If  flag  is OR'd with SDL_RLEACCEL then the surface will be draw using
27       RLE acceleration when drawn  with  SDL_BlitSurface.  The  surface  will
28       actually be encoded for RLE acceleration the first time SDL_BlitSurface
29       or SDL_DisplayFormat is called on the surface.
30
31       If flag is 0, this function clears any current color key.
32

RETURN VALUE

34       This function returns 0, or -1 if there was an error.
35

SEE ALSO

37       SDL_BlitSurface, SDL_DisplayFormat, SDL_MapRGB, SDL_SetAlpha
38
39
40
41SDL                         Tue 11 Sep 2001, 23:01          SDL_SetColorKey(3)
Impressum