Esempio n. 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
}
Esempio n. 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
}
Esempio n. 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))
}
Esempio n. 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))
}
Esempio n. 5
0
func (renderer *Renderer) DrawLines(points []Point) int {
	return int(C.SDL_RenderDrawLines(renderer.cptr(), points[0].cptr(), C.int(len(points))))
}
Esempio n. 6
0
File: canvas.go Progetto: velour/ui
// 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())
	}
}