comparison docs/man3/SDL_BlitSurface.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_BlitSurface" "3" "Mon 12 Mar 2001, 01:04" "SDL" "SDL API Reference" 1 .TH "SDL_BlitSurface" "3" "Sun 10 Jun 2001, 19:41" "SDL" "SDL API Reference"
2 .SH "NAME" 2 .SH "NAME"
3 SDL_BlitSurface\- This performs a fast blit from the source surface to the destination surface\&. 3 SDL_BlitSurface\- This performs a fast blit from the source surface to the destination surface\&.
4 .SH "SYNOPSIS" 4 .SH "SYNOPSIS"
5 .PP 5 .PP
6 \fB#include "SDL\&.h" 6 \fB#include "SDL\&.h"
16 .PP 16 .PP
17 The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&. 17 The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&.
18 .PP 18 .PP
19 The blit function should not be called on a locked surface\&. 19 The blit function should not be called on a locked surface\&.
20 .PP 20 .PP
21 .RS 21 The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR for an explaination of how this affects your results\&. Colorkeying and alpha attributes also interact with surface blitting, as the following pseudo-code should hopefully explain\&.
22 \fBNote:
23 .PP 22 .PP
24 The results of blitting operations vary greatly depending on whether \fBSDL_SRCAPLHA\fP is set or not\&. See \fISDL_SetAlpha\fR\&. 23 .nf
25 .RE 24 \f(CWif (source surface has SDL_SRCALPHA set) {
25 if (source surface has alpha channel (that is, format->Amask != 0))
26 blit using per-pixel alpha, ignoring any colour key
27 else {
28 if (source surface has SDL_SRCCOLORKEY set)
29 blit using the colour key AND the per-surface alpha value
30 else
31 blit using the per-surface alpha value
32 }
33 } else {
34 if (source surface has SDL_SRCCOLORKEY set)
35 blit using the colour key
36 else
37 ordinary opaque rectangular blit
38 }\fR
39 .fi
40 .PP
26 .SH "RETURN VALUE" 41 .SH "RETURN VALUE"
27 .PP 42 .PP
28 If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&. 43 If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&.
29 .PP 44 .PP
30 If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted: 45 If either of the surfaces were in video memory, and the blit returns \fB-2\fR, the video memory was lost, so it should be reloaded with artwork and re-blitted:
40 .PP 55 .PP
41 This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&. 56 This happens under DirectX 5\&.0 when the system switches away from your fullscreen application\&. Locking the surface will also fail until you have access to the video memory again\&.
42 .SH "SEE ALSO" 57 .SH "SEE ALSO"
43 .PP 58 .PP
44 \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR 59 \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR
45 ...\" created by instant / docbook-to-man, Mon 12 Mar 2001, 01:04 60 ...\" created by instant / docbook-to-man, Sun 10 Jun 2001, 19:41