Beispiel #1
0
func (src *Surface) BlitScaled(srcrect *Rect, dst *Surface, dstrect *Rect) int {
	_src := (*C.SDL_Surface)(unsafe.Pointer(src))
	_srcrect := (*C.SDL_Rect)(unsafe.Pointer(srcrect))
	_dst := (*C.SDL_Surface)(unsafe.Pointer(dst))
	_dstrect := (*C.SDL_Rect)(unsafe.Pointer(dstrect))
	return (int)(C.SDL_BlitScaled(_src, _srcrect, _dst, _dstrect))
}
Beispiel #2
0
// BlitScaled performs a scaled fast blit from the source surface to the
// destination surface.
//
// srcRect represents the rectangle to be copied or image.ZR to copy the entire
// surface.
//
// dstRect represents the rectangle to be copied into.
//
// If the srcRect and dstRect differs in size, the surface will be scaled to
// fit.
func (src *Surface) BlitScaled(srcRect image.Rectangle, dst *Surface, dstRect image.Rectangle) (err error) {
	cSrcRect := cRect(srcRect)
	cDstRect := cRect(dstRect)
	if C.SDL_BlitScaled(src.cSurface, cSrcRect, dst.cSurface, cDstRect) != 0 {
		return getError()
	}
	return nil
}
Beispiel #3
0
func (src *Surface) BlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) int {
	return int(C.SDL_BlitScaled(src.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()))
}
Beispiel #4
0
// Surface (https://wiki.libsdl.org/SDL_BlitScaled)
func (src *Surface) BlitScaled(srcRect *Rect, dst *Surface, dstRect *Rect) error {
	if C.SDL_BlitScaled(src.cptr(), srcRect.cptr(), dst.cptr(), dstRect.cptr()) != 0 {
		return GetError()
	}
	return nil
}