7 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK
14 HREF="video.html"><LINK
16 TITLE="SDL_SetColorKey"
17 HREF="sdlsetcolorkey.html"><LINK
19 TITLE="SDL_SetClipRect"
20 HREF="sdlsetcliprect.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SDL Library Documentation</TH
48 HREF="sdlsetcolorkey.html"
62 HREF="sdlsetcliprect.html"
83 >SDL_SetAlpha -- Adjust the alpha properties of a surface</DIV
85 CLASS="REFSYNOPSISDIV"
99 CLASS="FUNCSYNOPSISINFO"
100 >#include "SDL.h"</PRE
109 >(SDL_Surface *surface, Uint32 flag, Uint8 alpha);</CODE
129 >This function and the semantics of SDL alpha blending have changed since version 1.1.4. Up until version 1.1.5, an alpha value of 0 was considered opaque and a value of 255 was considered transparent. This has now been inverted: 0 (<TT
131 >SDL_ALPHA_TRANSPARENT</TT
132 >) is now considered transparent and 255 (<TT
134 >SDL_ALPHA_OPAQUE</TT
135 >) is now considered opaque.</P
142 > is used for setting the per-surface alpha
143 value and/or enabling and disabling alpha blending.</P
150 > parameter specifies which surface whose alpha
151 attributes you wish to adjust. <TT
157 whether alpha blending should be used (<TT
161 whether the surface should use RLE acceleration for blitting
171 combination of these two options, one of these options or 0. If
175 > is not passed as a flag then all alpha
176 information is ignored when blitting the surface. The
182 > parameter is the per-surface alpha value; a
183 surface need not have an alpha channel to use per-surface alpha and blitting
184 can still be accelerated with <TT
195 >The per-surface alpha value of 128 is considered a special case and
196 is optimised, so it's much faster than other per-surface values.</P
200 >Alpha effects surface blitting in the following ways:</P
202 CLASS="INFORMALTABLE"
216 >RGBA->RGB with <TT
224 >The source is alpha-blended with the destination, using the alpha channel. <TT
227 > and the per-surface alpha are ignored.</P
234 >RGBA->RGB without <TT
242 >The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.</P
249 >RGB->RGBA with <TT
257 >The source is alpha-blended with the destination using the per-surface alpha
261 > is set, only the pixels not
262 matching the colorkey value are copied. The alpha channel of the copied pixels
270 >RGB->RGBA without <TT
278 >The RGB data is copied from the source and the alpha value of the copied pixels
279 is set to opaque. If <TT
282 > is set, only the pixels
283 not matching the colorkey value are copied. </P
290 >RGBA->RGBA with <TT
298 >The source is alpha-blended with the destination using the source alpha
299 channel. The alpha channel in the destination surface is left untouched.
310 >RGBA->RGBA without <TT
318 >The RGBA data is copied to the destination surface. If <TT
321 > is set, only the pixels not matching the colorkey value are copied.</P
328 >RGB->RGB with <TT
336 >The source is alpha-blended with the destination using the per-surface alpha value. If <TT
339 > is set, only the pixels not matching the colorkey value are copied.</P
346 >RGB->RGB without <TT
354 >The RGB data is copied from the source. If <TT
357 > is set, only the pixels not matching the colorkey value are copied.</P
372 > Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha
373 of the destination surface. This means that you cannot compose two arbitrary
374 RGBA surfaces this way and get the result you would expect from "overlaying"
375 them; the destination alpha will work as a mask.</P
377 >Also note that per-pixel and per-surface alpha cannot be combined;
378 the per-pixel alpha is always used if available</P
390 >This function returns <SPAN
397 > if there was an error.</P
408 HREF="sdlmaprgba.html"
415 HREF="sdlgetrgba.html"
422 HREF="sdldisplayformatalpha.html"
425 >SDL_DisplayFormatAlpha</TT
429 HREF="sdlblitsurface.html"
441 SUMMARY="Footer navigation table"
452 HREF="sdlsetcolorkey.html"
470 HREF="sdlsetcliprect.html"