Wiki Page Content

Differences between revisions 13 and 14
Revision 13 as of 2013-11-14 18:10:58
Size: 1257
Editor: Soryy708
Comment:
Revision 14 as of 2015-04-26 20:00:02
Size: 1256
Comment: Sorted related functions, see SGStructures.
Deletions are marked like this. Additions are marked like this.
Line 36: Line 36:
 .[[SDL_BlitSurface]]   .[[SDL_BlitSurface]]
Line 43: Line 43:
 .[[SDL_RenderReadPixels]]
Line 46: Line 45:
 .[[SDL_RenderReadPixels]]

SDL_Rect

A structure that defines a rectangle, with the origin at the upper left.

Data Fields

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

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 = 32;
dstrect.h = 32;

SDL_BlitSurface(src, &srcrect, dst, &dstrect);

Remarks

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.


CategoryStruct, CategoryRect

None: SDL_Rect (last edited 2015-11-18 21:12:51 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit