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