예제 #1
0
SDL_Rect union_rects(const SDL_Rect& rect1, const SDL_Rect& rect2)
{
	SDL_Rect res;
	SDL_UnionRect(&rect1, &rect2, &res);

	return res;
}
예제 #2
0
/*
 * SDL.unionRect(r1, r2)
 *
 * Arguments:
 *	r1 the first rectangle
 *	r2 the second rectangle
 *
 * Returns:
 *	The union rectangle
 */
static int
l_unionRect(lua_State *L)
{
	SDL_Rect a, b, result;

	videoGetRect(L, 1, &a);
	videoGetRect(L, 2, &a);

	SDL_UnionRect(&a, &b, &result);
	videoPushRect(L, &result);

	return 1;
}