目次 - API(機能別) - 領域 - SDL_Rect

SDL_Rect

左上を基点とした長方形を定義する構造体

フィールド

intx長方形の左上のX座標
inty長方形の左上のY座標
intw長方形の幅
inth長方形の高さ

サンプルコード

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);

詳細

SDL_Rectはスクリーン上の長方形の領域を定義する. SDL_BlitSurface()では転送の領域を定義し, 他のビデオ関数でも使われる.

関連項目(関数)

SDL_BlitSurface
SDL_EnclosePoints
SDL_GetDisplayBounds
SDL_HasIntersection
SDL_IntersectRect
SDL_LockTexture
SDL_RenderCopy
SDL_RenderDrawRect
SDL_RenderDrawRects
SDL_RenderReadPixels
SDL_UnionRect
SDL_UpdateTexture

SDL Wikiへのリンク

SDL_Rect - SDL Wiki