Example #1
0
// Renderer (https://wiki.libsdl.org/SDL_RenderSetClipRect)
func (renderer *Renderer) SetClipRect(rect *Rect) error {
	_ret := C.SDL_RenderSetClipRect(renderer.cptr(), rect.cptr())
	if _ret < 0 {
		return GetError()
	}
	return nil
}
Example #2
0
func (renderer *Renderer) SetClipRect(rect *Rect) int {
	return int(C.SDL_RenderSetClipRect(renderer.cptr(), rect.cptr()))
}
Example #3
0
func (renderer *Renderer) SetClipRect(rect *Rect) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_rect := (*C.SDL_Rect)(unsafe.Pointer(rect))
	return (int)(C.SDL_RenderSetClipRect(_renderer, _rect))
}
Example #4
0
//Pushes a viewport to limit the drawing space to the given bounds within the current drawing space.
func SetClipRect(x, y, w, h int) {
	y *= -1
	r := sdl_Rect(x, y, w, h)
	C.SDL_RenderSetClipRect(renderer, &r)
}