예제 #1
0
파일: ovr.go 프로젝트: krux02/libovr
func (hmd *Hmd) GetFloatArray2(propertyName string, values []float32) []float32 {
	_propertyName := C.CString(propertyName)
	defer C.free(unsafe.Pointer(_propertyName))
	arraySize := C.uint(cap(values))
	arrayPtr := (*C.float)(&values[0])
	size := C.ovrHmd_GetFloatArray(hmd.cptr(), _propertyName, arrayPtr, arraySize)
	return values[:size]
}
예제 #2
0
파일: ovr.go 프로젝트: krux02/libovr
// Get float[] property. Returns the number of elements filled in, 0 if property doesn't exist.
// Maximum of arraySize elements will be written.
func (hmd *Hmd) GetFloatArray(propertyName string) []float32 {
	_propertyName := C.CString(propertyName)
	defer C.free(unsafe.Pointer(_propertyName))
	arraySize := C.ovrHmd_GetArraySize(hmd.cptr(), _propertyName)
	values := make([]float32, arraySize)
	arrayPtr := (*C.float)(&values[0])
	C.ovrHmd_GetFloatArray(hmd.cptr(), _propertyName, arrayPtr, arraySize)
	return values
}
예제 #3
0
파일: ovr.go 프로젝트: postfix/ovr
func (hmd *Hmd) GetFloatArray(propertyName string, values []float32, arraySize uint) uint {
	_propertyName := C.CString(propertyName)
	defer C.free(unsafe.Pointer(_propertyName))
	_values := C.float(values[0])
	return uint(C.ovrHmd_GetFloatArray(hmd.hmdRef, _propertyName, &_values, C.uint(arraySize)))
}