Example #1
0
File: ovr.go Project: postfix/ovr
// The ovrHmd_GetLastError function has a bug, where it sends back an empty
// string when there is no error, instead of NULL. Work around that.
func (hmd *Hmd) GetLastError() *string {
	if str := C.ovrHmd_GetLastError(hmd.hmdRef); str != nil && C.strlen(str) != 0 {
		goStr := C.GoString(str)
		return &goStr
	}

	return nil
}
Example #2
0
File: ovr.go Project: krux02/libovr
// Returns last error for HMD state. Returns null for no error.
// String is valid until next call or GetLastError or HMD is destroyed.
// Pass null hmd to get global error (for create, etc).
func (this *Hmd) GetLastError() string {
	return C.GoString(C.ovrHmd_GetLastError(this.cptr()))
}