SDL_Rect结构:
用这个结构来保护一个矩形的大小。
int | x | 左上角的x轴坐标 |
int | y | 左上角的y轴坐标 |
int | w | 矩形宽度 |
int | h | 矩形高度 |
例子:
srcrect.x = 0;
srcrect.y = 0;
srcrect.w = 32;
srcrect.h = 32;
dstrect.x = 640/2;
dstrect.y = 480/2;
dstrect.w = 32;
dstrect.h = 32;
SDL_BlitSurface(src, &srcrect, dst, &dstrect);