comparison docs/man3/SDL_SetAlpha.3 @ 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
1 .TH "SDL_SetAlpha" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference" 1 .TH "SDL_SetAlpha" "3" "Sun 10 Jun 2001, 19:42" "SDL" "SDL API Reference"
2 .SH "NAME" 2 .SH "NAME"
3 SDL_SetAlpha\- Adjust the alpha properties of a surface 3 SDL_SetAlpha\- Adjust the alpha properties of a surface
4 .SH "SYNOPSIS" 4 .SH "SYNOPSIS"
5 .PP 5 .PP
6 \fB#include "SDL\&.h" 6 \fB#include "SDL\&.h"
12 \fBNote: 12 \fBNote:
13 .PP 13 .PP
14 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 (\fBSDL_ALPHA_TRANSPARENT\fP) is now considered transparent and 255 (\fBSDL_ALPHA_OPAQUE\fP) is now considered opaque\&. 14 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 (\fBSDL_ALPHA_TRANSPARENT\fP) is now considered transparent and 255 (\fBSDL_ALPHA_OPAQUE\fP) is now considered opaque\&.
15 .RE 15 .RE
16 .PP 16 .PP
17 \fBSDL_SetAlpha\fP is used for setting the per-surface alpha and/or enabling and disabling per-pixel alpha blending\&. 17 \fBSDL_SetAlpha\fP is used for setting the per-surface alpha value and/or enabling and disabling alpha blending\&.
18 .PP 18 .PP
19 The \fBsurface\fR parameter specifies which surface whose alpha attributes you wish to adjust\&. \fBflags\fR is used to specify whether alpha blending should be used (\fBSDL_SRCALPHA\fP) and whether the surface should use RLE acceleration for blitting (\fBSDL_RLEACCEL\fP)\&. \fBflags\fR can be an OR\&'d combination of these two options, one of these options or 0\&. If \fBSDL_SRCALPHA\fP is not passed as a flag then all alpha information is ignored when blitting the surface\&. The \fBalpha\fR 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 \fBSDL_RLEACCEL\fP\&. Setting the per-surface alpha value to 0 disables per-surface alpha blending\&. 19 The\fBsurface\fR parameter specifies which surface whose alpha attributes you wish to adjust\&. \fBflags\fR is used to specify whether alpha blending should be used (\fBSDL_SRCALPHA\fP) and whether the surface should use RLE acceleration for blitting (\fBSDL_RLEACCEL\fP)\&. \fBflags\fR can be an OR\&'d combination of these two options, one of these options or 0\&. If \fBSDL_SRCALPHA\fP is not passed as a flag then all alpha information is ignored when blitting the surface\&. The \fBalpha\fR 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 \fBSDL_RLEACCEL\fP\&.
20 .PP 20 .PP
21 .RS 21 .RS
22 \fBNote: 22 \fBNote:
23 .PP 23 .PP
24 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\&. 24 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\&.
31 .TP 20 31 .TP 20
32 RGBA->RGB without \fBSDL_SRCALPHA\fP 32 RGBA->RGB without \fBSDL_SRCALPHA\fP
33 The RGB data is copied from the source\&. The source alpha channel and the per-surface alpha value are ignored\&. 33 The RGB data is copied from the source\&. The source alpha channel and the per-surface alpha value are ignored\&.
34 .TP 20 34 .TP 20
35 RGB->RGBA with \fBSDL_SRCALPHA\fP 35 RGB->RGBA with \fBSDL_SRCALPHA\fP
36 The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fPliteral> is set, only the pixels not matching the colorkey value are copied\&. 36 The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. The alpha channel of the copied pixels is set to opaque\&.
37 .TP 20 37 .TP 20
38 RGB->RGBA without \fBSDL_SRCALPHA\fP 38 RGB->RGBA without \fBSDL_SRCALPHA\fP
39 The RGB data is copied from the source and the destination alpha is zero to opaque\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. 39 The RGB data is copied from the source and the alpha value of the copied pixels is set to opaque\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
40 .TP 20 40 .TP 20
41 RGBA->RGBA with \fBSDL_SRCALPHA\fP 41 RGBA->RGBA with \fBSDL_SRCALPHA\fP
42 The source is alpha-blended with the destination using the source alpha channel\&. The alpha channel in the destination surface is left untouched\&. \fBSDL_SRCCOLORKEY\fP is ignored\&. 42 The source is alpha-blended with the destination using the source alpha channel\&. The alpha channel in the destination surface is left untouched\&. \fBSDL_SRCCOLORKEY\fP is ignored\&.
43 .TP 20 43 .TP 20
44 RGBA->RGBA without \fBSDL_SRCALPHA\fP 44 RGBA->RGBA without \fBSDL_SRCALPHA\fP
47 RGB->RGB with \fBSDL_SRCALPHA\fP 47 RGB->RGB with \fBSDL_SRCALPHA\fP
48 The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. 48 The source is alpha-blended with the destination using the per-surface alpha value\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
49 .TP 20 49 .TP 20
50 RGB->RGB without \fBSDL_SRCALPHA\fP 50 RGB->RGB without \fBSDL_SRCALPHA\fP
51 The RGB data is copied from the source\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&. 51 The RGB data is copied from the source\&. If \fBSDL_SRCCOLORKEY\fP is set, only the pixels not matching the colorkey value are copied\&.
52 .PP
53 .RS
54 \fBNote:
55 .PP
56 Note that RGBA->RGBA blits (with SDL_SRCALPHA set) keep the alpha of the destination surface\&. This means that you cannot compose two arbitrary RGBA surfaces this way and get the result you would expect from "overlaying" them; the destination alpha will work as a mask\&.
57 .PP
58 Also note that per-pixel and per-surface alpha cannot be combined; the per-pixel alpha is always used if available
59 .RE
60 .SH "RETURN VALUE"
61 .PP
62 This function returns \fB0\fR, or \fB-1\fR if there was an error\&.
52 .SH "SEE ALSO" 63 .SH "SEE ALSO"
53 .PP 64 .PP
54 \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR, \fI\fBSDL_BlitSurface\fP\fR 65 \fI\fBSDL_MapRGBA\fP\fR, \fI\fBSDL_GetRGBA\fP\fR, \fI\fBSDL_DisplayFormatAlpha\fP\fR, \fI\fBSDL_BlitSurface\fP\fR
55 ...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04 66 ...\" created by instant / docbook-to-man, Sun 10 Jun 2001, 19:42