version 2, including all changes.
.
Rev |
Author |
# |
Line |
2 |
perry |
1 |
SDL_!LockSurface |
|
|
2 |
!!!SDL_!LockSurface |
1 |
perry |
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
RETURN VALUE |
|
|
7 |
SEE ALSO |
|
|
8 |
---- |
|
|
9 |
!!NAME |
|
|
10 |
|
|
|
11 |
|
2 |
perry |
12 |
SDL_!LockSurface- Lock a surface for directly access. |
1 |
perry |
13 |
!!SYNOPSIS |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
__#include __ |
|
|
17 |
|
|
|
18 |
|
2 |
perry |
19 |
__int SDL_!LockSurface__(__SDL_Surface |
1 |
perry |
20 |
*surface__); |
|
|
21 |
!!DESCRIPTION |
|
|
22 |
|
|
|
23 |
|
2 |
perry |
24 |
__SDL_!LockSurface__ sets up a surface for directly |
1 |
perry |
25 |
accessing the pixels. Between calls to |
2 |
perry |
26 |
__SDL_!LockSurface__ and __SDL_!UnlockSurface__, you can |
1 |
perry |
27 |
write to and read from __surface-__, using the |
|
|
28 |
pixel format stored in __surface-__. Once you |
|
|
29 |
are done accessing the surface, you should use |
2 |
perry |
30 |
__SDL_!UnlockSurface__ to release it. |
1 |
perry |
31 |
|
|
|
32 |
|
|
|
33 |
Not all surfaces require locking. If |
|
|
34 |
__SDL_MUSTLOCK__(__surface__) evaluates to __0__, |
|
|
35 |
then you can read and write to the surface at any time, and |
|
|
36 |
the pixel format of the surface will not |
|
|
37 |
change. |
|
|
38 |
|
|
|
39 |
|
|
|
40 |
No operating system or library calls should be made between |
|
|
41 |
lock/unlock pairs, as critical system locks may be held |
|
|
42 |
during this time. |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
It should be noted, that since SDL 1.1.8 surface locks are |
|
|
46 |
recursive. This means that you can lock a surface multiple |
|
|
47 |
times, but each lock must have a match unlock. |
|
|
48 |
|
|
|
49 |
|
|
|
50 |
. |
|
|
51 |
. |
2 |
perry |
52 |
SDL_!LockSurface( surface ); |
1 |
perry |
53 |
. |
|
|
54 |
/* Surface is locked */ |
|
|
55 |
/* Direct pixel access on surface here */ |
|
|
56 |
. |
2 |
perry |
57 |
SDL_!LockSurface( surface ); |
1 |
perry |
58 |
. |
|
|
59 |
/* More direct pixel access on surface */ |
|
|
60 |
. |
2 |
perry |
61 |
SDL_!UnlockSurface( surface ); |
1 |
perry |
62 |
/* Surface is still locked */ |
|
|
63 |
/* Note: Is versions |
|
|
64 |
!!RETURN VALUE |
|
|
65 |
|
|
|
66 |
|
2 |
perry |
67 |
__SDL_!LockSurface__ returns __0__, or __-1__ if the |
1 |
perry |
68 |
surface couldn't be locked. |
|
|
69 |
!!SEE ALSO |
|
|
70 |
|
|
|
71 |
|
2 |
perry |
72 |
__SDL_!UnlockSurface__ |
1 |
perry |
73 |
---- |