Пример #1
0
// Renderer (https://wiki.libsdl.org/SDL_RenderDrawLines)
func (renderer *Renderer) DrawLines(points []Point) error {
	_ret := C.SDL_RenderDrawLines(renderer.cptr(), points[0].cptr(), C.int(len(points)))
	if _ret < 0 {
		return GetError()
	}
	return nil
}
Пример #2
0
func (r *Renderer) DrawLines(points []Point) bool {
	pptr := unsafe.Pointer(&points[0])
	n := len(points)
	ret := C.SDL_RenderDrawLines(r.cRenderer, (*C.SDL_Point)(pptr), C.int(n))
	return int(ret) == 0
}
Пример #3
0
func (renderer *Renderer) DrawLines(points *[]Point, count int) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_points := (*C.SDL_Point)(unsafe.Pointer(&(*points)[0]))
	_count := (C.int)(count)
	return (int)(C.SDL_RenderDrawLines(_renderer, _points, _count))
}
Пример #4
0
func (renderer *Renderer) DrawLines(points []Point) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_points := (*C.SDL_Point)(unsafe.Pointer(&points[0]))
	_count := (C.int)(len(points))
	return (int)(C.SDL_RenderDrawLines(_renderer, _points, _count))
}
Пример #5
0
func (renderer *Renderer) DrawLines(points []Point) int {
	return int(C.SDL_RenderDrawLines(renderer.cptr(), points[0].cptr(), C.int(len(points))))
}
Пример #6
0
// DrawLines draws a series of connected lines on the canvas.
func (c Canvas) DrawLines(points ...image.Point) {
	if C.SDL_RenderDrawLines(c.win.rend, sdlPoints(points), C.int(len(points))) < 0 {
		panic(sdlError())
	}
}