示例#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
文件: rect.go 项目: willemvds/sdl
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
文件: rect.go 项目: flazz/go-sdl2
// 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
文件: rect.go 项目: JalfResi/go-sdl2
func EnclosePoints(points []Point, clip, result *Rect) bool {
	return C.SDL_EnclosePoints(points[0].cptr(), C.int(len(points)), clip.cptr(), result.cptr()) > 0
}