Mercurial > sdl-ios-xcode
view docs/man3/SDL_BlitSurface.3 @ 1282:217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
From: jimrandomh
Subject: [SDL] Re: Modifier keys pressed during initialization stick
I wrote a simple test program which initializes SDL, prints the SDL
version number, then prints any keydown and keyup events with their
modifiers. (Source code below). Compilation was done using Visual
Studio 6, release mode.
My test sequence was:
Start a command prompt. Type the name of the test program.
shift down
enter down (program starts)
Wait for window to appear
enter up
shift up
spacebar down
spacebar up
Under Windows 98, the output was correct:
SDL 1.2.8
left shift down
shift-return down
shift-return up
left shift up
space down
space up
Under Windows 2000 and under Windows XP, the output was:
SDL 1.2.8
shift-space down
shift-space up
Since shift was not held at the time space was pressed, this is
incorrect. Similar results were observed with launching in different
ways (including double-clicking in Windows Explorer), so it does not
depend on the launching terminal.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 29 Jan 2006 07:57:13 +0000 |
parents | e5bc29de3f0a |
children | 546f7c1eb755 |
line wrap: on
line source
.TH "SDL_BlitSurface" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference" .SH "NAME" SDL_BlitSurface\- This performs a fast blit from the source surface to the destination surface\&. .SH "SYNOPSIS" .PP \fB#include "SDL\&.h" .sp \fBint \fBSDL_BlitSurface\fP\fR(\fBSDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect\fR); .SH "DESCRIPTION" .PP This performs a fast blit from the source surface to the destination surface\&. .PP Only the position is used in the \fBdstrect\fR (the width and height are ignored)\&. .PP If either \fBsrcrect\fR or \fBdstrect\fR are \fBNULL\fP, the entire surface (\fBsrc\fR or \fBdst\fR) is copied\&. .PP The final blit rectangle is saved in \fBdstrect\fR after all clipping is performed (\fBsrcrect\fR is not modified)\&. .PP The blit function should not be called on a locked surface\&. .PP 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\&. .PP .nf \f(CWif (source surface has SDL_SRCALPHA set) { if (source surface has alpha channel (that is, format->Amask != 0)) blit using per-pixel alpha, ignoring any colour key else { if (source surface has SDL_SRCCOLORKEY set) blit using the colour key AND the per-surface alpha value else blit using the per-surface alpha value } } else { if (source surface has SDL_SRCCOLORKEY set) blit using the colour key else ordinary opaque rectangular blit }\fR .fi .PP .SH "RETURN VALUE" .PP If the blit is successful, it returns \fB0\fR, otherwise it returns \fB-1\fR\&. .PP 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: .PP .nf \f(CW while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) { while ( SDL_LockSurface(image)) < 0 ) Sleep(10); -- Write image pixels to image->pixels -- SDL_UnlockSurface(image); }\fR .fi .PP 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\&. .SH "SEE ALSO" .PP \fI\fBSDL_LockSurface\fP\fR, \fI\fBSDL_FillRect\fP\fR, \fI\fBSDL_Surface\fR\fR, \fI\fBSDL_Rect\fR\fR ...\" created by instant / docbook-to-man, Tue 11 Sep 2001, 23:01