0
|
1 <HTML
|
|
2 ><HEAD
|
|
3 ><TITLE
|
|
4 >SDL_Surface</TITLE
|
|
5 ><META
|
|
6 NAME="GENERATOR"
|
|
7 CONTENT="Modular DocBook HTML Stylesheet Version 1.61
|
|
8 "><LINK
|
|
9 REL="HOME"
|
|
10 TITLE="SDL Library Documentation"
|
|
11 HREF="index.html"><LINK
|
|
12 REL="UP"
|
|
13 TITLE="Video"
|
|
14 HREF="video.html"><LINK
|
|
15 REL="PREVIOUS"
|
|
16 TITLE="SDL_PixelFormat"
|
|
17 HREF="sdlpixelformat.html"><LINK
|
|
18 REL="NEXT"
|
|
19 TITLE="SDL_VideoInfo"
|
|
20 HREF="sdlvideoinfo.html"></HEAD
|
|
21 ><BODY
|
|
22 CLASS="REFENTRY"
|
|
23 BGCOLOR="#FFF8DC"
|
|
24 TEXT="#000000"
|
|
25 LINK="#0000ee"
|
|
26 VLINK="#551a8b"
|
|
27 ALINK="#ff0000"
|
|
28 ><DIV
|
|
29 CLASS="NAVHEADER"
|
|
30 ><TABLE
|
|
31 WIDTH="100%"
|
|
32 BORDER="0"
|
|
33 CELLPADDING="0"
|
|
34 CELLSPACING="0"
|
|
35 ><TR
|
|
36 ><TH
|
|
37 COLSPAN="3"
|
|
38 ALIGN="center"
|
|
39 >SDL Library Documentation</TH
|
|
40 ></TR
|
|
41 ><TR
|
|
42 ><TD
|
|
43 WIDTH="10%"
|
|
44 ALIGN="left"
|
|
45 VALIGN="bottom"
|
|
46 ><A
|
|
47 HREF="sdlpixelformat.html"
|
|
48 >Prev</A
|
|
49 ></TD
|
|
50 ><TD
|
|
51 WIDTH="80%"
|
|
52 ALIGN="center"
|
|
53 VALIGN="bottom"
|
|
54 ></TD
|
|
55 ><TD
|
|
56 WIDTH="10%"
|
|
57 ALIGN="right"
|
|
58 VALIGN="bottom"
|
|
59 ><A
|
|
60 HREF="sdlvideoinfo.html"
|
|
61 >Next</A
|
|
62 ></TD
|
|
63 ></TR
|
|
64 ></TABLE
|
|
65 ><HR
|
|
66 ALIGN="LEFT"
|
|
67 WIDTH="100%"></DIV
|
|
68 ><H1
|
|
69 ><A
|
|
70 NAME="SDLSURFACE"
|
|
71 >SDL_Surface</A
|
|
72 ></H1
|
|
73 ><DIV
|
|
74 CLASS="REFNAMEDIV"
|
|
75 ><A
|
|
76 NAME="AEN2762"
|
|
77 ></A
|
|
78 ><H2
|
|
79 >Name</H2
|
|
80 >SDL_Surface -- Graphical Surface Structure</DIV
|
|
81 ><DIV
|
|
82 CLASS="REFSECT1"
|
|
83 ><A
|
|
84 NAME="AEN2765"
|
|
85 ></A
|
|
86 ><H2
|
|
87 >Structure Definition</H2
|
|
88 ><PRE
|
|
89 CLASS="PROGRAMLISTING"
|
|
90 >typedef struct SDL_Surface {
|
|
91 Uint32 flags; /* Read-only */
|
|
92 SDL_PixelFormat *format; /* Read-only */
|
|
93 int w, h; /* Read-only */
|
|
94 Uint16 pitch; /* Read-only */
|
|
95 void *pixels; /* Read-write */
|
|
96 int offset; /* Private */
|
|
97
|
|
98 /* Hardware-specific surface info */
|
|
99 struct private_hwdata *hwdata;
|
|
100
|
|
101 /* clipping information */
|
|
102 SDL_Rect clip_rect; /* Read-only */
|
|
103 Uint32 unused1; /* for binary compatibility */
|
|
104 Uint32 unused2; /* for binary compatibility */
|
|
105
|
|
106 /* info for fast blit mapping to other surfaces */
|
|
107 struct SDL_BlitMap *map; /* Private */
|
|
108
|
|
109 /* format version, bumped at every change to invalidate blit maps */
|
|
110 unsigned int format_version; /* Private */
|
|
111
|
|
112 /* Reference count -- used when freeing surface */
|
|
113 int refcount; /* Read-mostly */
|
|
114 } SDL_Surface;</PRE
|
|
115 ></DIV
|
|
116 ><DIV
|
|
117 CLASS="REFSECT1"
|
|
118 ><A
|
|
119 NAME="AEN2768"
|
|
120 ></A
|
|
121 ><H2
|
|
122 >Structure Data</H2
|
|
123 ><DIV
|
|
124 CLASS="INFORMALTABLE"
|
|
125 ><A
|
|
126 NAME="AEN2770"
|
|
127 ></A
|
|
128 ><P
|
|
129 ></P
|
|
130 ><TABLE
|
|
131 BORDER="0"
|
|
132 CLASS="CALSTABLE"
|
|
133 ><TBODY
|
|
134 ><TR
|
|
135 ><TD
|
|
136 ALIGN="LEFT"
|
|
137 VALIGN="TOP"
|
|
138 ><TT
|
|
139 CLASS="STRUCTFIELD"
|
|
140 ><I
|
|
141 >flags</I
|
|
142 ></TT
|
|
143 ></TD
|
|
144 ><TD
|
|
145 ALIGN="LEFT"
|
|
146 VALIGN="TOP"
|
|
147 >Surface flags</TD
|
|
148 ></TR
|
|
149 ><TR
|
|
150 ><TD
|
|
151 ALIGN="LEFT"
|
|
152 VALIGN="TOP"
|
|
153 ><TT
|
|
154 CLASS="STRUCTFIELD"
|
|
155 ><I
|
|
156 >format</I
|
|
157 ></TT
|
|
158 ></TD
|
|
159 ><TD
|
|
160 ALIGN="LEFT"
|
|
161 VALIGN="TOP"
|
|
162 >Pixel <A
|
|
163 HREF="sdlpixelformat.html"
|
|
164 >format</A
|
|
165 ></TD
|
|
166 ></TR
|
|
167 ><TR
|
|
168 ><TD
|
|
169 ALIGN="LEFT"
|
|
170 VALIGN="TOP"
|
|
171 ><TT
|
|
172 CLASS="STRUCTFIELD"
|
|
173 ><I
|
|
174 >w, h</I
|
|
175 ></TT
|
|
176 ></TD
|
|
177 ><TD
|
|
178 ALIGN="LEFT"
|
|
179 VALIGN="TOP"
|
|
180 >Width and height of the surface</TD
|
|
181 ></TR
|
|
182 ><TR
|
|
183 ><TD
|
|
184 ALIGN="LEFT"
|
|
185 VALIGN="TOP"
|
|
186 ><TT
|
|
187 CLASS="STRUCTFIELD"
|
|
188 ><I
|
|
189 >pitch</I
|
|
190 ></TT
|
|
191 ></TD
|
|
192 ><TD
|
|
193 ALIGN="LEFT"
|
|
194 VALIGN="TOP"
|
|
195 >Length of a surface scanline in bytes</TD
|
|
196 ></TR
|
|
197 ><TR
|
|
198 ><TD
|
|
199 ALIGN="LEFT"
|
|
200 VALIGN="TOP"
|
|
201 ><TT
|
|
202 CLASS="STRUCTFIELD"
|
|
203 ><I
|
|
204 >pixels</I
|
|
205 ></TT
|
|
206 ></TD
|
|
207 ><TD
|
|
208 ALIGN="LEFT"
|
|
209 VALIGN="TOP"
|
|
210 >Pointer to the actual pixel data</TD
|
|
211 ></TR
|
|
212 ><TR
|
|
213 ><TD
|
|
214 ALIGN="LEFT"
|
|
215 VALIGN="TOP"
|
|
216 ><TT
|
|
217 CLASS="STRUCTFIELD"
|
|
218 ><I
|
|
219 >clip_minx, clip_maxx</I
|
|
220 ></TT
|
|
221 ></TD
|
|
222 ><TD
|
|
223 ALIGN="LEFT"
|
|
224 VALIGN="TOP"
|
|
225 >X clip coords</TD
|
|
226 ></TR
|
|
227 ><TR
|
|
228 ><TD
|
|
229 ALIGN="LEFT"
|
|
230 VALIGN="TOP"
|
|
231 ><TT
|
|
232 CLASS="STRUCTFIELD"
|
|
233 ><I
|
|
234 >clip_rect</I
|
|
235 ></TT
|
|
236 ></TD
|
|
237 ><TD
|
|
238 ALIGN="LEFT"
|
|
239 VALIGN="TOP"
|
|
240 >surface clip <A
|
|
241 HREF="sdlrect.html"
|
|
242 >rectangle</A
|
|
243 ></TD
|
|
244 ></TR
|
|
245 ></TBODY
|
|
246 ></TABLE
|
|
247 ><P
|
|
248 ></P
|
|
249 ></DIV
|
|
250 ></DIV
|
|
251 ><DIV
|
|
252 CLASS="REFSECT1"
|
|
253 ><A
|
|
254 NAME="AEN2803"
|
|
255 ></A
|
|
256 ><H2
|
|
257 >Description</H2
|
|
258 ><P
|
|
259 ><SPAN
|
|
260 CLASS="STRUCTNAME"
|
|
261 >SDL_Surface</SPAN
|
|
262 >'s represent areas of "graphical"
|
|
263 memory, memory that can be drawn to. The video framebuffer is returned
|
|
264 as a <SPAN
|
|
265 CLASS="STRUCTNAME"
|
|
266 >SDL_Surface</SPAN
|
|
267 > by
|
|
268 <A
|
|
269 HREF="sdlsetvideomode.html"
|
|
270 ><TT
|
|
271 CLASS="FUNCTION"
|
|
272 >SDL_SetVideoMode</TT
|
|
273 ></A
|
|
274 >
|
|
275 and <A
|
|
276 HREF="sdlgetvideosurface.html"
|
|
277 ><TT
|
|
278 CLASS="FUNCTION"
|
|
279 >SDL_GetVideoSurface</TT
|
|
280 ></A
|
|
281 >.
|
|
282 Most of the fields should be pretty obvious.
|
|
283 <TT
|
|
284 CLASS="STRUCTFIELD"
|
|
285 ><I
|
|
286 >w</I
|
|
287 ></TT
|
|
288 > and <TT
|
|
289 CLASS="STRUCTFIELD"
|
|
290 ><I
|
|
291 >h</I
|
|
292 ></TT
|
|
293 > are the
|
|
294 width and height of the surface in pixels.
|
|
295 <TT
|
|
296 CLASS="STRUCTFIELD"
|
|
297 ><I
|
|
298 >pixels</I
|
|
299 ></TT
|
|
300 > is a pointer to the actual pixel data,
|
|
301 the surface should be <A
|
|
302 HREF="sdllocksurface.html"
|
|
303 >locked</A
|
|
304 >
|
|
305 before accessing this field. The <TT
|
|
306 CLASS="STRUCTFIELD"
|
|
307 ><I
|
|
308 >clip_rect</I
|
|
309 ></TT
|
|
310 > field
|
|
311 is the clipping rectangle as set by
|
|
312 <A
|
|
313 HREF="sdlsetcliprect.html"
|
|
314 ><TT
|
|
315 CLASS="FUNCTION"
|
|
316 >SDL_SetClipRect</TT
|
|
317 ></A
|
|
318 >.</P
|
|
319 ><P
|
|
320 >The following are supported in the
|
|
321 <TT
|
|
322 CLASS="STRUCTFIELD"
|
|
323 ><I
|
|
324 >flags</I
|
|
325 ></TT
|
|
326 > field.</P
|
|
327 ><DIV
|
|
328 CLASS="INFORMALTABLE"
|
|
329 ><A
|
|
330 NAME="AEN2821"
|
|
331 ></A
|
|
332 ><P
|
|
333 ></P
|
|
334 ><TABLE
|
|
335 BORDER="1"
|
|
336 CLASS="CALSTABLE"
|
|
337 ><TBODY
|
|
338 ><TR
|
|
339 ><TD
|
|
340 ALIGN="LEFT"
|
|
341 VALIGN="TOP"
|
|
342 ><TT
|
|
343 CLASS="LITERAL"
|
|
344 >SDL_SWSURFACE</TT
|
|
345 ></TD
|
|
346 ><TD
|
|
347 ALIGN="LEFT"
|
|
348 VALIGN="TOP"
|
|
349 >Surface is stored in system memory</TD
|
|
350 ></TR
|
|
351 ><TR
|
|
352 ><TD
|
|
353 ALIGN="LEFT"
|
|
354 VALIGN="TOP"
|
|
355 ><TT
|
|
356 CLASS="LITERAL"
|
|
357 >SDL_HWSURFACE</TT
|
|
358 ></TD
|
|
359 ><TD
|
|
360 ALIGN="LEFT"
|
|
361 VALIGN="TOP"
|
|
362 >Surface is stored in video memory</TD
|
|
363 ></TR
|
|
364 ><TR
|
|
365 ><TD
|
|
366 ALIGN="LEFT"
|
|
367 VALIGN="TOP"
|
|
368 ><TT
|
|
369 CLASS="LITERAL"
|
|
370 >SDL_ASYNCBLIT</TT
|
|
371 ></TD
|
|
372 ><TD
|
|
373 ALIGN="LEFT"
|
|
374 VALIGN="TOP"
|
|
375 >Surface uses asynchronous blits if possible</TD
|
|
376 ></TR
|
|
377 ><TR
|
|
378 ><TD
|
|
379 ALIGN="LEFT"
|
|
380 VALIGN="TOP"
|
|
381 ><TT
|
|
382 CLASS="LITERAL"
|
|
383 >SDL_ANYFORMAT</TT
|
|
384 ></TD
|
|
385 ><TD
|
|
386 ALIGN="LEFT"
|
|
387 VALIGN="TOP"
|
|
388 >Allows any pixel-format (Display surface)</TD
|
|
389 ></TR
|
|
390 ><TR
|
|
391 ><TD
|
|
392 ALIGN="LEFT"
|
|
393 VALIGN="TOP"
|
|
394 ><TT
|
|
395 CLASS="LITERAL"
|
|
396 >SDL_HWPALETTE</TT
|
|
397 ></TD
|
|
398 ><TD
|
|
399 ALIGN="LEFT"
|
|
400 VALIGN="TOP"
|
|
401 >Surface has exclusive palette</TD
|
|
402 ></TR
|
|
403 ><TR
|
|
404 ><TD
|
|
405 ALIGN="LEFT"
|
|
406 VALIGN="TOP"
|
|
407 ><TT
|
|
408 CLASS="LITERAL"
|
|
409 >SDL_DOUBLEBUF</TT
|
|
410 ></TD
|
|
411 ><TD
|
|
412 ALIGN="LEFT"
|
|
413 VALIGN="TOP"
|
|
414 >Surface is double buffered (Display surface)</TD
|
|
415 ></TR
|
|
416 ><TR
|
|
417 ><TD
|
|
418 ALIGN="LEFT"
|
|
419 VALIGN="TOP"
|
|
420 ><TT
|
|
421 CLASS="LITERAL"
|
|
422 >SDL_FULLSCREEN</TT
|
|
423 ></TD
|
|
424 ><TD
|
|
425 ALIGN="LEFT"
|
|
426 VALIGN="TOP"
|
|
427 >Surface is full screen (Display Surface)</TD
|
|
428 ></TR
|
|
429 ><TR
|
|
430 ><TD
|
|
431 ALIGN="LEFT"
|
|
432 VALIGN="TOP"
|
|
433 ><TT
|
|
434 CLASS="LITERAL"
|
|
435 >SDL_OPENGL</TT
|
|
436 ></TD
|
|
437 ><TD
|
|
438 ALIGN="LEFT"
|
|
439 VALIGN="TOP"
|
|
440 >Surface has an OpenGL context (Display Surface)</TD
|
|
441 ></TR
|
|
442 ><TR
|
|
443 ><TD
|
|
444 ALIGN="LEFT"
|
|
445 VALIGN="TOP"
|
|
446 ><TT
|
|
447 CLASS="LITERAL"
|
|
448 >SDL_OPENGLBLIT</TT
|
|
449 ></TD
|
|
450 ><TD
|
|
451 ALIGN="LEFT"
|
|
452 VALIGN="TOP"
|
|
453 >Surface supports OpenGL blitting (Display Surface)</TD
|
|
454 ></TR
|
|
455 ><TR
|
|
456 ><TD
|
|
457 ALIGN="LEFT"
|
|
458 VALIGN="TOP"
|
|
459 ><TT
|
|
460 CLASS="LITERAL"
|
|
461 >SDL_RESIZABLE</TT
|
|
462 ></TD
|
|
463 ><TD
|
|
464 ALIGN="LEFT"
|
|
465 VALIGN="TOP"
|
|
466 >Surface is resizable (Display Surface)</TD
|
|
467 ></TR
|
|
468 ><TR
|
|
469 ><TD
|
|
470 ALIGN="LEFT"
|
|
471 VALIGN="TOP"
|
|
472 ><TT
|
|
473 CLASS="LITERAL"
|
|
474 >SDL_HWACCEL</TT
|
|
475 ></TD
|
|
476 ><TD
|
|
477 ALIGN="LEFT"
|
|
478 VALIGN="TOP"
|
|
479 >Surface blit uses hardware acceleration</TD
|
|
480 ></TR
|
|
481 ><TR
|
|
482 ><TD
|
|
483 ALIGN="LEFT"
|
|
484 VALIGN="TOP"
|
|
485 ><TT
|
|
486 CLASS="LITERAL"
|
|
487 >SDL_SRCOLORKEY</TT
|
|
488 ></TD
|
|
489 ><TD
|
|
490 ALIGN="LEFT"
|
|
491 VALIGN="TOP"
|
|
492 >Surface use colorkey blitting</TD
|
|
493 ></TR
|
|
494 ><TR
|
|
495 ><TD
|
|
496 ALIGN="LEFT"
|
|
497 VALIGN="TOP"
|
|
498 ><TT
|
|
499 CLASS="LITERAL"
|
|
500 >SDL_RLEACCEL</TT
|
|
501 ></TD
|
|
502 ><TD
|
|
503 ALIGN="LEFT"
|
|
504 VALIGN="TOP"
|
|
505 >Colorkey blitting is accelerated with RLE</TD
|
|
506 ></TR
|
|
507 ><TR
|
|
508 ><TD
|
|
509 ALIGN="LEFT"
|
|
510 VALIGN="TOP"
|
|
511 ><TT
|
|
512 CLASS="LITERAL"
|
|
513 >SDL_SRCALPHA</TT
|
|
514 ></TD
|
|
515 ><TD
|
|
516 ALIGN="LEFT"
|
|
517 VALIGN="TOP"
|
|
518 >Surface blit uses alpha blending</TD
|
|
519 ></TR
|
|
520 ><TR
|
|
521 ><TD
|
|
522 ALIGN="LEFT"
|
|
523 VALIGN="TOP"
|
|
524 ><TT
|
|
525 CLASS="LITERAL"
|
|
526 >SDL_PREALLOC</TT
|
|
527 ></TD
|
|
528 ><TD
|
|
529 ALIGN="LEFT"
|
|
530 VALIGN="TOP"
|
|
531 >Surface uses preallocated memory</TD
|
|
532 ></TR
|
|
533 ></TBODY
|
|
534 ></TABLE
|
|
535 ><P
|
|
536 ></P
|
|
537 ></DIV
|
|
538 ></DIV
|
|
539 ><DIV
|
|
540 CLASS="REFSECT1"
|
|
541 ><A
|
|
542 NAME="AEN2884"
|
|
543 ></A
|
|
544 ><H2
|
|
545 >See Also</H2
|
|
546 ><P
|
|
547 ><A
|
|
548 HREF="sdlpixelformat.html"
|
|
549 ><SPAN
|
|
550 CLASS="STRUCTNAME"
|
|
551 >SDL_PixelFormat</SPAN
|
|
552 ></A
|
|
553 ></P
|
|
554 ></DIV
|
|
555 ><DIV
|
|
556 CLASS="NAVFOOTER"
|
|
557 ><HR
|
|
558 ALIGN="LEFT"
|
|
559 WIDTH="100%"><TABLE
|
|
560 WIDTH="100%"
|
|
561 BORDER="0"
|
|
562 CELLPADDING="0"
|
|
563 CELLSPACING="0"
|
|
564 ><TR
|
|
565 ><TD
|
|
566 WIDTH="33%"
|
|
567 ALIGN="left"
|
|
568 VALIGN="top"
|
|
569 ><A
|
|
570 HREF="sdlpixelformat.html"
|
|
571 >Prev</A
|
|
572 ></TD
|
|
573 ><TD
|
|
574 WIDTH="34%"
|
|
575 ALIGN="center"
|
|
576 VALIGN="top"
|
|
577 ><A
|
|
578 HREF="index.html"
|
|
579 >Home</A
|
|
580 ></TD
|
|
581 ><TD
|
|
582 WIDTH="33%"
|
|
583 ALIGN="right"
|
|
584 VALIGN="top"
|
|
585 ><A
|
|
586 HREF="sdlvideoinfo.html"
|
|
587 >Next</A
|
|
588 ></TD
|
|
589 ></TR
|
|
590 ><TR
|
|
591 ><TD
|
|
592 WIDTH="33%"
|
|
593 ALIGN="left"
|
|
594 VALIGN="top"
|
|
595 >SDL_PixelFormat</TD
|
|
596 ><TD
|
|
597 WIDTH="34%"
|
|
598 ALIGN="center"
|
|
599 VALIGN="top"
|
|
600 ><A
|
|
601 HREF="video.html"
|
|
602 >Up</A
|
|
603 ></TD
|
|
604 ><TD
|
|
605 WIDTH="33%"
|
|
606 ALIGN="right"
|
|
607 VALIGN="top"
|
|
608 >SDL_VideoInfo</TD
|
|
609 ></TR
|
|
610 ></TABLE
|
|
611 ></DIV
|
|
612 ></BODY
|
|
613 ></HTML
|
|
614 > |