當前位置: 首頁>>代碼示例>>Golang>>正文


Golang C.Sint16函數代碼示例

本文整理匯總了Golang中C.Sint16函數的典型用法代碼示例。如果您正苦於以下問題:Golang Sint16函數的具體用法?Golang Sint16怎麽用?Golang Sint16使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Sint16函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: CharacterColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:7,代碼來源:sdl_gfx.go

示例2: FilledCircleColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:7,代碼來源:sdl_gfx.go

示例3: StringColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:7,代碼來源:sdl_gfx.go

示例4: HlineColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:7,代碼來源:sdl_gfx.go

示例5: VlineColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:7,代碼來源:sdl_gfx.go

示例6: DrawImage

//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)
}
開發者ID:griffy,項目名稱:starfish,代碼行數:8,代碼來源:canvas.go

示例7: toSDL_Rect

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
}
開發者ID:griffy,項目名稱:starfish,代碼行數:8,代碼來源:misc.go

示例8: AALineColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:8,代碼來源:sdl_gfx.go

示例9: sdl_Rect

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
}
開發者ID:griffy,項目名稱:starfish,代碼行數:8,代碼來源:misc.go

示例10: FilledEllipseColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:8,代碼來源:sdl_gfx.go

示例11: FilledPieColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:9,代碼來源:sdl_gfx.go

示例12: ThickLineColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:9,代碼來源:sdl_gfx.go

示例13: RoundedBoxColor

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:9,代碼來源:sdl_gfx.go

示例14: PixelRGBA

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
}
開發者ID:veandco,項目名稱:go-sdl2,代碼行數:9,代碼來源:sdl_gfx.go

示例15: convertRect

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),
	}
}
開發者ID:rsaarelm,項目名稱:teratogen,代碼行數:9,代碼來源:sdl.go


注:本文中的C.Sint16函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。