Example #1
0
func BoxRGBA(renderer *sdl.Renderer, x1, y1, x2, y2 int, r, g, b, a uint8) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.boxRGBA(renderer, _x1, _y1, _x2, _y2, _r, _g, _b, _a) == 0
}
Example #2
0
//Fills a rectangle at the given coordinates and size on this Canvas.
func (me *Canvas) FillRect(x, y, width, height int) {
	r := sdl_Rect(x+me.origin.X, y+me.origin.Y, width, height)
	C.boxRGBA(screen, C.Sint16(r.x), C.Sint16(r.y), C.Sint16(int(r.x)+int(r.w)), C.Sint16(int(r.y)+int(r.h)), C.Uint8(me.color.Red), C.Uint8(me.color.Green), C.Uint8(me.color.Blue), C.Uint8(me.color.Alpha))
}