Example #1
0
func MasksToPixelFormatEnum(bpp int, rm, gm, bm, am uint32) (uint32, error) {
	f := C.SDL_MasksToPixelFormatEnum(C.int(bpp), C.Uint32(rm), C.Uint32(gm), C.Uint32(bm), C.Uint32(am))
	if f == PIXELFORMAT_UNKNOWN {
		return 0, getError()
	}

	return uint32(f), nil
}
Example #2
0
// MasksTouint converts a bpp and RGBA masks to a uint.
// MasksToPixelFormatEnum (https://wiki.libsdl.org/SDL_MasksToPixelFormatEnum)
func MasksToPixelFormatEnum(bpp int, rmask, gmask, bmask, amask uint32) uint {
	return uint(C.SDL_MasksToPixelFormatEnum(C.int(bpp), C.Uint32(rmask), C.Uint32(gmask),
		C.Uint32(bmask), C.Uint32(amask)))
}