프로그래밍을 하면서 충돌처리를 하는 방법중 하나로 사용할수 있다.
rect와 rect간의 충돌을 알려주는 함수로, 두 rect의 충돌을 감지하면 첫번째 파라미터에 충돌한 rect의 포인터를 전달한다.
두 rect간 충돌이 없으면 zero(0)을 리턴하고, 충돌하면 nonzero(0이 아닌값)을 리턴한다.
정의
BOOL
WINAPI
IntersectRect(
__out LPRECT lprcDst,
__in CONST RECT *lprcSrc1,
__in CONST RECT *lprcSrc2);
2,3번 파라미터의 사각형의 겹치는 영역을 1번 파라미터에 저장
return value
안겹치면 : 0
겹치면 : 0 이 아닌 값
lprcDst
[out] Pointer to the RECT structure that is to receive the intersection of the rectangles pointed to by the lprcSrc1 and lprcSrc2 parameters. This parameter cannot be NULL.
rect와 rect간의 충돌을 알려주는 함수로, 두 rect의 충돌을 감지하면 첫번째 파라미터에 충돌한 rect의 포인터를 전달한다.
두 rect간 충돌이 없으면 zero(0)을 리턴하고, 충돌하면 nonzero(0이 아닌값)을 리턴한다.
정의
BOOL
WINAPI
IntersectRect(
__out LPRECT lprcDst,
__in CONST RECT *lprcSrc1,
__in CONST RECT *lprcSrc2);
2,3번 파라미터의 사각형의 겹치는 영역을 1번 파라미터에 저장
return value
안겹치면 : 0
겹치면 : 0 이 아닌 값
lprcDst
[out] Pointer to the RECT structure that is to receive the intersection of the rectangles pointed to by the lprcSrc1 and lprcSrc2 parameters. This parameter cannot be NULL.