Golang C.Sint16类(方法)实例源码

下面列出了Golang C.Sint16 类(方法)源码代码实例,从而了解它的用法。

作者:veandc    项目:go-sdl   
func CharacterColor(renderer *sdl.Renderer, x, y int, c byte, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_c := C.char(c)
	_color := C.Uint32(gfxColor(color))
	return C.characterColor(renderer, _x, _y, _c, _color) == 0
}

作者:veandc    项目:go-sdl   
func FilledCircleColor(renderer *sdl.Renderer, x, y, rad int, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_rad := C.Sint16(rad)
	_color := C.Uint32(gfxColor(color))
	return C.filledCircleColor(renderer, _x, _y, _rad, _color) == 0
}

作者:veandc    项目:go-sdl   
func StringColor(renderer *sdl.Renderer, x, y int, s string, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_s := C.CString(s)
	_color := C.Uint32(gfxColor(color))
	return C.stringColor(renderer, _x, _y, _s, _color) == 0
}

作者:veandc    项目:go-sdl   
func HlineColor(renderer *sdl.Renderer, x1, x2, y int, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_x2 := C.Sint16(x2)
	_y := C.Sint16(y)
	_color := C.Uint32(gfxColor(color))
	return C.hlineColor(renderer, _x1, _x2, _y, _color) == 0
}

作者:veandc    项目:go-sdl   
func VlineColor(renderer *sdl.Renderer, x, y1, y2 int, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y1 := C.Sint16(y1)
	_y2 := C.Sint16(y2)
	_color := C.Uint32(gfxColor(color))
	return C.vlineColor(renderer, _x, _y1, _y2, _color) == 0
}

作者:griff    项目:starfis   
//Draws the image at the given coordinates.
func (me *Canvas) DrawImage(img *Image, x, y int) {
	C.SDL_SetAlpha(img.img, C.SDL_SRCALPHA, 255)
	var dest C.SDL_Rect
	dest.x = C.Sint16(x + me.origin.X)
	dest.y = C.Sint16(y + me.origin.Y)
	C.SDL_BlitSurface(img.img, nil, me.pane, &dest)
}

作者:griff    项目:starfis   
func toSDL_Rect(b util.Bounds) C.SDL_Rect {
	var r C.SDL_Rect
	r.x = C.Sint16(b.X)
	r.y = C.Sint16(b.Y)
	r.w = C.Uint16(b.Width)
	r.h = C.Uint16(b.Height)
	return r
}

作者:veandc    项目:go-sdl   
func AALineColor(renderer *sdl.Renderer, x1, y1, x2, y2 int, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_color := C.Uint32(gfxColor(color))
	return C.aalineColor(renderer, _x1, _y1, _x2, _y2, _color) == 0
}

作者:griff    项目:starfis   
func sdl_Rect(x, y, width, height int) C.SDL_Rect {
	var r C.SDL_Rect
	r.x = C.Sint16(x)
	r.y = C.Sint16(y)
	r.w = C.Uint16(width)
	r.h = C.Uint16(height)
	return r
}

作者:veandc    项目:go-sdl   
func FilledEllipseColor(renderer *sdl.Renderer, x, y, rx, ry int, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_rx := C.Sint16(rx)
	_ry := C.Sint16(ry)
	_color := C.Uint32(gfxColor(color))
	return C.filledEllipseColor(renderer, _x, _y, _rx, _ry, _color) == 0
}

作者:veandc    项目:go-sdl   
func FilledPieColor(renderer *sdl.Renderer, x, y, rad, start, end int, color sdl.Color) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_rad := C.Sint16(rad)
	_start := C.Sint16(start)
	_end := C.Sint16(end)
	_color := C.Uint32(gfxColor(color))
	return C.filledPieColor(renderer, _x, _y, _rad, _start, _end, _color) == 0
}

作者:veandc    项目:go-sdl   
func ThickLineColor(renderer *sdl.Renderer, x1, y1, x2, y2, width int, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_width := C.Uint8(width)
	_color := C.Uint32(gfxColor(color))
	return C.thickLineColor(renderer, _x1, _y1, _x2, _y2, _width, _color) == 0
}

作者:veandc    项目:go-sdl   
func RoundedBoxColor(renderer *sdl.Renderer, x1, y1, x2, y2, rad int, color sdl.Color) bool {
	_x1 := C.Sint16(x1)
	_y1 := C.Sint16(y1)
	_x2 := C.Sint16(x2)
	_y2 := C.Sint16(y2)
	_rad := C.Sint16(rad)
	_color := C.Uint32(gfxColor(color))
	return C.roundedBoxColor(renderer, _x1, _y1, _x2, _y2, _rad, _color) == 0
}

作者:veandc    项目:go-sdl   
func PixelRGBA(renderer *sdl.Renderer, x, y int, r, g, b, a uint8) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.pixelRGBA(renderer, _x, _y, _r, _g, _b, _a) == 0
}

作者:rsaarel    项目:teratoge   
func convertRect(rect image.Rectangle) C.SDL_Rect {
	rect = rect.Canon()
	return C.SDL_Rect{
		C.Sint16(rect.Min.X),
		C.Sint16(rect.Min.Y),
		C.Uint16(rect.Max.X - rect.Min.X),
		C.Uint16(rect.Max.Y - rect.Min.Y),
	}
}

作者:veandc    项目:go-sdl   
func VlineRGBA(renderer *sdl.Renderer, x, y1, y2 int, r, g, b, a uint8) bool {
	_x := C.Sint16(x)
	_y1 := C.Sint16(y1)
	_y2 := C.Sint16(y2)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.vlineRGBA(renderer, _x, _y1, _y2, _r, _g, _b, _a) == 0
}

作者:veandc    项目:go-sdl   
func HlineRGBA(renderer *sdl.Renderer, x1, x2, y int, r, g, b, a uint8) bool {
	_x1 := C.Sint16(x1)
	_x2 := C.Sint16(x2)
	_y := C.Sint16(y)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.hlineRGBA(renderer, _x1, _x2, _y, _r, _g, _b, _a) == 0
}

作者:veandc    项目:go-sdl   
func CharacterRGBA(renderer *sdl.Renderer, x, y int, c, r, g, b, a uint8) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_c := C.char(c)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.characterRGBA(renderer, _x, _y, _c, _r, _g, _b, _a) == 0
}

作者:veandc    项目:go-sdl   
func FilledCircleRGBA(renderer *sdl.Renderer, x, y, rad int, r, g, b, a uint8) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_rad := C.Sint16(rad)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.filledCircleRGBA(renderer, _x, _y, _rad, _r, _g, _b, _a) == 0
}

作者:veandc    项目:go-sdl   
func StringRGBA(renderer *sdl.Renderer, x, y int, s string, r, g, b, a uint8) bool {
	_x := C.Sint16(x)
	_y := C.Sint16(y)
	_s := C.CString(s)
	_r := C.Uint8(r)
	_g := C.Uint8(g)
	_b := C.Uint8(b)
	_a := C.Uint8(a)
	return C.stringRGBA(renderer, _x, _y, _s, _r, _g, _b, _a) == 0
}


问题


面经


文章

微信
公众号

扫码关注公众号