Пример #1
0
func (this *Hmd) ConfigureRendering(apiConfig *RenderApiConfig, distortionCaps DistortionCaps, eyeFovIn [2]FovPort) (eyeRenderDescOut [2]EyeRenderDesc, ok bool) {
	//config := c_renderApiConfig(apiConfig)
	dc := C.uint(distortionCaps)
	efi := [2]C.ovrFovPort{
		c_fovPort(eyeFovIn[0]),
		c_fovPort(eyeFovIn[1]),
	}
	ok = 0 != C.ovrHmd_ConfigureRendering(this.cptr(), apiConfig.cptr(), dc, &efi[0], eyeRenderDescOut[0].cptr())
	return
}
Пример #2
0
Файл: ovr.go Проект: postfix/ovr
func (hmd *Hmd) ConfigureRendering(apiConfig *RenderAPIConfig, distortionCaps uint, eyeFovIn [2]FovPort) (*[2]EyeRenderDesc, error) {
	_apiConfig := C.ovrRenderAPIConfig(*apiConfig)
	_eyeFovIn := [2]C.ovrFovPort{eyeFovIn[0].toC(), eyeFovIn[1].toC()}
	eyeRenderDescOut := [2]C.ovrEyeRenderDesc{}

	if C.ovrHmd_ConfigureRendering(hmd.hmdRef, &_apiConfig, C.uint(distortionCaps), &_eyeFovIn[0], &eyeRenderDescOut[0]) == 0 {
		if lastError := hmd.GetLastError(); lastError != nil {
			return nil, errors.New(*lastError)
		}

		return nil, errors.New("An unknown error occured")
	}

	_eyeRenderDescOut := [2]EyeRenderDesc{
		newEyeRenderDesc(eyeRenderDescOut[0]),
		newEyeRenderDesc(eyeRenderDescOut[1]),
	}

	return &_eyeRenderDescOut, nil
}