SDL Wiki
(This is the legacy documentation for stable SDL2, the current stable version; SDL3 is the current development version.)

SDL_Rect

A rectangle, with the origin at the upper left (integer).

Header File

Defined in SDL_rect.h

Syntax

typedef struct SDL_Rect
{
    int x, y;
    int w, h;
} SDL_Rect;

Code Examples

SDL_Rect srcrect;
SDL_Rect dstrect;

srcrect.x = 0;
srcrect.y = 0;
srcrect.w = 32;
srcrect.h = 32;
dstrect.x = 640/2;
dstrect.y = 480/2;
dstrect.w = 0;
dstrect.h = 0;

extern SDL_Surface *src, *dst;
SDL_BlitSurface(src, &srcrect, dst, &dstrect);

See Also


CategoryAPI, CategoryAPIStruct, CategoryStruct, CategoryRect


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.