Example #1
0
func (r *Renderer) DrawPoints(points []Point) error {
	if C.SDL_RenderDrawPoints(r.c, (*C.SDL_Point)(unsafe.Pointer(&points[0])), C.int(len(points))) != 0 {
		return getError()
	}

	return nil
}
Example #2
0
// Renderer (https://wiki.libsdl.org/SDL_RenderDrawPoints)
func (renderer *Renderer) DrawPoints(points []Point) error {
	_ret := C.SDL_RenderDrawPoints(renderer.cptr(), points[0].cptr(), C.int(len(points)))
	if _ret < 0 {
		return GetError()
	}
	return nil
}
Example #3
0
func RenderDrawPoints(_renderer *Renderer, _points []*Point) {
	C.SDL_RenderDrawPoints(_renderer.Get(), (*C.SDL_Point)(cast(&_points)), C.int(len(_points)))
}
Example #4
0
func (r *Renderer) DrawPoints(points []Point) bool {
	pptr := unsafe.Pointer(&points[0])
	n := len(points)
	ret := C.SDL_RenderDrawPoints(r.cRenderer, (*C.SDL_Point)(pptr), C.int(n))
	return int(ret) == 0
}
Example #5
0
func (renderer *Renderer) DrawPoints(points *Point, count int) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_points := (*C.SDL_Point)(unsafe.Pointer(points))
	_count := (C.int)(count)
	return (int)(C.SDL_RenderDrawPoints(_renderer, _points, _count))
}
Example #6
0
func (renderer *Renderer) DrawPoints(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_RenderDrawPoints(_renderer, _points, _count))
}
Example #7
0
func (renderer *Renderer) DrawPoints(points []Point) int {
	return int(C.SDL_RenderDrawPoints(renderer.cptr(), points[0].cptr(), C.int(len(points))))
}
Example #8
0
File: canvas.go Project: velour/ui
// DrawPoints draws multiple points on the canvas.
func (c Canvas) DrawPoints(points ...image.Point) {
	if C.SDL_RenderDrawPoints(c.win.rend, sdlPoints(points), C.int(len(points))) < 0 {
		panic(sdlError())
	}
}