示例#1
0
文件: video.go 项目: badgerodon/go
func MapRGB(pixelFormat PixelFormat, r, g, b uint8) uint32 {
	c_format := (*C.SDL_PixelFormat)(pixelFormat.Ptr)
	c_r := C.Uint8(r)
	c_g := C.Uint8(g)
	c_b := C.Uint8(b)
	ret := C.SDL_MapRGB(c_format, c_r, c_g, c_b)
	return uint32(ret)
}
示例#2
0
文件: pixels.go 项目: emlai/go-sdl2
// MapRGB maps an RGB triple to an opaque pixel value for a given pixel format.
// MapRGB (https://wiki.libsdl.org/SDL_MapRGB)
func MapRGB(format *PixelFormat, r, g, b uint8) uint32 {
	return uint32(C.SDL_MapRGB((*C.SDL_PixelFormat)(unsafe.Pointer(format)),
		C.Uint8(r), C.Uint8(g), C.Uint8(b)))
}
示例#3
0
文件: pixels.go 项目: DeedleFake/sdl
func (p *PixelFormat) MapRGB(r, g, b uint8) uint32 {
	return uint32(C.SDL_MapRGB(p.c(), C.Uint8(r), C.Uint8(g), C.Uint8(b)))
}
示例#4
0
文件: sdl.go 项目: gnanderson/Go-SDL
// Map a RGB color value to a pixel format.
func MapRGB(format *PixelFormat, r, g, b uint8) uint32 {
	return (uint32)(C.SDL_MapRGB((*C.SDL_PixelFormat)(cast(format)), (C.Uint8)(r), (C.Uint8)(g), (C.Uint8)(b)))
}
示例#5
0
文件: video.go 项目: beoran/fungo
// Maps an RGB triple to an opaque pixel value for a given pixel format
func mapRGB(format *C.SDL_PixelFormat, r, g, b uint8) uint32 {
	return uint32(C.SDL_MapRGB(format, C.Uint8(r), C.Uint8(g), C.Uint8(b)))
}