NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.64
REL="HOME"
TITLE="SDL Library Documentation"
REL="UP"
TITLE="Video"
REL="PREVIOUS"
TITLE="SDL_ConvertSurface"
HREF="sdlconvertsurface.html"><
LINK
REL="NEXT"
TITLE="SDL_FillRect"
HREF="sdlfillrect.html"><
/HEAD
CLASS="REFENTRY"
BGCOLOR="#FFF8DC"
TEXT="#000000"
LINK="#0000ee"
VLINK="#551a8b"
ALINK="#ff0000"
CLASS="NAVHEADER"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
COLSPAN="3"
ALIGN="center"
>SDL Library Documentation<
/TH
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
HREF="sdlconvertsurface.html"
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
HREF="sdlfillrect.html"
ALIGN="LEFT"
NAME="SDLBLITSURFACE"
CLASS="REFNAMEDIV"
NAME="AEN1883"
>SDL_BlitSurface -- This performs a fast blit from the source surface to the destination surface.<
/DIV
CLASS="REFSYNOPSISDIV"
NAME="AEN1886"
CLASS="FUNCSYNOPSIS"
NAME="AEN1887"
CLASS="FUNCSYNOPSISINFO"
CLASS="FUNCDEF"
CLASS="FSFUNC"
>
(SDL_Surface *
src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect
);<
/CODE
CLASS="REFSECT1"
NAME="AEN1893"
>This performs a fast blit from the source surface to the destination surface.<
/P
>Only the position is used in the <
TT
CLASS="PARAMETER"
> (the
width and
height are ignored
).<
/P
CLASS="PARAMETER"
> or
CLASS="PARAMETER"
CLASS="LITERAL"
>, the entire
CLASS="PARAMETER"
CLASS="PARAMETER"
>) is
>The final blit rectangle is saved in
CLASS="PARAMETER"
> after all clipping is performed
CLASS="PARAMETER"
>The blit function should not be called on a locked surface.<
/P
>The results of blitting operations vary greatly depending on whether <
TT
CLASS="LITERAL"
HREF="sdlsetalpha.html"
> 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.
CLASS="PROGRAMLISTING"
>if (source surface has SDL_SRCALPHA set) {
if (source surface has alpha channel (that is, format->Amask != 0))
blit using per-pixel alpha, ignoring any colour key
else {
if (source surface has SDL_SRCCOLORKEY set)
blit using the colour key AND the per-surface alpha value
else
blit using the per-surface alpha value
}
} else {
if (source surface has SDL_SRCCOLORKEY set)
blit using the colour key
else
ordinary opaque rectangular blit
CLASS="REFSECT1"
NAME="AEN1912"
>If the blit is successful, it returns <
SPAN
CLASS="RETURNVALUE"
>,
otherwise it returns <
SPAN
CLASS="RETURNVALUE"
>If either of the surfaces were in video memory, and the blit returns
CLASS="RETURNVALUE"
>, the video memory was lost, so it should be
reloaded with artwork and re-blitted:
CLASS="PROGRAMLISTING"
> while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
while ( SDL_LockSurface(image)) < 0 )
Sleep(10);
-- Write image pixels to image->pixels --
SDL_UnlockSurface(image);
>
This happens under DirectX 5.0 when the system switches away from your
fullscreen application. Locking the surface will also fail until you
have access to the video memory again.<
/P
CLASS="REFSECT1"
NAME="AEN1920"
HREF="sdllocksurface.html"
CLASS="FUNCTION"
>,
HREF="sdlfillrect.html"
CLASS="FUNCTION"
>,
HREF="sdlsurface.html"
CLASS="STRUCTNAME"
>,
HREF="sdlrect.html"
CLASS="STRUCTNAME"
CLASS="NAVFOOTER"
ALIGN="LEFT"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
HREF="sdlconvertsurface.html"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="index.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
HREF="sdlfillrect.html"
WIDTH="33%"
ALIGN="left"
VALIGN="top"
WIDTH="34%"
ALIGN="center"
VALIGN="top"
HREF="video.html"
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>