Exemplo n.º 1
0
func EnclosePoints(points *Point, count int, clip, result *Rect) bool {
	_points := (*C.SDL_Point)(unsafe.Pointer(points))
	_count := (C.int)(count)
	_clip := (*C.SDL_Rect)(unsafe.Pointer(clip))
	_result := (*C.SDL_Rect)(unsafe.Pointer(result))
	return C.SDL_EnclosePoints(_points, _count, _clip, _result) > 0
}
Exemplo n.º 2
0
func (clip *Rect) Enclose(points []Point) *Rect {
	var ret Rect
	is := C.SDL_EnclosePoints((*C.SDL_Point)(unsafe.Pointer(&points[0])), C.int(len(points)), (*C.SDL_Rect)(unsafe.Pointer(clip)), (*C.SDL_Rect)(unsafe.Pointer(&ret)))
	if is == C.SDL_TRUE {
		return &ret
	}
	return nil
}
Exemplo n.º 3
0
func EnclosePoints(points []Point, clip *Rect) (*Rect, bool) {
	var rect Rect
	return &rect, C.SDL_EnclosePoints(
		(*C.SDL_Point)(unsafe.Pointer(&points[0])),
		C.int(len(points)),
		clip.c(),
		rect.c(),
	) == C.SDL_TRUE
}
Exemplo n.º 4
0
// EnclosePoints (https://wiki.libsdl.org/SDL_EnclosePoints)
func EnclosePoints(points []Point, clip *Rect) (result Rect, ok bool) {
	ok = C.SDL_EnclosePoints(points[0].cptr(), C.int(len(points)), clip.cptr(), result.cptr()) > 0
	return
}
Exemplo n.º 5
0
func EnclosePoints(points []Point, clip, result *Rect) bool {
	return C.SDL_EnclosePoints(points[0].cptr(), C.int(len(points)), clip.cptr(), result.cptr()) > 0
}