Пример #1
0
// Renderer (https://wiki.libsdl.org/SDL_RenderCopyEx)
func (renderer *Renderer) CopyEx(texture *Texture, src, dst *Rect, angle float64, center *Point, flip RendererFlip) error {
	_ret := C.SDL_RenderCopyEx(renderer.cptr(), texture.cptr(), src.cptr(), dst.cptr(), C.double(angle), center.cptr(), flip.c())
	if _ret < 0 {
		return GetError()
	}
	return nil
}
Пример #2
0
func (renderer *Renderer) CopyEx(texture *Texture, srcrect, dstrect *Rect, angle float64, center *Point, flip uint32) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_texture := (*C.SDL_Texture)(unsafe.Pointer(texture))
	_srcrect := (*C.SDL_Rect)(unsafe.Pointer(srcrect))
	_dstrect := (*C.SDL_Rect)(unsafe.Pointer(dstrect))
	_angle := (C.double)(angle)
	_center := (*C.SDL_Point)(unsafe.Pointer(center))
	_flip := (C.SDL_RendererFlip)(flip)
	return (int)(C.SDL_RenderCopyEx(_renderer, _texture, _srcrect, _dstrect, _angle, _center, _flip))
}
Пример #3
0
func (r *Renderer) CopyEx(t *Texture, sr *Rect, dr *Rect, a float64, c *Point, flip RendererFlip) error {
	en := C.SDL_RenderCopyEx(r.c,
		t.c,
		sr.c(),
		dr.c(),
		C.double(a),
		c.c(),
		flip.c(),
	)
	if en != 0 {
		return getError()
	}

	return nil
}
Пример #4
0
func (r *Renderer) CopyEx(t *Texture, src, dst *Rect, angle float64, center *Point, flip int) bool {
	ret := C.SDL_RenderCopyEx(r.cRenderer, t.cTexture,
		(*C.SDL_Rect)(cast(src)), (*C.SDL_Rect)(cast(dst)),
		C.double(angle), (*C.SDL_Point)(cast(center)), C.SDL_RendererFlip(flip))
	return int(ret) == 0
}
Пример #5
0
func (renderer *Renderer) CopyEx(texture *Texture, src, dst *Rect, angle float64, center *Point, flip RendererFlip) int {
	return int(C.SDL_RenderCopyEx(renderer.cptr(), texture.cptr(), src.cptr(), dst.cptr(), C.double(angle), center.cptr(), flip.c()))
}