Beispiel #1
0
func (hmd *Hmd) GetString(propertyName, defaultVal string) string {
	_propertyName := C.CString(propertyName)
	defer C.free(unsafe.Pointer(_propertyName))
	_defaultVal := C.CString(defaultVal)
	defer C.free(unsafe.Pointer(_defaultVal))
	return C.GoString(C.ovrHmd_GetString(hmd.hmdRef, _propertyName, _defaultVal))
}
Beispiel #2
0
func (hmd *Hmd) GetString(propertyName string, defaultValue string) string {
	_propertyName := C.CString(propertyName)
	defer C.free(unsafe.Pointer(_propertyName))
	str := C.ovrHmd_GetString(hmd.cptr(), _propertyName, nil)
	if str == nil {
		return defaultValue
	} else {
		return C.GoString(str)
	}
}