예제 #1
0
파일: render.go 프로젝트: willemvds/sdl
func (r *Renderer) GetInfo() (*RendererInfo, error) {
	var ri RendererInfo
	if C.SDL_GetRendererInfo(r.c, ri.c()) != 0 {
		return nil, getError()
	}

	return &ri, nil
}
예제 #2
0
파일: render.go 프로젝트: JalfResi/go-sdl2
func (renderer *Renderer) GetRendererInfo(info *RendererInfo) int {
	var cinfo cRendererInfo
	ret := int(C.SDL_GetRendererInfo(renderer.cptr(), cinfo.cptr()))

	info.RendererInfoData = cinfo.RendererInfoData
	// No need to free, it's done by DestroyRenderer
	info.Name = C.GoString(cinfo.Name)

	return ret
}
예제 #3
0
func (renderer *Renderer) GetRendererInfo(info *RendererInfo) int {
	_renderer := (*C.SDL_Renderer)(unsafe.Pointer(renderer))
	_info := (*C.SDL_RendererInfo)(unsafe.Pointer(info))
	return (int)(C.SDL_GetRendererInfo(_renderer, _info))
}