Ejemplo n.º 1
0
// ConvertPixels (https://wiki.libsdl.org/SDL_ConvertPixels)
func ConvertPixels(width, height int, srcFormat uint32, src unsafe.Pointer, srcPitch int,
	dstFormat uint32, dst unsafe.Pointer, dstPitch int) error {
	if C.SDL_ConvertPixels(C.int(width), C.int(height), C.Uint32(srcFormat), src, C.int(srcPitch), C.Uint32(dstFormat), dst, C.int(dstPitch)) != 0 {
		return GetError()
	}
	return nil
}
Ejemplo n.º 2
0
func ConvertPixels(width, height int, src_format uint32, src unsafe.Pointer, src_pitch int,
	dst_format uint32, dst unsafe.Pointer, dst_pitch int) int {
	_width := (C.int)(width)
	_height := (C.int)(height)
	_src_format := (C.Uint32)(src_format)
	_src_pitch := (C.int)(src_pitch)
	_dst_format := (C.Uint32)(dst_format)
	_dst_pitch := (C.int)(dst_pitch)
	return (int)(C.SDL_ConvertPixels(_width, _height, _src_format, src, _src_pitch, _dst_format, dst, _dst_pitch))
}
Ejemplo n.º 3
0
func ConvertPixels(w, h int, sf uint32, src uintptr, sp int, df uint32, dst uintptr, dp int) error {
	en := C.SDL_ConvertPixels(
		C.int(w),
		C.int(h),
		C.Uint32(sf),
		unsafe.Pointer(src),
		C.int(sp),
		C.Uint32(df),
		unsafe.Pointer(dst),
		C.int(dp),
	)
	if en != 0 {
		return getError()
	}

	return nil
}
Ejemplo n.º 4
0
func ConvertPixels(width, height int, srcFormat uint32, src unsafe.Pointer, srcPitch int,
	dstFormat uint32, dst unsafe.Pointer, dstPitch int) int {
	return int(C.SDL_ConvertPixels(C.int(width), C.int(height), C.Uint32(srcFormat), src, C.int(srcPitch), C.Uint32(dstFormat), dst, C.int(dstPitch)))
}