A structure that contains the definition of a rectangle, with the origin at the upper left.
int |
x |
the x location of the rectangle's upper left corner |
int |
y |
the y location of the rectangle's upper left corner |
int |
w |
the width of the rectangle |
int |
h |
the height of the rectangle |
SDL_Rect srcrect;
SDL_Rect dstrect;
0;
srcrect.x = 0;
srcrect.y = 32;
srcrect.w = 32;
srcrect.h = 640/2;
dstrect.x = 480/2;
dstrect.y = 32;
dstrect.w = 32;
dstrect.h =
SDL_BlitSurface(src, &srcrect, dst, &dstrect);
An SDL_Rect defines a rectangular area of the screen. It is used by SDL_BlitSurface() to define blitting regions and by several other video functions.