1<HTML 2><HEAD 3><TITLE 4>SDL_SetClipRect</TITLE 5><META 6NAME="GENERATOR" 7CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+ 8"><LINK 9REL="HOME" 10TITLE="SDL Library Documentation" 11HREF="index.html"><LINK 12REL="UP" 13TITLE="Video" 14HREF="video.html"><LINK 15REL="PREVIOUS" 16TITLE="SDL_SetAlpha" 17HREF="sdlsetalpha.html"><LINK 18REL="NEXT" 19TITLE="SDL_GetClipRect" 20HREF="sdlgetcliprect.html"></HEAD 21><BODY 22CLASS="REFENTRY" 23BGCOLOR="#FFF8DC" 24TEXT="#000000" 25LINK="#0000ee" 26VLINK="#551a8b" 27ALINK="#ff0000" 28><DIV 29CLASS="NAVHEADER" 30><TABLE 31SUMMARY="Header navigation table" 32WIDTH="100%" 33BORDER="0" 34CELLPADDING="0" 35CELLSPACING="0" 36><TR 37><TH 38COLSPAN="3" 39ALIGN="center" 40>SDL Library Documentation</TH 41></TR 42><TR 43><TD 44WIDTH="10%" 45ALIGN="left" 46VALIGN="bottom" 47><A 48HREF="sdlsetalpha.html" 49ACCESSKEY="P" 50>Prev</A 51></TD 52><TD 53WIDTH="80%" 54ALIGN="center" 55VALIGN="bottom" 56></TD 57><TD 58WIDTH="10%" 59ALIGN="right" 60VALIGN="bottom" 61><A 62HREF="sdlgetcliprect.html" 63ACCESSKEY="N" 64>Next</A 65></TD 66></TR 67></TABLE 68><HR 69ALIGN="LEFT" 70WIDTH="100%"></DIV 71><H1 72><A 73NAME="SDLSETCLIPRECT" 74></A 75>SDL_SetClipRect</H1 76><DIV 77CLASS="REFNAMEDIV" 78><A 79NAME="AEN2199" 80></A 81><H2 82>Name</H2 83>SDL_SetClipRect -- Sets the clipping rectangle for a surface.</DIV 84><DIV 85CLASS="REFSYNOPSISDIV" 86><A 87NAME="AEN2202" 88></A 89><H2 90>Synopsis</H2 91><DIV 92CLASS="FUNCSYNOPSIS" 93><A 94NAME="AEN2203" 95></A 96><P 97></P 98><PRE 99CLASS="FUNCSYNOPSISINFO" 100>#include "SDL.h"</PRE 101><P 102><CODE 103><CODE 104CLASS="FUNCDEF" 105>void <B 106CLASS="FSFUNC" 107>SDL_SetClipRect</B 108></CODE 109>(SDL_Surface *surface, SDL_Rect *rect);</CODE 110></P 111><P 112></P 113></DIV 114></DIV 115><DIV 116CLASS="REFSECT1" 117><A 118NAME="AEN2209" 119></A 120><H2 121>Description</H2 122><P 123>Sets the clipping rectangle for a surface. When this surface is the 124destination of a blit, only the area within the clip rectangle will be 125drawn into.</P 126><P 127>The rectangle pointed to by <TT 128CLASS="PARAMETER" 129><I 130>rect</I 131></TT 132> will be 133clipped to the edges of the surface so that the clip rectangle for a 134surface can never fall outside the edges of the surface.</P 135><P 136>If <TT 137CLASS="PARAMETER" 138><I 139>rect</I 140></TT 141> is <TT 142CLASS="LITERAL" 143>NULL</TT 144> the clipping 145rectangle will be set to the full size of the surface.</P 146></DIV 147><DIV 148CLASS="REFSECT1" 149><A 150NAME="AEN2217" 151></A 152><H2 153>See Also</H2 154><P 155><A 156HREF="sdlgetcliprect.html" 157><TT 158CLASS="FUNCTION" 159>SDL_GetClipRect</TT 160></A 161>, 162<A 163HREF="sdlblitsurface.html" 164><TT 165CLASS="FUNCTION" 166>SDL_BlitSurface</TT 167></A 168>, 169<A 170HREF="sdlsurface.html" 171><SPAN 172CLASS="STRUCTNAME" 173>SDL_Surface</SPAN 174></A 175></P 176></DIV 177><DIV 178CLASS="NAVFOOTER" 179><HR 180ALIGN="LEFT" 181WIDTH="100%"><TABLE 182SUMMARY="Footer navigation table" 183WIDTH="100%" 184BORDER="0" 185CELLPADDING="0" 186CELLSPACING="0" 187><TR 188><TD 189WIDTH="33%" 190ALIGN="left" 191VALIGN="top" 192><A 193HREF="sdlsetalpha.html" 194ACCESSKEY="P" 195>Prev</A 196></TD 197><TD 198WIDTH="34%" 199ALIGN="center" 200VALIGN="top" 201><A 202HREF="index.html" 203ACCESSKEY="H" 204>Home</A 205></TD 206><TD 207WIDTH="33%" 208ALIGN="right" 209VALIGN="top" 210><A 211HREF="sdlgetcliprect.html" 212ACCESSKEY="N" 213>Next</A 214></TD 215></TR 216><TR 217><TD 218WIDTH="33%" 219ALIGN="left" 220VALIGN="top" 221>SDL_SetAlpha</TD 222><TD 223WIDTH="34%" 224ALIGN="center" 225VALIGN="top" 226><A 227HREF="video.html" 228ACCESSKEY="U" 229>Up</A 230></TD 231><TD 232WIDTH="33%" 233ALIGN="right" 234VALIGN="top" 235>SDL_GetClipRect</TD 236></TR 237></TABLE 238></DIV 239></BODY 240></HTML 241>