Exemplo 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
}
Exemplo 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
}
Exemplo 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
}
Exemplo 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))
}
Exemplo 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))
}
Exemplo n.º 6
0
func (renderer *Renderer) DrawRects(rects []Rect) int {
	return int(C.SDL_RenderDrawRects(renderer.cptr(), rects[0].cptr(), C.int(len(rects))))
}
Exemplo n.º 7
0
Arquivo: canvas.go Projeto: 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())
	}
}