|
Size: 976
Comment: create page, add content (Rev 5540)
|
Size: 1212
Comment: update content - w/ Sam; remove draft
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| ||<tablewidth="100%" style="color: #FF0000;" :> DRAFT|| | |
| Line 6: | Line 5: |
| Use this function to set the color key (transparent pixel) in a blittable surface. | Use this function to set the color key (transparent pixel) in a surface. |
| Line 18: | Line 17: |
| ||'''surface'''||the surface to update|| ||'''flag'''||non-zero to enable colorkey, 0 to disable colorkey|| ||'''key'''||the transparent pixel in the native surface format || |
||'''surface'''||the [[SDL_Surface]] structure to update|| ||'''flag'''||1 to enable color key, 0 to disable color key; see [[#Remarks|Remarks]] for details|| ||'''key'''||the transparent pixel|| |
| Line 23: | Line 22: |
| Returns 0 on success, or -1 if the surface is not valid; call [[SDL_GetError]]() for more information. | Returns 0 on success or a negative error code on failure; call [[SDL_GetError]]() for more information. |
| Line 31: | Line 30: |
| ''You can add useful comments here'' | The color key is a pixel of the format used by the surface, as generated by [[SDL_MapRGB]](). RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key value). See [[SDL_SetSurfaceRLE]]() for details. |
| Line 34: | Line 36: |
| .[[SDL_BlitSurface]] |
SDL_SetColorKey
Use this function to set the color key (transparent pixel) in a surface.
Contents
Syntax
int SDL_SetColorKey(SDL_Surface* surface,
int flag,
Uint32 key)
Function Parameters
surface |
the SDL_Surface structure to update |
flag |
1 to enable color key, 0 to disable color key; see Remarks for details |
key |
the transparent pixel |
Return Value
Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.
Code Examples
You can add your code example here
Remarks
The color key is a pixel of the format used by the surface, as generated by SDL_MapRGB().
RLE acceleration can substantially speed up blitting of images with large horizontal runs of transparent pixels (i.e., pixels that match the key value). See SDL_SetSurfaceRLE() for details.
