示例#1
0
文件: render.go 项目: emlai/go-sdl2
// Renderer (https://wiki.libsdl.org/SDL_RenderSetViewport)
func (renderer *Renderer) SetViewport(rect *Rect) error {
	_ret := C.SDL_RenderSetViewport(renderer.cptr(), rect.cptr())
	if _ret < 0 {
		return GetError()
	}
	return nil
}
示例#2
0
文件: render.go 项目: willemvds/sdl
func (r *Renderer) SetViewport(rect *Rect) error {
	if C.SDL_RenderSetViewport(r.c, rect.c()) != 0 {
		return getError()
	}

	return nil
}
示例#3
0
func (renderer *Renderer) SetViewport(rect *Rect) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_rect := (*C.SDL_Rect)(unsafe.Pointer(rect))
	return (int)(C.SDL_RenderSetViewport(_renderer, _rect))
}
示例#4
0
func (renderer *Renderer) SetViewport(rect *Rect) int {
	return int(C.SDL_RenderSetViewport(renderer.cptr(), rect.cptr()))
}