Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5131 clevermous 1
2
>
3
>
4
>SDL_SetAlpha
5
>
6
NAME="GENERATOR"
7
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
8
">
9
REL="HOME"
10
TITLE="SDL Library Documentation"
11
HREF="index.html">
12
REL="UP"
13
TITLE="Video"
14
HREF="video.html">
15
REL="PREVIOUS"
16
TITLE="SDL_SetColorKey"
17
HREF="sdlsetcolorkey.html">
18
REL="NEXT"
19
TITLE="SDL_SetClipRect"
20
HREF="sdlsetcliprect.html">
21
>
22
CLASS="REFENTRY"
23
BGCOLOR="#FFF8DC"
24
TEXT="#000000"
25
LINK="#0000ee"
26
VLINK="#551a8b"
27
ALINK="#ff0000"
28
>
29
CLASS="NAVHEADER"
30
>
31
WIDTH="100%"
32
BORDER="0"
33
CELLPADDING="0"
34
CELLSPACING="0"
35
>
36
>
37
COLSPAN="3"
38
ALIGN="center"
39
>SDL Library Documentation
40
>
41
>
42
>
43
WIDTH="10%"
44
ALIGN="left"
45
VALIGN="bottom"
46
>
47
HREF="sdlsetcolorkey.html"
48
>Prev
49
>
50
>
51
WIDTH="80%"
52
ALIGN="center"
53
VALIGN="bottom"
54
>
55
>
56
WIDTH="10%"
57
ALIGN="right"
58
VALIGN="bottom"
59
>
60
HREF="sdlsetcliprect.html"
61
>Next
62
>
63
>
64
>
65
>
66
ALIGN="LEFT"
67
WIDTH="100%">
68
>
69
>
70
NAME="SDLSETALPHA"
71
>SDL_SetAlpha
72
>
73
>
74
CLASS="REFNAMEDIV"
75
>
76
NAME="AEN1681"
77
>
78
>
79
>Name
80
>SDL_SetAlpha -- Adjust the alpha properties of a surface
81
>
82
CLASS="REFSYNOPSISDIV"
83
>
84
NAME="AEN1684"
85
>
86
>
87
>Synopsis
88
>
89
CLASS="FUNCSYNOPSIS"
90
>
91
NAME="AEN1685"
92
>
93
>
94
>
95
>
96
CLASS="FUNCSYNOPSISINFO"
97
>#include "SDL.h"
98
>
99
>
100
>
101
CLASS="FUNCDEF"
102
>int 
103
CLASS="FSFUNC"
104
>SDL_SetAlpha
105
>
106
>(SDL_Surface *surface, Uint32 flag, Uint8 alpha);
107
>
108
>
109
>
110
>
111
>
112
>
113
CLASS="REFSECT1"
114
>
115
NAME="AEN1691"
116
>
117
>
118
>Description
119
>
120
CLASS="NOTE"
121
>
122
CLASS="NOTE"
123
>
124
>
125
>Note: 
126
>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 (
127
CLASS="LITERAL"
128
>SDL_ALPHA_TRANSPARENT
129
>) is now considered transparent and 255 (
130
CLASS="LITERAL"
131
>SDL_ALPHA_OPAQUE
132
>) is now considered opaque.
133
>
134
>
135
>
136
>
137
CLASS="FUNCTION"
138
>SDL_SetAlpha
139
> is used for setting the per-surface alpha
140
value and/or enabling and disabling alpha blending.
141
>
142
>The
143
CLASS="PARAMETER"
144
>
145
>surface
146
>
147
> parameter specifies which surface whose alpha
148
attributes you wish to adjust. 
149
CLASS="PARAMETER"
150
>
151
>flags
152
>
153
> is used to specify
154
whether alpha blending should be used (
155
CLASS="LITERAL"
156
>SDL_SRCALPHA
157
>) and
158
whether the surface should use RLE acceleration for blitting
159
(
160
CLASS="LITERAL"
161
>SDL_RLEACCEL
162
>). 
163
CLASS="PARAMETER"
164
>
165
>flags
166
>
167
> can be an OR'd
168
combination of these two options, one of these options or 0. If
169
170
CLASS="LITERAL"
171
>SDL_SRCALPHA
172
> is not passed as a flag then all alpha
173
information is ignored when blitting the surface. The
174
175
CLASS="PARAMETER"
176
>
177
>alpha
178
>
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 
182
CLASS="LITERAL"
183
>SDL_RLEACCEL
184
>.
185
>
186
CLASS="NOTE"
187
>
188
CLASS="NOTE"
189
>
190
>
191
>Note: 
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.
194
>
195
>
196
>
197
>Alpha effects surface blitting in the following ways:
198
>
199
CLASS="INFORMALTABLE"
200
>
201
NAME="AEN1711"
202
>
203
>
204
>
205
>
206
BORDER="0"
207
CLASS="CALSTABLE"
208
>
209
>
210
>
211
ALIGN="LEFT"
212
VALIGN="TOP"
213
>RGBA->RGB with 
214
CLASS="LITERAL"
215
>SDL_SRCALPHA
216
>
217
>
218
ALIGN="LEFT"
219
VALIGN="TOP"
220
>
221
>The source is alpha-blended with the destination, using the alpha channel. 
222
CLASS="LITERAL"
223
>SDL_SRCCOLORKEY
224
> and the per-surface alpha are ignored.
225
>
226
>
227
>
228
>
229
ALIGN="LEFT"
230
VALIGN="TOP"
231
>RGBA->RGB without 
232
CLASS="LITERAL"
233
>SDL_SRCALPHA
234
>
235
>
236
ALIGN="LEFT"
237
VALIGN="TOP"
238
>
239
>The RGB data is copied from the source. The source alpha channel and the per-surface alpha value are ignored.
240
>
241
>
242
>
243
>
244
ALIGN="LEFT"
245
VALIGN="TOP"
246
>RGB->RGBA with 
247
CLASS="LITERAL"
248
>SDL_SRCALPHA
249
>
250
>
251
ALIGN="LEFT"
252
VALIGN="TOP"
253
>
254
>The source is alpha-blended with the destination using the per-surface alpha
255
value. If 
256
CLASS="LITERAL"
257
>SDL_SRCCOLORKEY
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.
261
>
262
>
263
>
264
>
265
ALIGN="LEFT"
266
VALIGN="TOP"
267
>RGB->RGBA without 
268
CLASS="LITERAL"
269
>SDL_SRCALPHA
270
>
271
>
272
ALIGN="LEFT"
273
VALIGN="TOP"
274
>
275
>The RGB data is copied from the source and the alpha value of the copied pixels
276
is set to opaque. If 
277
CLASS="LITERAL"
278
>SDL_SRCCOLORKEY
279
> is set, only the pixels
280
not matching the colorkey value are copied. 
281
>
282
>
283
>
284
>
285
ALIGN="LEFT"
286
VALIGN="TOP"
287
>RGBA->RGBA with 
288
CLASS="LITERAL"
289
>SDL_SRCALPHA
290
>
291
>
292
ALIGN="LEFT"
293
VALIGN="TOP"
294
>
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
298
CLASS="LITERAL"
299
>SDL_SRCCOLORKEY
300
> is ignored.
301
>
302
>
303
>
304
>
305
ALIGN="LEFT"
306
VALIGN="TOP"
307
>RGBA->RGBA without 
308
CLASS="LITERAL"
309
>SDL_SRCALPHA
310
>
311
>
312
ALIGN="LEFT"
313
VALIGN="TOP"
314
>
315
>The RGBA data is copied to the destination surface. If 
316
CLASS="LITERAL"
317
>SDL_SRCCOLORKEY
318
> is set, only the pixels not matching the colorkey value are copied.
319
>
320
>
321
>
322
>
323
ALIGN="LEFT"
324
VALIGN="TOP"
325
>RGB->RGB with 
326
CLASS="LITERAL"
327
>SDL_SRCALPHA
328
>
329
>
330
ALIGN="LEFT"
331
VALIGN="TOP"
332
>
333
>The source is alpha-blended with the destination using the per-surface alpha value. If 
334
CLASS="LITERAL"
335
>SDL_SRCCOLORKEY
336
> is set, only the pixels not matching the colorkey value are copied.
337
>
338
>
339
>
340
>
341
ALIGN="LEFT"
342
VALIGN="TOP"
343
>RGB->RGB without 
344
CLASS="LITERAL"
345
>SDL_SRCALPHA
346
>
347
>
348
ALIGN="LEFT"
349
VALIGN="TOP"
350
>
351
>The RGB data is copied from the source. If 
352
CLASS="LITERAL"
353
>SDL_SRCCOLORKEY
354
> is set, only the pixels not matching the colorkey value are copied.
355
>
356
>
357
>
358
>
359
>
360
>
361
>
362
>
363
CLASS="NOTE"
364
>
365
CLASS="NOTE"
366
>
367
>
368
>Note: 
369
> Note that RGBA->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.
373
>
374
>Also note that per-pixel and per-surface alpha cannot be combined;
375
the per-pixel alpha is always used if available
376
>
377
>
378
>
379
>
380
CLASS="REFSECT1"
381
>
382
NAME="AEN1764"
383
>
384
>
385
>Return Value
386
>
387
>This function returns 
388
CLASS="RETURNVALUE"
389
>0
390
>, or
391
392
CLASS="RETURNVALUE"
393
>-1
394
> if there was an error.
395
>
396
>
397
CLASS="REFSECT1"
398
>
399
NAME="AEN1769"
400
>
401
>
402
>See Also
403
>
404
>
405
HREF="sdlmaprgba.html"
406
>
407
CLASS="FUNCTION"
408
>SDL_MapRGBA
409
>
410
>,
411
412
HREF="sdlgetrgba.html"
413
>
414
CLASS="FUNCTION"
415
>SDL_GetRGBA
416
>
417
>,
418
419
HREF="sdldisplayformatalpha.html"
420
>
421
CLASS="FUNCTION"
422
>SDL_DisplayFormatAlpha
423
>
424
>,
425
426
HREF="sdlblitsurface.html"
427
>
428
CLASS="FUNCTION"
429
>SDL_BlitSurface
430
>
431
>
432
>
433
>
434
CLASS="NAVFOOTER"
435
>
436
ALIGN="LEFT"
437
WIDTH="100%">
438
WIDTH="100%"
439
BORDER="0"
440
CELLPADDING="0"
441
CELLSPACING="0"
442
>
443
>
444
WIDTH="33%"
445
ALIGN="left"
446
VALIGN="top"
447
>
448
HREF="sdlsetcolorkey.html"
449
>Prev
450
>
451
>
452
WIDTH="34%"
453
ALIGN="center"
454
VALIGN="top"
455
>
456
HREF="index.html"
457
>Home
458
>
459
>
460
WIDTH="33%"
461
ALIGN="right"
462
VALIGN="top"
463
>
464
HREF="sdlsetcliprect.html"
465
>Next
466
>
467
>
468
>
469
>
470
WIDTH="33%"
471
ALIGN="left"
472
VALIGN="top"
473
>SDL_SetColorKey
474
>
475
WIDTH="34%"
476
ALIGN="center"
477
VALIGN="top"
478
>
479
HREF="video.html"
480
>Up
481
>
482
>
483
WIDTH="33%"
484
ALIGN="right"
485
VALIGN="top"
486
>SDL_SetClipRect
487
>
488
>
489
>
490
>
491
>
492
>