Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2010-12-22 00:38:26
Size: 1131
Editor: SheenaSmith
Comment: update formatting - enums, structs, the/an
Revision 6 as of 2011-01-07 18:07:09
Size: 973
Editor: SheenaSmith
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 get the color key (transparent pixel) in a blittable surface. Use this function to get the color key (transparent pixel) for a surface.
Line 17: Line 16:
||'''surface'''||the [[SDL_Surface]] structure to ,,update,, ^query^||
||'''key'''||a pointer filled in with the transparent pixel in the native surface format||
||'''surface'''||the [[SDL_Surface]] structure to query||
||'''key'''||a pointer filled in with the transparent pixel||
Line 23: Line 22:
If the surface is not valid or colorkey is not enabled it returns -1. <<Color2(green,Where is "colorkey" from? Is that in a struct or is it related to the '''key''' param? Should it be in monospace?)>> If the surface doesn't have color key enabled this function returns -1.
Line 31: Line 31:
''You can add useful comments here'' The color key is a pixel of the format used by the surface as generated by [[SDL_MapRGB]]().
Line 34: Line 34:
 .[[SDL_BlitSurface]]

SDL_GetColorKey

Use this function to get the color key (transparent pixel) for a surface.

Syntax

int SDL_GetColorKey(SDL_Surface* surface,
                    Uint32*      key)

Function Parameters

surface

the SDL_Surface structure to query

key

a pointer filled in with the transparent pixel

Return Value

Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

If the surface doesn't have color key enabled this function returns -1.

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().


CategoryAPI, CategorySurface

None: SDL_GetColorKey (last edited 2011-01-07 18:07:52 by SheenaSmith)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit