目次 - SDL 3.0 API(機能別) - 領域 - SDL_GetRectIntersection

SDL_GetRectIntersection

2つの長方形の辺の交点を求める

ヘッダ

SDL3/SDL_rect.h

構文

bool SDL_GetRectIntersection(const SDL_Rect *A, const SDL_Rect *B, SDL_Rect *result);

引数

const SDL_Rect *A1つ目の長方形
const SDL_Rect *B2つ目の長方形
SDL_Rect *resultABの辺の交点の書き込み先へのポインタ

戻り値

(bool) 辺が交わるとき真, 交わらないとき偽を戻す.

詳細

resultがNULLのとき, この関数は偽を戻す.

スレッドセーフ

この関数はどのスレッドからも安全に呼べる.

バージョン

SDL 3.2.0以降

SDL Wikiへのリンク

SDL_GetRectIntersection - SDL Wiki