Esempio n. 1
0
func (r *Renderer) DrawRects(rects []Rect) error {
	if C.SDL_RenderDrawRects(r.c, (*C.SDL_Rect)(unsafe.Pointer(&rects[0])), C.int(len(rects))) != 0 {
		return getError()
	}

	return nil
}
Esempio n. 2
0
// Renderer (https://wiki.libsdl.org/SDL_RenderDrawRects)
func (renderer *Renderer) DrawRects(rects []Rect) error {
	_ret := C.SDL_RenderDrawRects(renderer.cptr(), rects[0].cptr(), C.int(len(rects)))
	if _ret < 0 {
		return GetError()
	}
	return nil
}
Esempio n. 3
0
func (r *Renderer) DrawRects(rects []Rect) bool {
	prects := unsafe.Pointer(&rects[0])
	n := len(rects)
	ret := C.SDL_RenderDrawRects(r.cRenderer, (*C.SDL_Rect)(prects), C.int(n))
	return int(ret) == 0
}
Esempio n. 4
0
func (renderer *Renderer) DrawRects(rects *[]Rect, count int) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_rects := (*C.SDL_Rect)(unsafe.Pointer(&(*rects)[0]))
	_count := (C.int)(count)
	return (int)(C.SDL_RenderDrawRects(_renderer, _rects, _count))
}
Esempio n. 5
0
func (renderer *Renderer) DrawRects(rects []Rect) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_rects := (*C.SDL_Rect)(unsafe.Pointer(&rects[0]))
	_count := (C.int)(len(rects))
	return (int)(C.SDL_RenderDrawRects(_renderer, _rects, _count))
}
Esempio n. 6
0
func (renderer *Renderer) DrawRects(rects []Rect) int {
	return int(C.SDL_RenderDrawRects(renderer.cptr(), rects[0].cptr(), C.int(len(rects))))
}
Esempio n. 7
0
File: canvas.go Progetto: velour/ui
// DrawRects draws some number of rectangles on the canvas.
func (c Canvas) DrawRects(rects ...image.Rectangle) {
	if C.SDL_RenderDrawRects(c.win.rend, sdlRects(rects), C.int(len(rects))) < 0 {
		panic(sdlError())
	}
}