docs/html/sdlblitsurface.html
changeset 3352 6dc250ebdd80
parent 3351 8e0182c236d8
child 3353 6b14223dd5c7
     1.1 --- a/docs/html/sdlblitsurface.html	Wed Oct 07 06:11:53 2009 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,339 +0,0 @@
     1.4 -<HTML
     1.5 -><HEAD
     1.6 -><TITLE
     1.7 ->SDL_BlitSurface</TITLE
     1.8 -><META
     1.9 -NAME="GENERATOR"
    1.10 -CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
    1.11 -"><LINK
    1.12 -REL="HOME"
    1.13 -TITLE="SDL Library Documentation"
    1.14 -HREF="index.html"><LINK
    1.15 -REL="UP"
    1.16 -TITLE="Video"
    1.17 -HREF="video.html"><LINK
    1.18 -REL="PREVIOUS"
    1.19 -TITLE="SDL_ConvertSurface"
    1.20 -HREF="sdlconvertsurface.html"><LINK
    1.21 -REL="NEXT"
    1.22 -TITLE="SDL_FillRect"
    1.23 -HREF="sdlfillrect.html"></HEAD
    1.24 -><BODY
    1.25 -CLASS="REFENTRY"
    1.26 -BGCOLOR="#FFF8DC"
    1.27 -TEXT="#000000"
    1.28 -LINK="#0000ee"
    1.29 -VLINK="#551a8b"
    1.30 -ALINK="#ff0000"
    1.31 -><DIV
    1.32 -CLASS="NAVHEADER"
    1.33 -><TABLE
    1.34 -SUMMARY="Header navigation table"
    1.35 -WIDTH="100%"
    1.36 -BORDER="0"
    1.37 -CELLPADDING="0"
    1.38 -CELLSPACING="0"
    1.39 -><TR
    1.40 -><TH
    1.41 -COLSPAN="3"
    1.42 -ALIGN="center"
    1.43 ->SDL Library Documentation</TH
    1.44 -></TR
    1.45 -><TR
    1.46 -><TD
    1.47 -WIDTH="10%"
    1.48 -ALIGN="left"
    1.49 -VALIGN="bottom"
    1.50 -><A
    1.51 -HREF="sdlconvertsurface.html"
    1.52 -ACCESSKEY="P"
    1.53 ->Prev</A
    1.54 -></TD
    1.55 -><TD
    1.56 -WIDTH="80%"
    1.57 -ALIGN="center"
    1.58 -VALIGN="bottom"
    1.59 -></TD
    1.60 -><TD
    1.61 -WIDTH="10%"
    1.62 -ALIGN="right"
    1.63 -VALIGN="bottom"
    1.64 -><A
    1.65 -HREF="sdlfillrect.html"
    1.66 -ACCESSKEY="N"
    1.67 ->Next</A
    1.68 -></TD
    1.69 -></TR
    1.70 -></TABLE
    1.71 -><HR
    1.72 -ALIGN="LEFT"
    1.73 -WIDTH="100%"></DIV
    1.74 -><H1
    1.75 -><A
    1.76 -NAME="SDLBLITSURFACE"
    1.77 -></A
    1.78 ->SDL_BlitSurface</H1
    1.79 -><DIV
    1.80 -CLASS="REFNAMEDIV"
    1.81 -><A
    1.82 -NAME="AEN2299"
    1.83 -></A
    1.84 -><H2
    1.85 ->Name</H2
    1.86 ->SDL_BlitSurface&nbsp;--&nbsp;This performs a fast blit from the source surface to the destination surface.</DIV
    1.87 -><DIV
    1.88 -CLASS="REFSYNOPSISDIV"
    1.89 -><A
    1.90 -NAME="AEN2302"
    1.91 -></A
    1.92 -><H2
    1.93 ->Synopsis</H2
    1.94 -><DIV
    1.95 -CLASS="FUNCSYNOPSIS"
    1.96 -><A
    1.97 -NAME="AEN2303"
    1.98 -></A
    1.99 -><P
   1.100 -></P
   1.101 -><PRE
   1.102 -CLASS="FUNCSYNOPSISINFO"
   1.103 ->#include "SDL.h"</PRE
   1.104 -><P
   1.105 -><CODE
   1.106 -><CODE
   1.107 -CLASS="FUNCDEF"
   1.108 ->int <B
   1.109 -CLASS="FSFUNC"
   1.110 ->SDL_BlitSurface</B
   1.111 -></CODE
   1.112 ->(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect);</CODE
   1.113 -></P
   1.114 -><P
   1.115 -></P
   1.116 -></DIV
   1.117 -></DIV
   1.118 -><DIV
   1.119 -CLASS="REFSECT1"
   1.120 -><A
   1.121 -NAME="AEN2309"
   1.122 -></A
   1.123 -><H2
   1.124 ->Description</H2
   1.125 -><P
   1.126 ->This performs a fast blit from the source surface to the destination surface.</P
   1.127 -><P
   1.128 ->The width and height in <TT
   1.129 -CLASS="PARAMETER"
   1.130 -><I
   1.131 ->srcrect</I
   1.132 -></TT
   1.133 -> determine the
   1.134 -size of the copied rectangle. Only the position is used in the
   1.135 -<TT
   1.136 -CLASS="PARAMETER"
   1.137 -><I
   1.138 ->dstrect</I
   1.139 -></TT
   1.140 -> (the width and height are ignored).</P
   1.141 -><P
   1.142 ->If <TT
   1.143 -CLASS="PARAMETER"
   1.144 -><I
   1.145 ->srcrect</I
   1.146 -></TT
   1.147 -> is <TT
   1.148 -CLASS="LITERAL"
   1.149 ->NULL</TT
   1.150 ->, the
   1.151 -entire surface is copied. If <TT
   1.152 -CLASS="PARAMETER"
   1.153 -><I
   1.154 ->dstrect</I
   1.155 -></TT
   1.156 -> is
   1.157 -<TT
   1.158 -CLASS="LITERAL"
   1.159 ->NULL</TT
   1.160 ->, then the destination position (upper left
   1.161 -corner) is (0, 0).</P
   1.162 -><P
   1.163 ->The final blit rectangle is saved in
   1.164 -<TT
   1.165 -CLASS="PARAMETER"
   1.166 -><I
   1.167 ->dstrect</I
   1.168 -></TT
   1.169 -> after all clipping is performed
   1.170 -(<TT
   1.171 -CLASS="PARAMETER"
   1.172 -><I
   1.173 ->srcrect</I
   1.174 -></TT
   1.175 -> is not modified).</P
   1.176 -><P
   1.177 ->The blit function should not be called on a locked surface.</P
   1.178 -><P
   1.179 ->The results of blitting operations vary greatly depending on whether <TT
   1.180 -CLASS="LITERAL"
   1.181 ->SDL_SRCAPLHA</TT
   1.182 -> is set or not. See <A
   1.183 -HREF="sdlsetalpha.html"
   1.184 ->SDL_SetAlpha</A
   1.185 -> 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.
   1.186 -<PRE
   1.187 -CLASS="PROGRAMLISTING"
   1.188 ->if (source surface has SDL_SRCALPHA set) {
   1.189 -    if (source surface has alpha channel (that is, format-&#62;Amask != 0))
   1.190 -        blit using per-pixel alpha, ignoring any colour key
   1.191 -    else {
   1.192 -        if (source surface has SDL_SRCCOLORKEY set)
   1.193 -            blit using the colour key AND the per-surface alpha value
   1.194 -        else
   1.195 -            blit using the per-surface alpha value
   1.196 -    }
   1.197 -} else {
   1.198 -    if (source surface has SDL_SRCCOLORKEY set)
   1.199 -        blit using the colour key
   1.200 -    else
   1.201 -        ordinary opaque rectangular blit
   1.202 -}</PRE
   1.203 -></P
   1.204 -></DIV
   1.205 -><DIV
   1.206 -CLASS="REFSECT1"
   1.207 -><A
   1.208 -NAME="AEN2328"
   1.209 -></A
   1.210 -><H2
   1.211 ->Return Value</H2
   1.212 -><P
   1.213 ->If the blit is successful, it returns <SPAN
   1.214 -CLASS="RETURNVALUE"
   1.215 ->0</SPAN
   1.216 ->,
   1.217 -otherwise it returns <SPAN
   1.218 -CLASS="RETURNVALUE"
   1.219 ->-1</SPAN
   1.220 ->.</P
   1.221 -><P
   1.222 ->If either of the surfaces were in video memory, and the blit returns
   1.223 -<SPAN
   1.224 -CLASS="RETURNVALUE"
   1.225 ->-2</SPAN
   1.226 ->, the video memory was lost, so it should be
   1.227 -reloaded with artwork and re-blitted:
   1.228 -<PRE
   1.229 -CLASS="PROGRAMLISTING"
   1.230 ->        while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
   1.231 -                while ( SDL_LockSurface(image)) &#60; 0 )
   1.232 -                        SDL_Delay(10);
   1.233 -                -- Write image pixels to image-&#62;pixels --
   1.234 -                SDL_UnlockSurface(image);
   1.235 -        }</PRE
   1.236 ->
   1.237 -This happens under DirectX 5.0 when the system switches away from your
   1.238 -fullscreen application.  Locking the surface will also fail until you
   1.239 -have access to the video memory again.</P
   1.240 -></DIV
   1.241 -><DIV
   1.242 -CLASS="REFSECT1"
   1.243 -><A
   1.244 -NAME="AEN2336"
   1.245 -></A
   1.246 -><H2
   1.247 ->See Also</H2
   1.248 -><P
   1.249 -><A
   1.250 -HREF="sdllocksurface.html"
   1.251 -><TT
   1.252 -CLASS="FUNCTION"
   1.253 ->SDL_LockSurface</TT
   1.254 -></A
   1.255 ->,
   1.256 -<A
   1.257 -HREF="sdlfillrect.html"
   1.258 -><TT
   1.259 -CLASS="FUNCTION"
   1.260 ->SDL_FillRect</TT
   1.261 -></A
   1.262 ->,
   1.263 -<A
   1.264 -HREF="sdlsurface.html"
   1.265 -><SPAN
   1.266 -CLASS="STRUCTNAME"
   1.267 ->SDL_Surface</SPAN
   1.268 -></A
   1.269 ->,
   1.270 -<A
   1.271 -HREF="sdlrect.html"
   1.272 -><SPAN
   1.273 -CLASS="STRUCTNAME"
   1.274 ->SDL_Rect</SPAN
   1.275 -></A
   1.276 -></P
   1.277 -></DIV
   1.278 -><DIV
   1.279 -CLASS="NAVFOOTER"
   1.280 -><HR
   1.281 -ALIGN="LEFT"
   1.282 -WIDTH="100%"><TABLE
   1.283 -SUMMARY="Footer navigation table"
   1.284 -WIDTH="100%"
   1.285 -BORDER="0"
   1.286 -CELLPADDING="0"
   1.287 -CELLSPACING="0"
   1.288 -><TR
   1.289 -><TD
   1.290 -WIDTH="33%"
   1.291 -ALIGN="left"
   1.292 -VALIGN="top"
   1.293 -><A
   1.294 -HREF="sdlconvertsurface.html"
   1.295 -ACCESSKEY="P"
   1.296 ->Prev</A
   1.297 -></TD
   1.298 -><TD
   1.299 -WIDTH="34%"
   1.300 -ALIGN="center"
   1.301 -VALIGN="top"
   1.302 -><A
   1.303 -HREF="index.html"
   1.304 -ACCESSKEY="H"
   1.305 ->Home</A
   1.306 -></TD
   1.307 -><TD
   1.308 -WIDTH="33%"
   1.309 -ALIGN="right"
   1.310 -VALIGN="top"
   1.311 -><A
   1.312 -HREF="sdlfillrect.html"
   1.313 -ACCESSKEY="N"
   1.314 ->Next</A
   1.315 -></TD
   1.316 -></TR
   1.317 -><TR
   1.318 -><TD
   1.319 -WIDTH="33%"
   1.320 -ALIGN="left"
   1.321 -VALIGN="top"
   1.322 ->SDL_ConvertSurface</TD
   1.323 -><TD
   1.324 -WIDTH="34%"
   1.325 -ALIGN="center"
   1.326 -VALIGN="top"
   1.327 -><A
   1.328 -HREF="video.html"
   1.329 -ACCESSKEY="U"
   1.330 ->Up</A
   1.331 -></TD
   1.332 -><TD
   1.333 -WIDTH="33%"
   1.334 -ALIGN="right"
   1.335 -VALIGN="top"
   1.336 ->SDL_FillRect</TD
   1.337 -></TR
   1.338 -></TABLE
   1.339 -></DIV
   1.340 -></BODY
   1.341 -></HTML
   1.342 ->
   1.343 \ No newline at end of file