1SDL_Surface(3) SDL API Reference SDL_Surface(3)
2
3
4
6 SDL_Surface - Graphical Surface Structure
7
9 typedef struct SDL_Surface {
10 Uint32 flags; /* Read-only */
11 SDL_PixelFormat *format; /* Read-only */
12 int w, h; /* Read-only */
13 Uint16 pitch; /* Read-only */
14 void *pixels; /* Read-write */
15
16 /* clipping information */
17 SDL_Rect clip_rect; /* Read-only */
18
19 /* Reference count -- used when freeing surface */
20 int refcount; /* Read-mostly */
21
22 /* This structure also contains private fields not shown here */
23 } SDL_Surface;
24
26 flags Surface flags
27
28 format Pixel format
29
30 w, h Width and height of the surface
31
32 pitch Length of a surface scanline in bytes
33
34 pixels Pointer to the actual pixel data
35
36 clip_rect surface clip rectangle
37
39 SDL_Surface's represent areas of "graphical" memory, memory that can be
40 drawn to. The video framebuffer is returned as a SDL_Surface by
41 SDL_SetVideoMode and SDL_GetVideoSurface. Most of the fields should be
42 pretty obvious. w and h are the width and height of the surface in pix‐
43 els. pixels is a pointer to the actual pixel data, the surface should
44 be locked before accessing this field. The clip_rect field is the clip‐
45 ping rectangle as set by SDL_SetClipRect.
46
47 The following are supported in the flags field.
48
49 SDL_SWSURFACE Surface is stored in system memory
50
51 SDL_HWSURFACE Surface is stored in video memory
52
53 SDL_ASYNCBLIT Surface uses asynchronous blits if possible
54
55 SDL_ANYFORMAT Allows any pixel-format (Display surface)
56
57 SDL_HWPALETTE Surface has exclusive palette
58
59 SDL_DOUBLEBUF Surface is double buffered (Display surface)
60
61 SDL_FULLSCREEN Surface is full screen (Display Surface)
62
63 SDL_OPENGL Surface has an OpenGL context (Display Surface)
64
65 SDL_OPENGLBLIT Surface supports OpenGL blitting (Display Surface)
66
67 SDL_RESIZABLE Surface is resizable (Display Surface)
68
69 SDL_HWACCEL Surface blit uses hardware acceleration
70
71 SDL_SRCCOLORKEY Surface use colorkey blitting
72
73 SDL_RLEACCEL Colorkey blitting is accelerated with RLE
74
75 SDL_SRCALPHA Surface blit uses alpha blending
76
77 SDL_PREALLOC Surface uses preallocated memory
78
80 SDL_PixelFormat
81
82
83
84SDL Tue 11 Sep 2001, 23:01 SDL_Surface(3)