Пример #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
}
Пример #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
}
Пример #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
}
Пример #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
}
Пример #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
}