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] }
// 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 }
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))) }