comparison docs/html/sdlsetalpha.html @ 55:55f1f1b3e27d

Added new docs for SDL 1.2.1
author Sam Lantinga <slouken@lokigames.com>
date Sun, 10 Jun 2001 19:31:57 +0000
parents 74212992fb08
children e5bc29de3f0a
comparison
equal deleted inserted replaced
54:028447a8a758 55:55f1f1b3e27d
2 ><HEAD 2 ><HEAD
3 ><TITLE 3 ><TITLE
4 >SDL_SetAlpha</TITLE 4 >SDL_SetAlpha</TITLE
5 ><META 5 ><META
6 NAME="GENERATOR" 6 NAME="GENERATOR"
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.61 7 CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8 "><LINK 8 "><LINK
9 REL="HOME" 9 REL="HOME"
10 TITLE="SDL Library Documentation" 10 TITLE="SDL Library Documentation"
11 HREF="index.html"><LINK 11 HREF="index.html"><LINK
12 REL="UP" 12 REL="UP"
71 >SDL_SetAlpha</A 71 >SDL_SetAlpha</A
72 ></H1 72 ></H1
73 ><DIV 73 ><DIV
74 CLASS="REFNAMEDIV" 74 CLASS="REFNAMEDIV"
75 ><A 75 ><A
76 NAME="AEN1612" 76 NAME="AEN1681"
77 ></A 77 ></A
78 ><H2 78 ><H2
79 >Name</H2 79 >Name</H2
80 >SDL_SetAlpha&nbsp;--&nbsp;Adjust the alpha properties of a surface</DIV 80 >SDL_SetAlpha&nbsp;--&nbsp;Adjust the alpha properties of a surface</DIV
81 ><DIV 81 ><DIV
82 CLASS="REFSYNOPSISDIV" 82 CLASS="REFSYNOPSISDIV"
83 ><A 83 ><A
84 NAME="AEN1615" 84 NAME="AEN1684"
85 ></A 85 ></A
86 ><H2 86 ><H2
87 >Synopsis</H2 87 >Synopsis</H2
88 ><DIV 88 ><DIV
89 CLASS="FUNCSYNOPSIS" 89 CLASS="FUNCSYNOPSIS"
90 ><A 90 ><A
91 NAME="AEN1616" 91 NAME="AEN1685"
92 ></A 92 ></A
93 ><P 93 ><P
94 ></P 94 ></P
95 ><PRE 95 ><PRE
96 CLASS="FUNCSYNOPSISINFO" 96 CLASS="FUNCSYNOPSISINFO"
110 ></DIV 110 ></DIV
111 ></DIV 111 ></DIV
112 ><DIV 112 ><DIV
113 CLASS="REFSECT1" 113 CLASS="REFSECT1"
114 ><A 114 ><A
115 NAME="AEN1622" 115 NAME="AEN1691"
116 ></A 116 ></A
117 ><H2 117 ><H2
118 >Description</H2 118 >Description</H2
119 ><DIV 119 ><DIV
120 CLASS="NOTE" 120 CLASS="NOTE"
134 ></DIV 134 ></DIV
135 ><P 135 ><P
136 ><TT 136 ><TT
137 CLASS="FUNCTION" 137 CLASS="FUNCTION"
138 >SDL_SetAlpha</TT 138 >SDL_SetAlpha</TT
139 > is used for setting the per-surface alpha and/or enabling and disabling per-pixel alpha blending.</P 139 > is used for setting the per-surface alpha
140 ><P 140 value and/or enabling and disabling alpha blending.</P
141 >The <TT 141 ><P
142 >The<TT
142 CLASS="PARAMETER" 143 CLASS="PARAMETER"
143 ><I 144 ><I
144 >surface</I 145 >surface</I
145 ></TT 146 ></TT
146 > parameter specifies which surface whose alpha attributes you wish to adjust. <TT 147 > parameter specifies which surface whose alpha
148 attributes you wish to adjust. <TT
147 CLASS="PARAMETER" 149 CLASS="PARAMETER"
148 ><I 150 ><I
149 >flags</I 151 >flags</I
150 ></TT 152 ></TT
151 > is used to specify whether alpha blending should be used (<TT 153 > is used to specify
152 CLASS="LITERAL" 154 whether alpha blending should be used (<TT
153 >SDL_SRCALPHA</TT 155 CLASS="LITERAL"
154 >) and whether the surface should use RLE acceleration for blitting (<TT 156 >SDL_SRCALPHA</TT
157 >) and
158 whether the surface should use RLE acceleration for blitting
159 (<TT
155 CLASS="LITERAL" 160 CLASS="LITERAL"
156 >SDL_RLEACCEL</TT 161 >SDL_RLEACCEL</TT
157 >). <TT 162 >). <TT
158 CLASS="PARAMETER" 163 CLASS="PARAMETER"
159 ><I 164 ><I
160 >flags</I 165 >flags</I
161 ></TT 166 ></TT
162 > can be an OR'd combination of these two options, one of these options or 0. If <TT 167 > can be an OR'd
163 CLASS="LITERAL" 168 combination of these two options, one of these options or 0. If
164 >SDL_SRCALPHA</TT 169 <TT
165 > is not passed as a flag then all alpha information is ignored when blitting the surface. The <TT 170 CLASS="LITERAL"
171 >SDL_SRCALPHA</TT
172 > is not passed as a flag then all alpha
173 information is ignored when blitting the surface. The
174 <TT
166 CLASS="PARAMETER" 175 CLASS="PARAMETER"
167 ><I 176 ><I
168 >alpha</I 177 >alpha</I
169 ></TT 178 ></TT
170 > parameter is the per-surface alpha value, a surface need not have an alpha channel to use per-surface alpha and blitting can still be accelerated with <TT 179 > parameter is the per-surface alpha value; a
180 surface need not have an alpha channel to use per-surface alpha and blitting
181 can still be accelerated with <TT
171 CLASS="LITERAL" 182 CLASS="LITERAL"
172 >SDL_RLEACCEL</TT 183 >SDL_RLEACCEL</TT
173 >. Setting the per-surface alpha value to 0 disables per-surface alpha blending.</P 184 >.</P
174 ><DIV 185 ><DIV
175 CLASS="NOTE" 186 CLASS="NOTE"
176 ><BLOCKQUOTE 187 ><BLOCKQUOTE
177 CLASS="NOTE" 188 CLASS="NOTE"
178 ><P 189 ><P
179 ><B 190 ><B
180 >Note: </B 191 >Note: </B
181 >The per-surface alpha value of 128 is considered a special case and is optimised, so it's much faster than other per-surface values.</P 192 >The per-surface alpha value of 128 is considered a special case and
193 is optimised, so it's much faster than other per-surface values.</P
182 ></BLOCKQUOTE 194 ></BLOCKQUOTE
183 ></DIV 195 ></DIV
184 ><P 196 ><P
185 >Alpha effects surface blitting in the following ways:</P 197 >Alpha effects surface blitting in the following ways:</P
186 ><DIV 198 ><DIV
187 CLASS="INFORMALTABLE" 199 CLASS="INFORMALTABLE"
188 ><A 200 ><A
189 NAME="AEN1642" 201 NAME="AEN1711"
190 ></A 202 ></A
191 ><P 203 ><P
192 ></P 204 ></P
193 ><TABLE 205 ><TABLE
194 BORDER="0" 206 BORDER="0"
237 ></TD 249 ></TD
238 ><TD 250 ><TD
239 ALIGN="LEFT" 251 ALIGN="LEFT"
240 VALIGN="TOP" 252 VALIGN="TOP"
241 ><P 253 ><P
242 >The source is alpha-blended with the destination using the per-surface alpha value. If <TT 254 >The source is alpha-blended with the destination using the per-surface alpha
243 CLASS="LITERAL" 255 value. If <TT
244 >SDL_SRCCOLORKEY</TT 256 CLASS="LITERAL"
245 >literal&#62; is set, only the pixels not matching the colorkey value are copied.</P 257 >SDL_SRCCOLORKEY</TT
258 > is set, only the pixels not
259 matching the colorkey value are copied. The alpha channel of the copied pixels
260 is set to opaque.</P
246 ></TD 261 ></TD
247 ></TR 262 ></TR
248 ><TR 263 ><TR
249 ><TD 264 ><TD
250 ALIGN="LEFT" 265 ALIGN="LEFT"
255 ></TD 270 ></TD
256 ><TD 271 ><TD
257 ALIGN="LEFT" 272 ALIGN="LEFT"
258 VALIGN="TOP" 273 VALIGN="TOP"
259 ><P 274 ><P
260 >The RGB data is copied from the source and the destination alpha is zero to opaque. If <TT 275 >The RGB data is copied from the source and the alpha value of the copied pixels
261 CLASS="LITERAL" 276 is set to opaque. If <TT
262 >SDL_SRCCOLORKEY</TT 277 CLASS="LITERAL"
263 > is set, only the pixels not matching the colorkey value are copied.</P 278 >SDL_SRCCOLORKEY</TT
279 > is set, only the pixels
280 not matching the colorkey value are copied. </P
264 ></TD 281 ></TD
265 ></TR 282 ></TR
266 ><TR 283 ><TR
267 ><TD 284 ><TD
268 ALIGN="LEFT" 285 ALIGN="LEFT"
273 ></TD 290 ></TD
274 ><TD 291 ><TD
275 ALIGN="LEFT" 292 ALIGN="LEFT"
276 VALIGN="TOP" 293 VALIGN="TOP"
277 ><P 294 ><P
278 >The source is alpha-blended with the destination using the source alpha channel. The alpha channel in the destination surface is left untouched. <TT 295 >The source is alpha-blended with the destination using the source alpha
296 channel. The alpha channel in the destination surface is left untouched.
297 <TT
279 CLASS="LITERAL" 298 CLASS="LITERAL"
280 >SDL_SRCCOLORKEY</TT 299 >SDL_SRCCOLORKEY</TT
281 > is ignored.</P 300 > is ignored.</P
282 ></TD 301 ></TD
283 ></TR 302 ></TR
338 ></TBODY 357 ></TBODY
339 ></TABLE 358 ></TABLE
340 ><P 359 ><P
341 ></P 360 ></P
342 ></DIV 361 ></DIV
362 ><DIV
363 CLASS="NOTE"
364 ><BLOCKQUOTE
365 CLASS="NOTE"
366 ><P
367 ><B
368 >Note: </B
369 > Note that RGBA-&#62;RGBA blits (with SDL_SRCALPHA set) keep the alpha
370 of the destination surface. This means that you cannot compose two arbitrary
371 RGBA surfaces this way and get the result you would expect from "overlaying"
372 them; the destination alpha will work as a mask.</P
373 ><P
374 >Also note that per-pixel and per-surface alpha cannot be combined;
375 the per-pixel alpha is always used if available</P
376 ></BLOCKQUOTE
377 ></DIV
343 ></DIV 378 ></DIV
344 ><DIV 379 ><DIV
345 CLASS="REFSECT1" 380 CLASS="REFSECT1"
346 ><A 381 ><A
347 NAME="AEN1692" 382 NAME="AEN1764"
383 ></A
384 ><H2
385 >Return Value</H2
386 ><P
387 >This function returns <SPAN
388 CLASS="RETURNVALUE"
389 >0</SPAN
390 >, or
391 <SPAN
392 CLASS="RETURNVALUE"
393 >-1</SPAN
394 > if there was an error.</P
395 ></DIV
396 ><DIV
397 CLASS="REFSECT1"
398 ><A
399 NAME="AEN1769"
348 ></A 400 ></A
349 ><H2 401 ><H2
350 >See Also</H2 402 >See Also</H2
351 ><P 403 ><P
352 ><A 404 ><A