text:
@mkCppConst EVREye
@mkCppConst ETextureType
@mkCppConst EColorSpace
@mkCppConst ETrackingResult
@mkCppConst ETrackedDeviceClass
@mkCppConst ETrackedControllerRole
@mkCppConst ETrackingUniverseOrigin
# @mkCppConst EAdditionalRadioFeatures
@mkCppConst ETrackedDeviceProperty
@mkCppConst ETrackedPropertyError
@mkCppConst EVRSubmitFlags
@mkCppConst EVRState
@mkCppConst EVREventType
@mkCppConst EDeviceActivityLevel
@mkCppConst EVRButtonId
@mkCppConst EVRMouseButton
@mkCppConst EDualAnalogWhich
@mkCppConst EShowUIType
@mkCppConst EVRInputError
@mkCppConst EVRSpatialAnchorError
@mkCppConst EHiddenAreaMeshType
@mkCppConst EVRControllerAxisType
@mkCppConst EVRControllerEventOutputType
@mkCppConst ECollisionBoundsStyle
@mkCppConst EVROverlayError
@mkCppConst EVRApplicationType
@mkCppConst EVRFirmwareError
@mkCppConst EVRNotificationError
@mkCppConst EVRSkeletalMotionRange
@mkCppConst EVRSkeletalTrackingLevel
@mkCppConst EVRInitError
@mkCppConst EVRScreenshotType
@mkCppConst EVRScreenshotPropertyFilenames
@mkCppConst EVRTrackedCameraError
@mkCppConst EVRTrackedCameraFrameLayout
@mkCppConst EVRTrackedCameraFrameType
@mkCppConst EVRDistortionFunctionType
@mkCppConst EVSync
@mkCppConst EVRMuraCorrectionMode
@mkCppConst Imu_OffScaleFlags
@mkCppConst EVRApplicationError
@mkCppConst EVRApplicationProperty
# @mkCppConst EVRApplicationTransitionState
@mkCppConst EVRSettingsError
@mkCppConst ChaperoneCalibrationState
@mkCppConst EChaperoneConfigFile
@mkCppConst EChaperoneImportFlags
@mkCppConst EVRCompositorError
@mkCppConst EVRCompositorTimingMode
@mkCppConst EVRNotificationType
@mkCppConst EVRNotificationStyle
@mkCppConst VROverlayInputMethod
@mkCppConst VROverlayTransformType
@mkCppConst VROverlayFlags
@mkCppConst VRMessageOverlayResponse
@mkCppConst EGamepadTextInputMode
@mkCppConst EGamepadTextInputLineMode
# @mkCppConst EOverlayDirection
@mkCppConst EVROverlayIntersectionMaskPrimitiveType
@mkCppConst EVRRenderModelError
@mkCppConst EVRComponentProperty
@mkCppConst EVRScreenshotError
@mkCppConst EVRSkeletalTransformSpace
@mkCppConst EVRSkeletalReferencePose
@mkCppConst EVRFinger
@mkCppConst EVRFingerSplay
@mkCppConst EVRInputFilterCancelType
@mkCppConst EVRInputStringBits
@mkCppConst EIOBufferError
@mkCppConst EIOBufferMode

@mkCppConst Eye_Left
@mkCppConst Eye_Right
@mkCppConst TextureType_Invalid
@mkCppConst TextureType_DirectX
@mkCppConst TextureType_OpenGL
@mkCppConst TextureType_Vulkan
@mkCppConst TextureType_IOSurface
@mkCppConst TextureType_DirectX12
@mkCppConst TextureType_DXGISharedHandle
@mkCppConst TextureType_Metal
@mkCppConst ColorSpace_Auto
@mkCppConst ColorSpace_Gamma
@mkCppConst ColorSpace_Linear
@mkCppConst TrackingResult_Uninitialized
@mkCppConst TrackingResult_Calibrating_InProgress
@mkCppConst TrackingResult_Calibrating_OutOfRange
@mkCppConst TrackingResult_Running_OK
@mkCppConst TrackingResult_Running_OutOfRange
@mkCppConst TrackingResult_Fallback_RotationOnly
@mkCppConst TrackedDeviceClass_Invalid
@mkCppConst TrackedDeviceClass_HMD
@mkCppConst TrackedDeviceClass_Controller
@mkCppConst TrackedDeviceClass_GenericTracker
@mkCppConst TrackedDeviceClass_TrackingReference
@mkCppConst TrackedDeviceClass_DisplayRedirect
@mkCppConst TrackedDeviceClass_Max
@mkCppConst TrackedControllerRole_Invalid
@mkCppConst TrackedControllerRole_LeftHand
@mkCppConst TrackedControllerRole_RightHand
@mkCppConst TrackedControllerRole_OptOut
@mkCppConst TrackedControllerRole_Treadmill
@mkCppConst TrackedControllerRole_Max
@mkCppConst TrackingUniverseSeated
@mkCppConst TrackingUniverseStanding
@mkCppConst TrackingUniverseRawAndUncalibrated
# @mkCppConst AdditionalRadioFeatures_None
# @mkCppConst AdditionalRadioFeatures_HTCLinkBox
# @mkCppConst AdditionalRadioFeatures_InternalDongle
# @mkCppConst AdditionalRadioFeatures_ExternalDongle
@mkCppConst Prop_Invalid
@mkCppConst Prop_TrackingSystemName_String
@mkCppConst Prop_ModelNumber_String
@mkCppConst Prop_SerialNumber_String
@mkCppConst Prop_RenderModelName_String
@mkCppConst Prop_WillDriftInYaw_Bool
@mkCppConst Prop_ManufacturerName_String
@mkCppConst Prop_TrackingFirmwareVersion_String
@mkCppConst Prop_HardwareRevision_String
@mkCppConst Prop_AllWirelessDongleDescriptions_String
@mkCppConst Prop_ConnectedWirelessDongle_String
@mkCppConst Prop_DeviceIsWireless_Bool
@mkCppConst Prop_DeviceIsCharging_Bool
@mkCppConst Prop_DeviceBatteryPercentage_Float
@mkCppConst Prop_StatusDisplayTransform_Matrix34
@mkCppConst Prop_Firmware_UpdateAvailable_Bool
@mkCppConst Prop_Firmware_ManualUpdate_Bool
@mkCppConst Prop_Firmware_ManualUpdateURL_String
@mkCppConst Prop_HardwareRevision_Uint64
@mkCppConst Prop_FirmwareVersion_Uint64
@mkCppConst Prop_FPGAVersion_Uint64
@mkCppConst Prop_VRCVersion_Uint64
@mkCppConst Prop_RadioVersion_Uint64
@mkCppConst Prop_DongleVersion_Uint64
@mkCppConst Prop_BlockServerShutdown_Bool
@mkCppConst Prop_CanUnifyCoordinateSystemWithHmd_Bool
@mkCppConst Prop_ContainsProximitySensor_Bool
@mkCppConst Prop_DeviceProvidesBatteryStatus_Bool
@mkCppConst Prop_DeviceCanPowerOff_Bool
@mkCppConst Prop_Firmware_ProgrammingTarget_String
@mkCppConst Prop_DeviceClass_Int32
@mkCppConst Prop_HasCamera_Bool
@mkCppConst Prop_DriverVersion_String
@mkCppConst Prop_Firmware_ForceUpdateRequired_Bool
@mkCppConst Prop_ViveSystemButtonFixRequired_Bool
@mkCppConst Prop_ParentDriver_Uint64
@mkCppConst Prop_ResourceRoot_String
@mkCppConst Prop_RegisteredDeviceType_String
@mkCppConst Prop_InputProfilePath_String
@mkCppConst Prop_NeverTracked_Bool
@mkCppConst Prop_NumCameras_Int32
@mkCppConst Prop_CameraFrameLayout_Int32
@mkCppConst Prop_CameraStreamFormat_Int32
@mkCppConst Prop_AdditionalDeviceSettingsPath_String
@mkCppConst Prop_Identifiable_Bool
# @mkCppConst Prop_BootloaderVersion_Uint64
@mkCppConst Prop_ReportsTimeSinceVSync_Bool
@mkCppConst Prop_SecondsFromVsyncToPhotons_Float
@mkCppConst Prop_DisplayFrequency_Float
@mkCppConst Prop_UserIpdMeters_Float
@mkCppConst Prop_CurrentUniverseId_Uint64
@mkCppConst Prop_PreviousUniverseId_Uint64
@mkCppConst Prop_DisplayFirmwareVersion_Uint64
@mkCppConst Prop_IsOnDesktop_Bool
@mkCppConst Prop_DisplayMCType_Int32
@mkCppConst Prop_DisplayMCOffset_Float
@mkCppConst Prop_DisplayMCScale_Float
@mkCppConst Prop_EdidVendorID_Int32
@mkCppConst Prop_DisplayMCImageLeft_String
@mkCppConst Prop_DisplayMCImageRight_String
@mkCppConst Prop_DisplayGCBlackClamp_Float
@mkCppConst Prop_EdidProductID_Int32
@mkCppConst Prop_CameraToHeadTransform_Matrix34
@mkCppConst Prop_DisplayGCType_Int32
@mkCppConst Prop_DisplayGCOffset_Float
@mkCppConst Prop_DisplayGCScale_Float
@mkCppConst Prop_DisplayGCPrescale_Float
@mkCppConst Prop_DisplayGCImage_String
@mkCppConst Prop_LensCenterLeftU_Float
@mkCppConst Prop_LensCenterLeftV_Float
@mkCppConst Prop_LensCenterRightU_Float
@mkCppConst Prop_LensCenterRightV_Float
@mkCppConst Prop_UserHeadToEyeDepthMeters_Float
@mkCppConst Prop_CameraFirmwareVersion_Uint64
@mkCppConst Prop_CameraFirmwareDescription_String
@mkCppConst Prop_DisplayFPGAVersion_Uint64
@mkCppConst Prop_DisplayBootloaderVersion_Uint64
@mkCppConst Prop_DisplayHardwareVersion_Uint64
@mkCppConst Prop_AudioFirmwareVersion_Uint64
@mkCppConst Prop_CameraCompatibilityMode_Int32
@mkCppConst Prop_ScreenshotHorizontalFieldOfViewDegrees_Float
@mkCppConst Prop_ScreenshotVerticalFieldOfViewDegrees_Float
@mkCppConst Prop_DisplaySuppressed_Bool
@mkCppConst Prop_DisplayAllowNightMode_Bool
@mkCppConst Prop_DisplayMCImageWidth_Int32
@mkCppConst Prop_DisplayMCImageHeight_Int32
@mkCppConst Prop_DisplayMCImageNumChannels_Int32
@mkCppConst Prop_DisplayMCImageData_Binary
@mkCppConst Prop_SecondsFromPhotonsToVblank_Float
@mkCppConst Prop_DriverDirectModeSendsVsyncEvents_Bool
@mkCppConst Prop_DisplayDebugMode_Bool
@mkCppConst Prop_GraphicsAdapterLuid_Uint64
@mkCppConst Prop_DriverProvidedChaperonePath_String
@mkCppConst Prop_ExpectedTrackingReferenceCount_Int32
@mkCppConst Prop_ExpectedControllerCount_Int32
@mkCppConst Prop_NamedIconPathControllerLeftDeviceOff_String
@mkCppConst Prop_NamedIconPathControllerRightDeviceOff_String
@mkCppConst Prop_NamedIconPathTrackingReferenceDeviceOff_String
@mkCppConst Prop_DoNotApplyPrediction_Bool
@mkCppConst Prop_CameraToHeadTransforms_Matrix34_Array
@mkCppConst Prop_DistortionMeshResolution_Int32
@mkCppConst Prop_DriverIsDrawingControllers_Bool
@mkCppConst Prop_DriverRequestsApplicationPause_Bool
@mkCppConst Prop_DriverRequestsReducedRendering_Bool
@mkCppConst Prop_MinimumIpdStepMeters_Float
@mkCppConst Prop_AudioBridgeFirmwareVersion_Uint64
@mkCppConst Prop_ImageBridgeFirmwareVersion_Uint64
@mkCppConst Prop_ImuToHeadTransform_Matrix34
@mkCppConst Prop_ImuFactoryGyroBias_Vector3
@mkCppConst Prop_ImuFactoryGyroScale_Vector3
@mkCppConst Prop_ImuFactoryAccelerometerBias_Vector3
@mkCppConst Prop_ImuFactoryAccelerometerScale_Vector3
@mkCppConst Prop_ConfigurationIncludesLighthouse20Features_Bool
# @mkCppConst Prop_AdditionalRadioFeatures_Uint64
# @mkCppConst Prop_CameraWhiteBalance_Vector4_Array
# @mkCppConst Prop_CameraDistortionFunction_Int32_Array
# @mkCppConst Prop_CameraDistortionCoefficients_Float_Array
# @mkCppConst Prop_ExpectedControllerType_String
@mkCppConst Prop_DriverRequestedMuraCorrectionMode_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_InnerLeft_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_InnerRight_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_InnerTop_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_InnerBottom_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_OuterLeft_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_OuterRight_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_OuterTop_Int32
@mkCppConst Prop_DriverRequestedMuraFeather_OuterBottom_Int32
@mkCppConst Prop_AttachedDeviceId_String
@mkCppConst Prop_SupportedButtons_Uint64
@mkCppConst Prop_Axis0Type_Int32
@mkCppConst Prop_Axis1Type_Int32
@mkCppConst Prop_Axis2Type_Int32
@mkCppConst Prop_Axis3Type_Int32
@mkCppConst Prop_Axis4Type_Int32
@mkCppConst Prop_ControllerRoleHint_Int32
@mkCppConst Prop_FieldOfViewLeftDegrees_Float
@mkCppConst Prop_FieldOfViewRightDegrees_Float
@mkCppConst Prop_FieldOfViewTopDegrees_Float
@mkCppConst Prop_FieldOfViewBottomDegrees_Float
@mkCppConst Prop_TrackingRangeMinimumMeters_Float
@mkCppConst Prop_TrackingRangeMaximumMeters_Float
@mkCppConst Prop_ModeLabel_String
@mkCppConst Prop_IconPathName_String
@mkCppConst Prop_NamedIconPathDeviceOff_String
@mkCppConst Prop_NamedIconPathDeviceSearching_String
@mkCppConst Prop_NamedIconPathDeviceSearchingAlert_String
@mkCppConst Prop_NamedIconPathDeviceReady_String
@mkCppConst Prop_NamedIconPathDeviceReadyAlert_String
@mkCppConst Prop_NamedIconPathDeviceNotReady_String
@mkCppConst Prop_NamedIconPathDeviceStandby_String
@mkCppConst Prop_NamedIconPathDeviceAlertLow_String
@mkCppConst Prop_DisplayHiddenArea_Binary_Start
@mkCppConst Prop_DisplayHiddenArea_Binary_End
@mkCppConst Prop_ParentContainer
@mkCppConst Prop_UserConfigPath_String
@mkCppConst Prop_InstallPath_String
@mkCppConst Prop_HasDisplayComponent_Bool
@mkCppConst Prop_HasControllerComponent_Bool
@mkCppConst Prop_HasCameraComponent_Bool
@mkCppConst Prop_HasDriverDirectModeComponent_Bool
@mkCppConst Prop_HasVirtualDisplayComponent_Bool
@mkCppConst Prop_HasSpatialAnchorsSupport_Bool
@mkCppConst Prop_ControllerType_String
# @mkCppConst Prop_LegacyInputProfile_String
@mkCppConst Prop_ControllerHandSelectionPriority_Int32
@mkCppConst Prop_VendorSpecific_Reserved_Start
@mkCppConst Prop_VendorSpecific_Reserved_End
@mkCppConst Prop_TrackedDeviceProperty_Max
@mkCppConst TrackedProp_Success
@mkCppConst TrackedProp_WrongDataType
@mkCppConst TrackedProp_WrongDeviceClass
@mkCppConst TrackedProp_BufferTooSmall
@mkCppConst TrackedProp_UnknownProperty
@mkCppConst TrackedProp_InvalidDevice
@mkCppConst TrackedProp_CouldNotContactServer
@mkCppConst TrackedProp_ValueNotProvidedByDevice
@mkCppConst TrackedProp_StringExceedsMaximumLength
@mkCppConst TrackedProp_NotYetAvailable
@mkCppConst TrackedProp_PermissionDenied
@mkCppConst TrackedProp_InvalidOperation
@mkCppConst TrackedProp_CannotWriteToWildcards
@mkCppConst TrackedProp_IPCReadFailure
@mkCppConst Submit_Default
@mkCppConst Submit_LensDistortionAlreadyApplied
@mkCppConst Submit_GlRenderBuffer
@mkCppConst Submit_Reserved
@mkCppConst Submit_TextureWithPose
@mkCppConst Submit_TextureWithDepth
@mkCppConst VRState_Undefined
@mkCppConst VRState_Off
@mkCppConst VRState_Searching
@mkCppConst VRState_Searching_Alert
@mkCppConst VRState_Ready
@mkCppConst VRState_Ready_Alert
@mkCppConst VRState_NotReady
@mkCppConst VRState_Standby
@mkCppConst VRState_Ready_Alert_Low
@mkCppConst VREvent_None
@mkCppConst VREvent_TrackedDeviceActivated
@mkCppConst VREvent_TrackedDeviceDeactivated
@mkCppConst VREvent_TrackedDeviceUpdated
@mkCppConst VREvent_TrackedDeviceUserInteractionStarted
@mkCppConst VREvent_TrackedDeviceUserInteractionEnded
@mkCppConst VREvent_IpdChanged
@mkCppConst VREvent_EnterStandbyMode
@mkCppConst VREvent_LeaveStandbyMode
@mkCppConst VREvent_TrackedDeviceRoleChanged
@mkCppConst VREvent_WatchdogWakeUpRequested
@mkCppConst VREvent_LensDistortionChanged
@mkCppConst VREvent_PropertyChanged
@mkCppConst VREvent_WirelessDisconnect
@mkCppConst VREvent_WirelessReconnect
@mkCppConst VREvent_ButtonPress
@mkCppConst VREvent_ButtonUnpress
@mkCppConst VREvent_ButtonTouch
@mkCppConst VREvent_ButtonUntouch
@mkCppConst VREvent_DualAnalog_Press
@mkCppConst VREvent_DualAnalog_Unpress
@mkCppConst VREvent_DualAnalog_Touch
@mkCppConst VREvent_DualAnalog_Untouch
@mkCppConst VREvent_DualAnalog_Move
@mkCppConst VREvent_DualAnalog_ModeSwitch1
@mkCppConst VREvent_DualAnalog_ModeSwitch2
@mkCppConst VREvent_DualAnalog_Cancel
@mkCppConst VREvent_MouseMove
@mkCppConst VREvent_MouseButtonDown
@mkCppConst VREvent_MouseButtonUp
@mkCppConst VREvent_FocusEnter
@mkCppConst VREvent_FocusLeave
# @mkCppConst VREvent_ScrollDiscrete
@mkCppConst VREvent_TouchPadMove
@mkCppConst VREvent_OverlayFocusChanged
@mkCppConst VREvent_ReloadOverlays
# @mkCppConst VREvent_ScrollSmooth
@mkCppConst VREvent_InputFocusCaptured
@mkCppConst VREvent_InputFocusReleased
# @mkCppConst VREvent_SceneFocusLost
# @mkCppConst VREvent_SceneFocusGained
# @mkCppConst VREvent_SceneApplicationChanged
@mkCppConst VREvent_SceneFocusChanged
@mkCppConst VREvent_InputFocusChanged
# @mkCppConst VREvent_SceneApplicationSecondaryRenderingStarted
@mkCppConst VREvent_SceneApplicationUsingWrongGraphicsAdapter
@mkCppConst VREvent_ActionBindingReloaded
@mkCppConst VREvent_HideRenderModels
@mkCppConst VREvent_ShowRenderModels
@mkCppConst VREvent_ConsoleOpened
@mkCppConst VREvent_ConsoleClosed
@mkCppConst VREvent_OverlayShown
@mkCppConst VREvent_OverlayHidden
@mkCppConst VREvent_DashboardActivated
@mkCppConst VREvent_DashboardDeactivated
# @mkCppConst VREvent_DashboardThumbSelected
@mkCppConst VREvent_DashboardRequested
@mkCppConst VREvent_ResetDashboard
@mkCppConst VREvent_RenderToast
@mkCppConst VREvent_ImageLoaded
@mkCppConst VREvent_ShowKeyboard
@mkCppConst VREvent_HideKeyboard
@mkCppConst VREvent_OverlayGamepadFocusGained
@mkCppConst VREvent_OverlayGamepadFocusLost
@mkCppConst VREvent_OverlaySharedTextureChanged
@mkCppConst VREvent_ScreenshotTriggered
@mkCppConst VREvent_ImageFailed
@mkCppConst VREvent_DashboardOverlayCreated
@mkCppConst VREvent_SwitchGamepadFocus
@mkCppConst VREvent_RequestScreenshot
@mkCppConst VREvent_ScreenshotTaken
@mkCppConst VREvent_ScreenshotFailed
@mkCppConst VREvent_SubmitScreenshotToDashboard
@mkCppConst VREvent_ScreenshotProgressToDashboard
@mkCppConst VREvent_PrimaryDashboardDeviceChanged
@mkCppConst VREvent_RoomViewShown
@mkCppConst VREvent_RoomViewHidden
@mkCppConst VREvent_ShowUI
@mkCppConst VREvent_Notification_Shown
@mkCppConst VREvent_Notification_Hidden
@mkCppConst VREvent_Notification_BeginInteraction
@mkCppConst VREvent_Notification_Destroyed
@mkCppConst VREvent_Quit
@mkCppConst VREvent_ProcessQuit
# @mkCppConst VREvent_QuitAborted_UserPrompt
@mkCppConst VREvent_QuitAcknowledged
@mkCppConst VREvent_DriverRequestedQuit
@mkCppConst VREvent_ChaperoneDataHasChanged
@mkCppConst VREvent_ChaperoneUniverseHasChanged
@mkCppConst VREvent_ChaperoneTempDataHasChanged
@mkCppConst VREvent_ChaperoneSettingsHaveChanged
@mkCppConst VREvent_SeatedZeroPoseReset
@mkCppConst VREvent_ChaperoneFlushCache
@mkCppConst VREvent_AudioSettingsHaveChanged
@mkCppConst VREvent_BackgroundSettingHasChanged
@mkCppConst VREvent_CameraSettingsHaveChanged
@mkCppConst VREvent_ReprojectionSettingHasChanged
@mkCppConst VREvent_ModelSkinSettingsHaveChanged
@mkCppConst VREvent_EnvironmentSettingsHaveChanged
@mkCppConst VREvent_PowerSettingsHaveChanged
@mkCppConst VREvent_EnableHomeAppSettingsHaveChanged
@mkCppConst VREvent_SteamVRSectionSettingChanged
@mkCppConst VREvent_LighthouseSectionSettingChanged
@mkCppConst VREvent_NullSectionSettingChanged
@mkCppConst VREvent_UserInterfaceSectionSettingChanged
@mkCppConst VREvent_NotificationsSectionSettingChanged
@mkCppConst VREvent_KeyboardSectionSettingChanged
@mkCppConst VREvent_PerfSectionSettingChanged
@mkCppConst VREvent_DashboardSectionSettingChanged
@mkCppConst VREvent_WebInterfaceSectionSettingChanged
@mkCppConst VREvent_TrackersSectionSettingChanged
@mkCppConst VREvent_LastKnownSectionSettingChanged
# @mkCppConst VREvent_DismissedWarningsSectionSettingChanged
@mkCppConst VREvent_StatusUpdate
@mkCppConst VREvent_WebInterface_InstallDriverCompleted
@mkCppConst VREvent_MCImageUpdated
@mkCppConst VREvent_FirmwareUpdateStarted
@mkCppConst VREvent_FirmwareUpdateFinished
@mkCppConst VREvent_KeyboardClosed
@mkCppConst VREvent_KeyboardCharInput
@mkCppConst VREvent_KeyboardDone
# @mkCppConst VREvent_ApplicationTransitionStarted
# @mkCppConst VREvent_ApplicationTransitionAborted
# @mkCppConst VREvent_ApplicationTransitionNewAppStarted
@mkCppConst VREvent_ApplicationListUpdated
@mkCppConst VREvent_ApplicationMimeTypeLoad
# @mkCppConst VREvent_ApplicationTransitionNewAppLaunchComplete
@mkCppConst VREvent_ProcessConnected
@mkCppConst VREvent_ProcessDisconnected
# @mkCppConst VREvent_Compositor_MirrorWindowShown
# @mkCppConst VREvent_Compositor_MirrorWindowHidden
@mkCppConst VREvent_Compositor_ChaperoneBoundsShown
@mkCppConst VREvent_Compositor_ChaperoneBoundsHidden
@mkCppConst VREvent_TrackedCamera_StartVideoStream
@mkCppConst VREvent_TrackedCamera_StopVideoStream
@mkCppConst VREvent_TrackedCamera_PauseVideoStream
@mkCppConst VREvent_TrackedCamera_ResumeVideoStream
@mkCppConst VREvent_TrackedCamera_EditingSurface
@mkCppConst VREvent_PerformanceTest_EnableCapture
@mkCppConst VREvent_PerformanceTest_DisableCapture
@mkCppConst VREvent_PerformanceTest_FidelityLevel
@mkCppConst VREvent_MessageOverlay_Closed
@mkCppConst VREvent_MessageOverlayCloseRequested
@mkCppConst VREvent_Input_HapticVibration
@mkCppConst VREvent_Input_BindingLoadFailed
@mkCppConst VREvent_Input_BindingLoadSuccessful
@mkCppConst VREvent_Input_ActionManifestReloaded
@mkCppConst VREvent_Input_ActionManifestLoadFailed
@mkCppConst VREvent_Input_ProgressUpdate
@mkCppConst VREvent_Input_TrackerActivated
# @mkCppConst VREvent_Input_BindingsUpdated
@mkCppConst VREvent_SpatialAnchors_PoseUpdated
@mkCppConst VREvent_SpatialAnchors_DescriptorUpdated
@mkCppConst VREvent_SpatialAnchors_RequestPoseUpdate
@mkCppConst VREvent_SpatialAnchors_RequestDescriptorUpdate
@mkCppConst VREvent_VendorSpecific_Reserved_Start
@mkCppConst VREvent_VendorSpecific_Reserved_End
@mkCppConst k_EDeviceActivityLevel_Unknown
@mkCppConst k_EDeviceActivityLevel_Idle
@mkCppConst k_EDeviceActivityLevel_UserInteraction
@mkCppConst k_EDeviceActivityLevel_UserInteraction_Timeout
@mkCppConst k_EDeviceActivityLevel_Standby
@mkCppConst k_EButton_System
@mkCppConst k_EButton_ApplicationMenu
@mkCppConst k_EButton_Grip
@mkCppConst k_EButton_DPad_Left
@mkCppConst k_EButton_DPad_Up
@mkCppConst k_EButton_DPad_Right
@mkCppConst k_EButton_DPad_Down
@mkCppConst k_EButton_A
@mkCppConst k_EButton_ProximitySensor
@mkCppConst k_EButton_Axis0
@mkCppConst k_EButton_Axis1
@mkCppConst k_EButton_Axis2
@mkCppConst k_EButton_Axis3
@mkCppConst k_EButton_Axis4
@mkCppConst k_EButton_SteamVR_Touchpad
@mkCppConst k_EButton_SteamVR_Trigger
@mkCppConst k_EButton_Dashboard_Back
# @mkCppConst k_EButton_Knuckles_A
# @mkCppConst k_EButton_Knuckles_B
# @mkCppConst k_EButton_Knuckles_JoyStick
@mkCppConst k_EButton_Max
@mkCppConst VRMouseButton_Left
@mkCppConst VRMouseButton_Right
@mkCppConst VRMouseButton_Middle
@mkCppConst k_EDualAnalog_Left
@mkCppConst k_EDualAnalog_Right
@mkCppConst ShowUI_ControllerBinding
@mkCppConst ShowUI_ManageTrackers
# @mkCppConst ShowUI_QuickStart
# @mkCppConst ShowUI_Pairing
@mkCppConst VRInputError_None
@mkCppConst VRInputError_NameNotFound
@mkCppConst VRInputError_WrongType
@mkCppConst VRInputError_InvalidHandle
@mkCppConst VRInputError_InvalidParam
@mkCppConst VRInputError_NoSteam
@mkCppConst VRInputError_MaxCapacityReached
@mkCppConst VRInputError_IPCError
@mkCppConst VRInputError_NoActiveActionSet
@mkCppConst VRInputError_InvalidDevice
@mkCppConst VRInputError_InvalidSkeleton
@mkCppConst VRInputError_InvalidBoneCount
@mkCppConst VRInputError_InvalidCompressedData
@mkCppConst VRInputError_NoData
@mkCppConst VRInputError_BufferTooSmall
@mkCppConst VRInputError_MismatchedActionManifest
@mkCppConst VRInputError_MissingSkeletonData
@mkCppConst VRInputError_InvalidBoneIndex
@mkCppConst VRSpatialAnchorError_Success
@mkCppConst VRSpatialAnchorError_Internal
@mkCppConst VRSpatialAnchorError_UnknownHandle
@mkCppConst VRSpatialAnchorError_ArrayTooSmall
@mkCppConst VRSpatialAnchorError_InvalidDescriptorChar
@mkCppConst VRSpatialAnchorError_NotYetAvailable
@mkCppConst VRSpatialAnchorError_NotAvailableInThisUniverse
@mkCppConst VRSpatialAnchorError_PermanentlyUnavailable
@mkCppConst VRSpatialAnchorError_WrongDriver
@mkCppConst VRSpatialAnchorError_DescriptorTooLong
@mkCppConst VRSpatialAnchorError_Unknown
@mkCppConst VRSpatialAnchorError_NoRoomCalibration
@mkCppConst VRSpatialAnchorError_InvalidArgument
@mkCppConst VRSpatialAnchorError_UnknownDriver
@mkCppConst k_eHiddenAreaMesh_Standard
@mkCppConst k_eHiddenAreaMesh_Inverse
@mkCppConst k_eHiddenAreaMesh_LineLoop
@mkCppConst k_eHiddenAreaMesh_Max
@mkCppConst k_eControllerAxis_None
@mkCppConst k_eControllerAxis_TrackPad
@mkCppConst k_eControllerAxis_Joystick
@mkCppConst k_eControllerAxis_Trigger
@mkCppConst ControllerEventOutput_OSEvents
@mkCppConst ControllerEventOutput_VREvents
@mkCppConst COLLISION_BOUNDS_STYLE_BEGINNER
@mkCppConst COLLISION_BOUNDS_STYLE_INTERMEDIATE
@mkCppConst COLLISION_BOUNDS_STYLE_SQUARES
@mkCppConst COLLISION_BOUNDS_STYLE_ADVANCED
@mkCppConst COLLISION_BOUNDS_STYLE_NONE
@mkCppConst COLLISION_BOUNDS_STYLE_COUNT
@mkCppConst VROverlayError_None
@mkCppConst VROverlayError_UnknownOverlay
@mkCppConst VROverlayError_InvalidHandle
@mkCppConst VROverlayError_PermissionDenied
@mkCppConst VROverlayError_OverlayLimitExceeded
@mkCppConst VROverlayError_WrongVisibilityType
@mkCppConst VROverlayError_KeyTooLong
@mkCppConst VROverlayError_NameTooLong
@mkCppConst VROverlayError_KeyInUse
@mkCppConst VROverlayError_WrongTransformType
@mkCppConst VROverlayError_InvalidTrackedDevice
@mkCppConst VROverlayError_InvalidParameter
@mkCppConst VROverlayError_ThumbnailCantBeDestroyed
@mkCppConst VROverlayError_ArrayTooSmall
@mkCppConst VROverlayError_RequestFailed
@mkCppConst VROverlayError_InvalidTexture
@mkCppConst VROverlayError_UnableToLoadFile
@mkCppConst VROverlayError_KeyboardAlreadyInUse
@mkCppConst VROverlayError_NoNeighbor
@mkCppConst VROverlayError_TooManyMaskPrimitives
@mkCppConst VROverlayError_BadMaskPrimitive
@mkCppConst VROverlayError_TextureAlreadyLocked
@mkCppConst VROverlayError_TextureLockCapacityReached
@mkCppConst VROverlayError_TextureNotLocked
@mkCppConst VRApplication_Other
@mkCppConst VRApplication_Scene
@mkCppConst VRApplication_Overlay
@mkCppConst VRApplication_Background
@mkCppConst VRApplication_Utility
@mkCppConst VRApplication_VRMonitor
@mkCppConst VRApplication_SteamWatchdog
@mkCppConst VRApplication_Bootstrapper
@mkCppConst VRApplication_WebHelper
@mkCppConst VRApplication_Max
@mkCppConst VRFirmwareError_None
@mkCppConst VRFirmwareError_Success
@mkCppConst VRFirmwareError_Fail
@mkCppConst VRNotificationError_OK
@mkCppConst VRNotificationError_InvalidNotificationId
@mkCppConst VRNotificationError_NotificationQueueFull
@mkCppConst VRNotificationError_InvalidOverlayHandle
@mkCppConst VRNotificationError_SystemWithUserValueAlreadyExists
@mkCppConst VRSkeletalMotionRange_WithController
@mkCppConst VRSkeletalMotionRange_WithoutController
@mkCppConst VRSkeletalTracking_Estimated
@mkCppConst VRSkeletalTracking_Partial
@mkCppConst VRSkeletalTracking_Full
@mkCppConst VRSkeletalTrackingLevel_Count
@mkCppConst VRSkeletalTrackingLevel_Max
@mkCppConst VRInitError_None
@mkCppConst VRInitError_Unknown
@mkCppConst VRInitError_Init_InstallationNotFound
@mkCppConst VRInitError_Init_InstallationCorrupt
@mkCppConst VRInitError_Init_VRClientDLLNotFound
@mkCppConst VRInitError_Init_FileNotFound
@mkCppConst VRInitError_Init_FactoryNotFound
@mkCppConst VRInitError_Init_InterfaceNotFound
@mkCppConst VRInitError_Init_InvalidInterface
@mkCppConst VRInitError_Init_UserConfigDirectoryInvalid
@mkCppConst VRInitError_Init_HmdNotFound
@mkCppConst VRInitError_Init_NotInitialized
@mkCppConst VRInitError_Init_PathRegistryNotFound
@mkCppConst VRInitError_Init_NoConfigPath
@mkCppConst VRInitError_Init_NoLogPath
@mkCppConst VRInitError_Init_PathRegistryNotWritable
@mkCppConst VRInitError_Init_AppInfoInitFailed
@mkCppConst VRInitError_Init_Retry
@mkCppConst VRInitError_Init_InitCanceledByUser
@mkCppConst VRInitError_Init_AnotherAppLaunching
@mkCppConst VRInitError_Init_SettingsInitFailed
@mkCppConst VRInitError_Init_ShuttingDown
@mkCppConst VRInitError_Init_TooManyObjects
@mkCppConst VRInitError_Init_NoServerForBackgroundApp
@mkCppConst VRInitError_Init_NotSupportedWithCompositor
@mkCppConst VRInitError_Init_NotAvailableToUtilityApps
@mkCppConst VRInitError_Init_Internal
@mkCppConst VRInitError_Init_HmdDriverIdIsNone
@mkCppConst VRInitError_Init_HmdNotFoundPresenceFailed
@mkCppConst VRInitError_Init_VRMonitorNotFound
@mkCppConst VRInitError_Init_VRMonitorStartupFailed
@mkCppConst VRInitError_Init_LowPowerWatchdogNotSupported
@mkCppConst VRInitError_Init_InvalidApplicationType
@mkCppConst VRInitError_Init_NotAvailableToWatchdogApps
@mkCppConst VRInitError_Init_WatchdogDisabledInSettings
@mkCppConst VRInitError_Init_VRDashboardNotFound
@mkCppConst VRInitError_Init_VRDashboardStartupFailed
@mkCppConst VRInitError_Init_VRHomeNotFound
@mkCppConst VRInitError_Init_VRHomeStartupFailed
@mkCppConst VRInitError_Init_RebootingBusy
@mkCppConst VRInitError_Init_FirmwareUpdateBusy
@mkCppConst VRInitError_Init_FirmwareRecoveryBusy
@mkCppConst VRInitError_Init_USBServiceBusy
@mkCppConst VRInitError_Init_VRWebHelperStartupFailed
@mkCppConst VRInitError_Init_TrackerManagerInitFailed
@mkCppConst VRInitError_Driver_Failed
@mkCppConst VRInitError_Driver_Unknown
@mkCppConst VRInitError_Driver_HmdUnknown
@mkCppConst VRInitError_Driver_NotLoaded
@mkCppConst VRInitError_Driver_RuntimeOutOfDate
@mkCppConst VRInitError_Driver_HmdInUse
@mkCppConst VRInitError_Driver_NotCalibrated
@mkCppConst VRInitError_Driver_CalibrationInvalid
@mkCppConst VRInitError_Driver_HmdDisplayNotFound
@mkCppConst VRInitError_Driver_TrackedDeviceInterfaceUnknown
@mkCppConst VRInitError_Driver_HmdDriverIdOutOfBounds
@mkCppConst VRInitError_Driver_HmdDisplayMirrored
@mkCppConst VRInitError_IPC_ServerInitFailed
@mkCppConst VRInitError_IPC_ConnectFailed
@mkCppConst VRInitError_IPC_SharedStateInitFailed
@mkCppConst VRInitError_IPC_CompositorInitFailed
@mkCppConst VRInitError_IPC_MutexInitFailed
@mkCppConst VRInitError_IPC_Failed
@mkCppConst VRInitError_IPC_CompositorConnectFailed
@mkCppConst VRInitError_IPC_CompositorInvalidConnectResponse
@mkCppConst VRInitError_IPC_ConnectFailedAfterMultipleAttempts
@mkCppConst VRInitError_Compositor_Failed
@mkCppConst VRInitError_Compositor_D3D11HardwareRequired
@mkCppConst VRInitError_Compositor_FirmwareRequiresUpdate
@mkCppConst VRInitError_Compositor_OverlayInitFailed
@mkCppConst VRInitError_Compositor_ScreenshotsInitFailed
@mkCppConst VRInitError_Compositor_UnableToCreateDevice
# @mkCppConst VRInitError_Compositor_SharedStateIsNull
# @mkCppConst VRInitError_Compositor_NotificationManagerIsNull
# @mkCppConst VRInitError_Compositor_ResourceManagerClientIsNull
# @mkCppConst VRInitError_Compositor_MessageOverlaySharedStateInitFailure
# @mkCppConst VRInitError_Compositor_PropertiesInterfaceIsNull
# @mkCppConst VRInitError_Compositor_CreateFullscreenWindowFailed
# @mkCppConst VRInitError_Compositor_SettingsInterfaceIsNull
# @mkCppConst VRInitError_Compositor_FailedToShowWindow
# @mkCppConst VRInitError_Compositor_DistortInterfaceIsNull
# @mkCppConst VRInitError_Compositor_DisplayFrequencyFailure
# @mkCppConst VRInitError_Compositor_RendererInitializationFailed
# @mkCppConst VRInitError_Compositor_DXGIFactoryInterfaceIsNull
# @mkCppConst VRInitError_Compositor_DXGIFactoryCreateFailed
# @mkCppConst VRInitError_Compositor_DXGIFactoryQueryFailed
# @mkCppConst VRInitError_Compositor_InvalidAdapterDesktop
# @mkCppConst VRInitError_Compositor_InvalidHmdAttachment
# @mkCppConst VRInitError_Compositor_InvalidOutputDesktop
# @mkCppConst VRInitError_Compositor_InvalidDeviceProvided
# @mkCppConst VRInitError_Compositor_D3D11RendererInitializationFailed
# @mkCppConst VRInitError_Compositor_FailedToFindDisplayMode
# @mkCppConst VRInitError_Compositor_FailedToCreateSwapChain
# @mkCppConst VRInitError_Compositor_FailedToGetBackBuffer
# @mkCppConst VRInitError_Compositor_FailedToCreateRenderTarget
# @mkCppConst VRInitError_Compositor_FailedToCreateDXGI2SwapChain
# @mkCppConst VRInitError_Compositor_FailedtoGetDXGI2BackBuffer
# @mkCppConst VRInitError_Compositor_FailedToCreateDXGI2RenderTarget
# @mkCppConst VRInitError_Compositor_FailedToGetDXGIDeviceInterface
# @mkCppConst VRInitError_Compositor_SelectDisplayMode
# @mkCppConst VRInitError_Compositor_FailedToCreateNvAPIRenderTargets
# @mkCppConst VRInitError_Compositor_NvAPISetDisplayMode
# @mkCppConst VRInitError_Compositor_FailedToCreateDirectModeDisplay
# @mkCppConst VRInitError_Compositor_InvalidHmdPropertyContainer
# @mkCppConst VRInitError_Compositor_UpdateDisplayFrequency
# @mkCppConst VRInitError_Compositor_CreateRasterizerState
# @mkCppConst VRInitError_Compositor_CreateWireframeRasterizerState
# @mkCppConst VRInitError_Compositor_CreateSamplerState
# @mkCppConst VRInitError_Compositor_CreateClampToBorderSamplerState
# @mkCppConst VRInitError_Compositor_CreateAnisoSamplerState
# @mkCppConst VRInitError_Compositor_CreateOverlaySamplerState
# @mkCppConst VRInitError_Compositor_CreatePanoramaSamplerState
# @mkCppConst VRInitError_Compositor_CreateFontSamplerState
# @mkCppConst VRInitError_Compositor_CreateNoBlendState
# @mkCppConst VRInitError_Compositor_CreateBlendState
# @mkCppConst VRInitError_Compositor_CreateAlphaBlendState
# @mkCppConst VRInitError_Compositor_CreateBlendStateMaskR
# @mkCppConst VRInitError_Compositor_CreateBlendStateMaskG
# @mkCppConst VRInitError_Compositor_CreateBlendStateMaskB
# @mkCppConst VRInitError_Compositor_CreateDepthStencilState
# @mkCppConst VRInitError_Compositor_CreateDepthStencilStateNoWrite
# @mkCppConst VRInitError_Compositor_CreateDepthStencilStateNoDepth
# @mkCppConst VRInitError_Compositor_CreateFlushTexture
# @mkCppConst VRInitError_Compositor_CreateDistortionSurfaces
# @mkCppConst VRInitError_Compositor_CreateConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateHmdPoseConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateHmdPoseStagingConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateSharedFrameInfoConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateOverlayConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateSceneTextureIndexConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateReadableSceneTextureIndexConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateLayerGraphicsTextureIndexConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateLayerComputeTextureIndexConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateLayerComputeSceneTextureIndexConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateComputeHmdPoseConstantBuffer
# @mkCppConst VRInitError_Compositor_CreateGeomConstantBuffer
# @mkCppConst VRInitError_Compositor_CreatePanelMaskConstantBuffer
# @mkCppConst VRInitError_Compositor_CreatePixelSimUBO
# @mkCppConst VRInitError_Compositor_CreateMSAARenderTextures
# @mkCppConst VRInitError_Compositor_CreateResolveRenderTextures
# @mkCppConst VRInitError_Compositor_CreateComputeResolveRenderTextures
# @mkCppConst VRInitError_Compositor_CreateDriverDirectModeResolveTextures
# @mkCppConst VRInitError_Compositor_OpenDriverDirectModeResolveTextures
# @mkCppConst VRInitError_Compositor_CreateFallbackSyncTexture
# @mkCppConst VRInitError_Compositor_ShareFallbackSyncTexture
# @mkCppConst VRInitError_Compositor_CreateOverlayIndexBuffer
# @mkCppConst VRInitError_Compositor_CreateOverlayVertextBuffer
# @mkCppConst VRInitError_Compositor_CreateTextVertexBuffer
# @mkCppConst VRInitError_Compositor_CreateTextIndexBuffer
# @mkCppConst VRInitError_Compositor_CreateMirrorTextures
# @mkCppConst VRInitError_Compositor_CreateLastFrameRenderTexture
@mkCppConst VRInitError_VendorSpecific_UnableToConnectToOculusRuntime
@mkCppConst VRInitError_VendorSpecific_WindowsNotInDevMode
@mkCppConst VRInitError_VendorSpecific_HmdFound_CantOpenDevice
@mkCppConst VRInitError_VendorSpecific_HmdFound_UnableToRequestConfigStart
@mkCppConst VRInitError_VendorSpecific_HmdFound_NoStoredConfig
@mkCppConst VRInitError_VendorSpecific_HmdFound_ConfigTooBig
@mkCppConst VRInitError_VendorSpecific_HmdFound_ConfigTooSmall
@mkCppConst VRInitError_VendorSpecific_HmdFound_UnableToInitZLib
@mkCppConst VRInitError_VendorSpecific_HmdFound_CantReadFirmwareVersion
@mkCppConst VRInitError_VendorSpecific_HmdFound_UnableToSendUserDataStart
@mkCppConst VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataStart
@mkCppConst VRInitError_VendorSpecific_HmdFound_UnableToGetUserDataNext
@mkCppConst VRInitError_VendorSpecific_HmdFound_UserDataAddressRange
@mkCppConst VRInitError_VendorSpecific_HmdFound_UserDataError
@mkCppConst VRInitError_VendorSpecific_HmdFound_ConfigFailedSanityCheck
@mkCppConst VRInitError_Steam_SteamInstallationNotFound
@mkCppConst VRScreenshotType_None
@mkCppConst VRScreenshotType_Mono
@mkCppConst VRScreenshotType_Stereo
@mkCppConst VRScreenshotType_Cubemap
@mkCppConst VRScreenshotType_MonoPanorama
@mkCppConst VRScreenshotType_StereoPanorama
@mkCppConst VRScreenshotPropertyFilenames_Preview
@mkCppConst VRScreenshotPropertyFilenames_VR
@mkCppConst VRTrackedCameraError_None
@mkCppConst VRTrackedCameraError_OperationFailed
@mkCppConst VRTrackedCameraError_InvalidHandle
@mkCppConst VRTrackedCameraError_InvalidFrameHeaderVersion
@mkCppConst VRTrackedCameraError_OutOfHandles
@mkCppConst VRTrackedCameraError_IPCFailure
@mkCppConst VRTrackedCameraError_NotSupportedForThisDevice
@mkCppConst VRTrackedCameraError_SharedMemoryFailure
@mkCppConst VRTrackedCameraError_FrameBufferingFailure
@mkCppConst VRTrackedCameraError_StreamSetupFailure
@mkCppConst VRTrackedCameraError_InvalidGLTextureId
@mkCppConst VRTrackedCameraError_InvalidSharedTextureHandle
@mkCppConst VRTrackedCameraError_FailedToGetGLTextureId
@mkCppConst VRTrackedCameraError_SharedTextureFailure
@mkCppConst VRTrackedCameraError_NoFrameAvailable
@mkCppConst VRTrackedCameraError_InvalidArgument
@mkCppConst VRTrackedCameraError_InvalidFrameBufferSize
@mkCppConst EVRTrackedCameraFrameLayout_Mono
@mkCppConst EVRTrackedCameraFrameLayout_Stereo
@mkCppConst EVRTrackedCameraFrameLayout_VerticalLayout
@mkCppConst EVRTrackedCameraFrameLayout_HorizontalLayout
@mkCppConst VRTrackedCameraFrameType_Distorted
@mkCppConst VRTrackedCameraFrameType_Undistorted
@mkCppConst VRTrackedCameraFrameType_MaximumUndistorted
@mkCppConst MAX_CAMERA_FRAME_TYPES
@mkCppConst VRDistortionFunctionType_None
@mkCppConst VRDistortionFunctionType_FTheta
# @mkCppConst VRDistortionFunctionType_Extended_FTheta
@mkCppConst MAX_DISTORTION_FUNCTION_TYPES
@mkCppConst VSync_None
@mkCppConst VSync_WaitRender
@mkCppConst VSync_NoWaitRender
@mkCppConst EVRMuraCorrectionMode_Default
@mkCppConst EVRMuraCorrectionMode_NoCorrection
@mkCppConst OffScale_AccelX
@mkCppConst OffScale_AccelY
@mkCppConst OffScale_AccelZ
@mkCppConst OffScale_GyroX
@mkCppConst OffScale_GyroY
@mkCppConst OffScale_GyroZ
@mkCppConst VRApplicationError_None
@mkCppConst VRApplicationError_AppKeyAlreadyExists
@mkCppConst VRApplicationError_NoManifest
@mkCppConst VRApplicationError_NoApplication
@mkCppConst VRApplicationError_InvalidIndex
@mkCppConst VRApplicationError_UnknownApplication
@mkCppConst VRApplicationError_IPCFailed
@mkCppConst VRApplicationError_ApplicationAlreadyRunning
@mkCppConst VRApplicationError_InvalidManifest
@mkCppConst VRApplicationError_InvalidApplication
@mkCppConst VRApplicationError_LaunchFailed
@mkCppConst VRApplicationError_ApplicationAlreadyStarting
@mkCppConst VRApplicationError_LaunchInProgress
@mkCppConst VRApplicationError_OldApplicationQuitting
@mkCppConst VRApplicationError_TransitionAborted
@mkCppConst VRApplicationError_IsTemplate
@mkCppConst VRApplicationError_SteamVRIsExiting
@mkCppConst VRApplicationError_BufferTooSmall
@mkCppConst VRApplicationError_PropertyNotSet
@mkCppConst VRApplicationError_UnknownProperty
@mkCppConst VRApplicationError_InvalidParameter
@mkCppConst VRApplicationProperty_Name_String
@mkCppConst VRApplicationProperty_LaunchType_String
@mkCppConst VRApplicationProperty_WorkingDirectory_String
@mkCppConst VRApplicationProperty_BinaryPath_String
@mkCppConst VRApplicationProperty_Arguments_String
@mkCppConst VRApplicationProperty_URL_String
@mkCppConst VRApplicationProperty_Description_String
@mkCppConst VRApplicationProperty_NewsURL_String
@mkCppConst VRApplicationProperty_ImagePath_String
@mkCppConst VRApplicationProperty_Source_String
@mkCppConst VRApplicationProperty_ActionManifestURL_String
@mkCppConst VRApplicationProperty_IsDashboardOverlay_Bool
@mkCppConst VRApplicationProperty_IsTemplate_Bool
@mkCppConst VRApplicationProperty_IsInstanced_Bool
@mkCppConst VRApplicationProperty_IsInternal_Bool
@mkCppConst VRApplicationProperty_WantsCompositorPauseInStandby_Bool
@mkCppConst VRApplicationProperty_LastLaunchTime_Uint64
# @mkCppConst VRApplicationTransition_None
# @mkCppConst VRApplicationTransition_OldAppQuitSent
# @mkCppConst VRApplicationTransition_WaitingForExternalLaunch
# @mkCppConst VRApplicationTransition_NewAppLaunched
@mkCppConst VRSettingsError_None
@mkCppConst VRSettingsError_IPCFailed
@mkCppConst VRSettingsError_WriteFailed
@mkCppConst VRSettingsError_ReadFailed
@mkCppConst VRSettingsError_JsonParseFailed
@mkCppConst VRSettingsError_UnsetSettingHasNoDefault
@mkCppConst ChaperoneCalibrationState_OK
@mkCppConst ChaperoneCalibrationState_Warning
@mkCppConst ChaperoneCalibrationState_Warning_BaseStationMayHaveMoved
@mkCppConst ChaperoneCalibrationState_Warning_BaseStationRemoved
@mkCppConst ChaperoneCalibrationState_Warning_SeatedBoundsInvalid
@mkCppConst ChaperoneCalibrationState_Error
@mkCppConst ChaperoneCalibrationState_Error_BaseStationUninitialized
@mkCppConst ChaperoneCalibrationState_Error_BaseStationConflict
@mkCppConst ChaperoneCalibrationState_Error_PlayAreaInvalid
@mkCppConst ChaperoneCalibrationState_Error_CollisionBoundsInvalid
@mkCppConst EChaperoneConfigFile_Live
@mkCppConst EChaperoneConfigFile_Temp
@mkCppConst EChaperoneImport_BoundsOnly
@mkCppConst VRCompositorError_None
@mkCppConst VRCompositorError_RequestFailed
@mkCppConst VRCompositorError_IncompatibleVersion
@mkCppConst VRCompositorError_DoNotHaveFocus
@mkCppConst VRCompositorError_InvalidTexture
@mkCppConst VRCompositorError_IsNotSceneApplication
@mkCppConst VRCompositorError_TextureIsOnWrongDevice
@mkCppConst VRCompositorError_TextureUsesUnsupportedFormat
@mkCppConst VRCompositorError_SharedTexturesNotSupported
@mkCppConst VRCompositorError_IndexOutOfRange
@mkCppConst VRCompositorError_AlreadySubmitted
@mkCppConst VRCompositorError_InvalidBounds
@mkCppConst VRCompositorTimingMode_Implicit
@mkCppConst VRCompositorTimingMode_Explicit_RuntimePerformsPostPresentHandoff
@mkCppConst VRCompositorTimingMode_Explicit_ApplicationPerformsPostPresentHandoff
@mkCppConst EVRNotificationType_Transient
@mkCppConst EVRNotificationType_Persistent
@mkCppConst EVRNotificationType_Transient_SystemWithUserValue
@mkCppConst EVRNotificationStyle_None
@mkCppConst EVRNotificationStyle_Application
@mkCppConst EVRNotificationStyle_Contact_Disabled
@mkCppConst EVRNotificationStyle_Contact_Enabled
@mkCppConst EVRNotificationStyle_Contact_Active
@mkCppConst VROverlayInputMethod_None
@mkCppConst VROverlayInputMethod_Mouse
@mkCppConst VROverlayInputMethod_DualAnalog
@mkCppConst VROverlayTransform_Absolute
@mkCppConst VROverlayTransform_TrackedDeviceRelative
@mkCppConst VROverlayTransform_SystemOverlay
@mkCppConst VROverlayTransform_TrackedComponent
# @mkCppConst VROverlayFlags_None
# @mkCppConst VROverlayFlags_Curved
# @mkCppConst VROverlayFlags_RGSS4X
# @mkCppConst VROverlayFlags_NoDashboardTab
# @mkCppConst VROverlayFlags_AcceptsGamepadEvents
# @mkCppConst VROverlayFlags_ShowGamepadFocus
# @mkCppConst VROverlayFlags_SendVRDiscreteScrollEvents
# @mkCppConst VROverlayFlags_SendVRTouchpadEvents
# @mkCppConst VROverlayFlags_ShowTouchPadScrollWheel
# @mkCppConst VROverlayFlags_TransferOwnershipToInternalProcess
# @mkCppConst VROverlayFlags_SideBySide_Parallel
# @mkCppConst VROverlayFlags_SideBySide_Crossed
# @mkCppConst VROverlayFlags_Panorama
# @mkCppConst VROverlayFlags_StereoPanorama
# @mkCppConst VROverlayFlags_SortWithNonSceneOverlays
# @mkCppConst VROverlayFlags_VisibleInDashboard
# @mkCppConst VROverlayFlags_MakeOverlaysInteractiveIfVisible
# @mkCppConst VROverlayFlags_SendVRSmoothScrollEvents
@mkCppConst VRMessageOverlayResponse_ButtonPress_0
@mkCppConst VRMessageOverlayResponse_ButtonPress_1
@mkCppConst VRMessageOverlayResponse_ButtonPress_2
@mkCppConst VRMessageOverlayResponse_ButtonPress_3
@mkCppConst VRMessageOverlayResponse_CouldntFindSystemOverlay
@mkCppConst VRMessageOverlayResponse_CouldntFindOrCreateClientOverlay
@mkCppConst VRMessageOverlayResponse_ApplicationQuit
@mkCppConst k_EGamepadTextInputModeNormal
@mkCppConst k_EGamepadTextInputModePassword
@mkCppConst k_EGamepadTextInputModeSubmit
@mkCppConst k_EGamepadTextInputLineModeSingleLine
@mkCppConst k_EGamepadTextInputLineModeMultipleLines
# @mkCppConst OverlayDirection_Up
# @mkCppConst OverlayDirection_Down
# @mkCppConst OverlayDirection_Left
# @mkCppConst OverlayDirection_Right
# @mkCppConst OverlayDirection_Count
@mkCppConst OverlayIntersectionPrimitiveType_Rectangle
@mkCppConst OverlayIntersectionPrimitiveType_Circle
@mkCppConst VRRenderModelError_None
@mkCppConst VRRenderModelError_Loading
@mkCppConst VRRenderModelError_NotSupported
@mkCppConst VRRenderModelError_InvalidArg
@mkCppConst VRRenderModelError_InvalidModel
@mkCppConst VRRenderModelError_NoShapes
@mkCppConst VRRenderModelError_MultipleShapes
@mkCppConst VRRenderModelError_TooManyVertices
@mkCppConst VRRenderModelError_MultipleTextures
@mkCppConst VRRenderModelError_BufferTooSmall
@mkCppConst VRRenderModelError_NotEnoughNormals
@mkCppConst VRRenderModelError_NotEnoughTexCoords
@mkCppConst VRRenderModelError_InvalidTexture
@mkCppConst VRComponentProperty_IsStatic
@mkCppConst VRComponentProperty_IsVisible
@mkCppConst VRComponentProperty_IsTouched
@mkCppConst VRComponentProperty_IsPressed
@mkCppConst VRComponentProperty_IsScrolled
@mkCppConst VRScreenshotError_None
@mkCppConst VRScreenshotError_RequestFailed
@mkCppConst VRScreenshotError_IncompatibleVersion
@mkCppConst VRScreenshotError_NotFound
@mkCppConst VRScreenshotError_BufferTooSmall
@mkCppConst VRScreenshotError_ScreenshotAlreadyInProgress
@mkCppConst VRSkeletalTransformSpace_Model
@mkCppConst VRSkeletalTransformSpace_Parent
@mkCppConst VRSkeletalReferencePose_BindPose
@mkCppConst VRSkeletalReferencePose_OpenHand
@mkCppConst VRSkeletalReferencePose_Fist
@mkCppConst VRSkeletalReferencePose_GripLimit
@mkCppConst VRFinger_Thumb
@mkCppConst VRFinger_Index
@mkCppConst VRFinger_Middle
@mkCppConst VRFinger_Ring
@mkCppConst VRFinger_Pinky
@mkCppConst VRFinger_Count
@mkCppConst VRFingerSplay_Thumb_Index
@mkCppConst VRFingerSplay_Index_Middle
@mkCppConst VRFingerSplay_Middle_Ring
@mkCppConst VRFingerSplay_Ring_Pinky
@mkCppConst VRFingerSplay_Count
@mkCppConst VRInputFilterCancel_Timers
@mkCppConst VRInputFilterCancel_Momentum
@mkCppConst VRInputString_Hand
@mkCppConst VRInputString_ControllerType
@mkCppConst VRInputString_InputSource
@mkCppConst VRInputString_All
@mkCppConst IOBuffer_Success
@mkCppConst IOBuffer_OperationFailed
@mkCppConst IOBuffer_InvalidHandle
@mkCppConst IOBuffer_InvalidArgument
@mkCppConst IOBuffer_PathExists
@mkCppConst IOBuffer_PathDoesNotExist
@mkCppConst IOBuffer_Permission
@mkCppConst IOBufferMode_Read
@mkCppConst IOBufferMode_Write
@mkCppConst IOBufferMode_Create

ext: jl


text:
using Base.Test
using RecursiveSparseBlocks

@testset "SparseMatrixCSC round trip" begin
    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, 1000, 1000, 0.1)
        B = SparseMatrixRSB(A)
        @test convert(SparseMatrixCSC, B) == A
    end

    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, 1000, 1000, 0.1)
        I, J, V = findnz(A)
        m, n = size(A)
        B = SparseMatrixRSB(I, J, V, m, n)
        @test convert(SparseMatrixCSC, B) == A
    end
end

@testset "Basic properties" begin
    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, 1000, 1000, 0.1)
        B = SparseMatrixRSB(A)
        @test size(A) == size(B)
        @test nnz(A) == nnz(B)
        @test diag(A) == diag(B)

        AI, AJ, AV = findnz(A)
        BI, BJ, BV = findnz(A)

        ap = sortperm(AI)
        AI = AI[ap]
        AJ = AJ[ap]
        AV = AV[ap]

        bp = sortperm(BI)
        BI = BI[bp]
        BJ = BJ[bp]
        BV = BV[bp]

        @test AI == BI
        @test AJ == BJ
        @test AV == BV
    end
end

@testset "Full conversion" begin
    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, 100, 100, 0.1)
        B = SparseMatrixRSB(A)
        @test full(A) == full(B)
    end
end

@testset "Indexing" begin
    # getindex
    n = 500
    cnt = 100
    indexes = [(rand(1:n), rand(1:n)) for _ in 1:cnt]
    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, n, n, 0.5)
        B = SparseMatrixRSB(A)
        for index in indexes
            @test A[index...] == B[index...]
        end
    end

    # setindex
    for T in [Float32, Float64, Complex64, Complex128]
        A = sprand(T, n, n, 0.5)
        B = SparseMatrixRSB(A)
        I, J, V = findnz(A)

        for (i, j) in zip(I, J)
            r = rand()
            A[i, j] = r
            B[i, j] = r
        end

        @test A == convert(SparseMatrixCSC, B)
    end
end

@testset "Multiplication" begin
    # sparse matrix by dense vector
    for T in [Float32, Float64, Complex64, Complex128]
        n = 1000
        A = sprand(T, n, n, 0.1)
        B = SparseMatrixRSB(A)
        x = rand(T, n)
        ay = A*x
        by = B*x

        @test maximum(abs.(ay .- by)) ≈ zero(T) atol=1e-4
    end

    #for T in [Float32, Float64, Complex64, Complex128]
    for T in [Float32, Float64, Complex64, Complex128]
        #n = 1000
        n = 100
        k = 100
        A = sprand(T, n, n, 0.1)
        B = SparseMatrixRSB(A)
        X = rand(T, (n, k))

        AX = A*X
        BX = B*X

        @test maximum(abs.(AX .- BX)) ≈ zero(T) atol=1e-4
    end
end


text:
## a program select event
immutable ProgSel <: ChanMes
	time::Int
	chan::Int
	prog::Int

	function ProgSel(tm::Int, ch::Int ,pr::Integer)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=pr<128
		new(tm,ch,round(Int,pr))
	end
end

"""
	progSel!(mt::MidiTrack, tm::Rational{Int}, ch::Int ,pr::Integer)

Writes a program select event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel and `pr` {1..127} the program number.
"""
function progSel!(mt::MidiTrack, tm::Rational{Int}, ch::Int ,pr::Integer)
	push!(mt.ms,ProgSel(timm(mt,tm),ch,pr))
	timm(mt,tm)
end

## a bank select event
immutable BankSel <: ChanMes
	time::Int
	chan::Int
	bank::Int

	function BankSel(tm::Int, ch::Int, bk::Integer)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=bk<2^14
		new(tm,ch,round(Int,bk))
	end
end

"""
	bankSel!(mt::MidiTrack, tm::Rational{Int}, ch::Int, bk::Integer)

Writes a bank select event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel and `bk` the program bank number.
"""
function bankSel!(mt::MidiTrack, tm::Rational{Int}, ch::Int, bk::Integer)
	push!(mt.ms,BankSel(timm(mt,tm),ch,bk))
	timm(mt,tm)
end

## a note on event
immutable NoteOn <: ChanMes
	time::Int
	chan::Int
	pitch::Int
	vel::Int

	function NoteOn(tm::Int, ch::Int, pch::Int, vel::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=pch<128 ;  @assert 0<=vel<128
		new(tm,ch,pch,vel)
	end
end

"""
	noteOn!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, vel::Int)

Writes a note on event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, `pch` {0..127} the pitch, and `vel` {0..127} the velocity.
"""
function noteOn!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, vel::Int)
	push!(mt.ms,NoteOn(timm(mt,tm),ch,pch,vel))
	timm(mt,tm)
end

## a note off event
immutable NoteOff <: ChanMes
	time::Int
	chan::Int
	pitch::Int
	vel::Int

	function NoteOff(tm::Int, ch::Int, pch::Int, vel::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=pch<128 ;  @assert 0<=vel<128
		new(tm,ch,pch,vel)
	end
end

"""
	noteOff!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, vel::Int)

Writes a note off event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, `pch` {0..127} the pitch, and `vel` {0..127} the velocity.
"""
function noteOff!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, vel::Int)
	push!(mt.ms,NoteOff(timm(mt,tm)-1,ch,pch,vel))
	timm(mt,tm)
end

## a pitch wheel bend event
immutable PitchWheel <: ChanMes
	time::Int
	chan::Int
	val::Int

	function PitchWheel(tm::Int, ch::Int, val::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=val<2^14
		new(tm,ch,val)
	end
end

"""
	pitchWheel!(mt::MidiTrack, tm::Rational{Int}, ch::Int, val::Int)

Writes a pitch wheel bend event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, and `val` {0..2^14-1} the value.
"""
function pitchWheel!(mt::MidiTrack, tm::Rational{Int}, ch::Int, val::Int)
	push!(mt.ms,PitchWheel(timm(mt,tm),ch,val))
	timm(mt,tm)
end

## a channel aftertouch event
immutable ChanAfter <: ChanMes
	time::Int
	chan::Int
	val::Int

	function ChanAfter(tm::Int, ch::Int, val::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=val<128
		new(tm,ch,val)
	end
end

"""
	chanAfter!(mt::MidiTrack, tm::Rational{Int}, ch::Int, val::Int)

Writes a channel aftertouch event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, and `val` {0..127} the value.
"""
function chanAfter!(mt::MidiTrack, tm::Rational{Int}, ch::Int, val::Int)
	push!(mt.ms,ChanAfter(timm(mt,tm),ch,val))
	timm(mt,tm)
end

## a polyphonic aftertouch event
immutable PolyAfter <: ChanMes
	time::Int
	chan::Int
	pitch::Int
	val::Int

	function PolyAfter(tm::Int, ch::Int, pch::Int, val::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=pch<128 ;  @assert 0<=val<128
		new(tm,ch,pch,val)
	end
end

"""
	polyAfter!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, val::Int)

Writes a polyphonic aftertouch event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, `pch` {0..127} is the pitch, and `val` {0..127} the value.
"""
function polyAfter!(mt::MidiTrack, tm::Rational{Int}, ch::Int, pch::Int, val::Int)
	push!(mt.ms,PolyAfter(timm(mt,tm),ch,pch,val))
	timm(mt,tm)
end

## a 14bit channel control event
immutable Control14 <: ChanMes
	time::Int
	chan::Int
	num::Int
	val::Int

	function Control14(tm::Int, ch::Int, nm::Integer, val::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 0<=nm<32 ;  @assert 0<=val<2^14
		new(tm,ch,round(Int,nm),val)
	end
end

"""
	control14!(mt::MidiTrack, tm::Rational{Int}, ch::Int, nm::Integer, val::Int)

Writes a 14bit channel control event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, `nm` {0..31} is the contol number, and `val` {0..2^14-1} the value.
"""
function control14!(mt::MidiTrack, tm::Rational{Int}, ch::Int, nm::Integer, val::Int)
	push!(mt.ms,Control14(timm(mt,tm),ch,nm,val))
	timm(mt,tm)
end

## a 7bit channel control event
immutable Control7 <: ChanMes
	time::Int
	chan::Int
	num::Int
	val::Int

	function Control7(tm::Int, ch::Int, nm::Integer, val::Int)
		@assert 0 <= tm ;  @assert 1<=ch<=16 ;  @assert 64<=nm<102 || 120 <= nm < 128 ;  @assert 0<=val<128
		new(tm,ch,round(Int,nm),val)
	end
end

"""
	control7!(mt::MidiTrack, tm::Rational{Int}, ch::Int, nm::Integer, val::Int)

Writes a 7bit channel control event to `mt` at the current track offset plus `tm` note lengths.  `ch` {1..16} is the channel, `nm` {64..101,120..127} is the contol number, and `val` {0..127} the value.
"""
function control7!(mt::MidiTrack, tm::Rational{Int}, ch::Int, nm::Integer, val::Int)
	push!(mt.ms,Control7(timm(mt,tm),ch,nm,val))
	timm(mt,tm)
end

## these convert ChanMes objects to byte sequences in the MIDI format

bytesev(m::ProgSel,tm::Int) = vcat(bytesDt(m.time-tm),bytesProgSelect(m.chan-1,m.prog))

function bytesev(m::BankSel,tm::Int)
	tb = bytesDt(m.time-tm)
	vcat(tb, bytesControlMsb14(m.chan-1,0,m.bank), tb,bytesControlLsb14(m.chan-1,0,m.bank))
end

bytesev(m::NoteOn,tm::Int) = vcat(bytesDt(m.time-tm),bytesNoteOn(m.chan-1,m.pitch,m.vel))

bytesev(m::NoteOff,tm::Int) = vcat(bytesDt(m.time-tm),bytesNoteOff(m.chan-1,m.pitch,m.vel))

bytesev(m::PitchWheel,tm::Int) = vcat(bytesDt(m.time-tm),bytesPitchWheel(m.chan-1,m.val))

bytesev(m::ChanAfter,tm::Int) = vcat(bytesDt(m.time-tm),bytesChanAfter(m.chan-1,m.val))

bytesev(m::PolyAfter,tm::Int) = vcat(bytesDt(m.time-tm),bytesPolyAfter(m.chan-1,m.pitch,m.val))

function bytesev(m::Control14,tm::Int)
	tb = bytesDt(m.time-tm)
	vcat(tb,bytesControlMsb14(m.chan-1,m.num,m.val),tb,bytesControlLsb14(m.chan-1,m.num,m.val))
end

bytesev(m::Control7,tm::Int) = vcat(bytesDt(m.time-tm),bytesControl7(m.chan-1,m.num,m.val))


text:
using HypercubeTransform
using Documenter

DocMeta.setdocmeta!(HypercubeTransform, :DocTestSetup, :(using HypercubeTransform); recursive=true)

makedocs(;
    modules=[HypercubeTransform],
    authors="ptiede <ptiede91@gmail.com> and contributors",
    repo="https://github.com/ptiede/HypercubeTransform.jl/blob/{commit}{path}#{line}",
    sitename="HypercubeTransform.jl",
    format=Documenter.HTML(;
        prettyurls=get(ENV, "CI", "false") == "true",
        canonical="https://ptiede.github.io/HypercubeTransform.jl",
        assets=String[],
    ),
    pages=[
        "Home" => "index.md",
    ],
)

deploydocs(;
    repo="github.com/ptiede/HypercubeTransform.jl",
)


text:
include("calc-hv.jl")

function update_population!(population, offspring, n_samples)
    push!(population, offspring)

    # FIXME performance improvement required (yep, it is fast but could be faster)
    fast_non_dominated_sort!(population)

    last_front = get_last_front(population)

    # reset and update contribution in last front
    update_contribution!(population, last_front, n_samples)

    # element with minimum contribution
    worst = argmin(get_contribution.(population[last_front]))

    deleteat!(population, last_front[worst])
end

function compute_contribution(population, n_samples = 10_000)
    if isempty(population)
        # nothing to do
        return
    end

    M = length(fval(population[1]))

    # objetive function values
    Fs = fvals(population)
    N = size(Fs, 1)
    ΔS = fill(Inf, N)

    if M == 2
        rank = sortslicesperm(Fs, dims=1)

        for i = 2 : N-1
            ΔS[rank[i]] = (Fs[rank[i+1],1] - Fs[rank[i],1]) .* (Fs[rank[i-1],2] - Fs[rank[i],2]);
        end

    elseif N > 1
        ΔS = calculate_hv(Fs, nadir(population)*1.1, 1, n_samples)
    end

    return ΔS

end

function update_contribution!(population, last_front, n_samples)

    # reset contribution
    for sol in population
        sol.crowding = Inf
    end

    ΔS = compute_contribution(population[last_front], n_samples)

    # save contribution for further analysis
    for i in eachindex(ΔS)
        population[last_front[i]].crowding = ΔS[i]
    end

end

get_contribution(sol::xFgh_indiv) = sol.crowding

function get_last_front(population, N = length(population) - 1)
    let f::Int = 1
        ind = 0
        _indnext = findlast(x -> x.rank == f, population)
        indnext = isnothing(_indnext) ? 0 : _indnext

        while 0 < indnext <= N
            ind = indnext
            f += 1
            _indnext = findlast(x -> x.rank == f, population)
            indnext = isnothing(_indnext) ? 0 : _indnext
        end

        indnext == 0 && (indnext = length(population))

        return ind+1:indnext
    end

end


text:
include("../Resistances/heat.jl")
include("../../Utilities/summary.jl")

using Plots, Measurements

# Boundary model(s)
T_a = 293.15
T_b = 313.15

@named boundaryT_a =Temperature(T=T_a)
@named boundaryT_b =Temperature(T=T_b)

@variables Q_total(t)
D = Differential(t)

# Sphere model
r_inner = measurement(1.0,0.1)
r_outer = 2.0
lambda = 5.0

@named sphere = Sphere(r_inner=r_inner,r_outer=r_outer,lambda=lambda)

eqs =
[
    connect(boundaryT_a.port,sphere.port_a)
    connect(sphere.port_b,boundaryT_b.port)
    D(Q_total) ~ sphere.port_a.Q_flow
]

@named sphere_model = ODESystem(eqs, t, [Q_total],[], systems=[boundaryT_a,boundaryT_b,sphere])

sys = structural_simplify(sphere_model)
u0 = [Q_total=>0.0]
prob = ODAEProblem(sys, u0, (0, 1.0), [T_a, T_b, r_inner, r_outer, lambda])
sol = solve(prob, Tsit5())
y_min, t_min, y_max, t_max = reportMinMax("Q_total","Sphere Model",sol)
errorCheck(-2513.2742, y_min)
plot(sol)

# Convection model
surfaceArea = 2
alpha = 15

@named convection = Convection(surfaceArea = surfaceArea, alpha=alpha)

eqs =
[
    connect(boundaryT_a.port,convection.port_a)
    connect(convection.port_b,boundaryT_b.port)
    D(Q_total) ~ convection.port_a.Q_flow
]

@named convection_model = ODESystem(eqs, t, [Q_total],[], systems=[boundaryT_a,boundaryT_b,convection])

sys = structural_simplify(convection_model)
u0 = [Q_total=>0.0]
prob = ODAEProblem(sys, u0, (0, 1.0), [T_a, T_b, surfaceArea, alpha])
sol = solve(prob, Tsit5())
y_min, t_min, y_max, t_max = reportMinMax("Q_total","Convection Model",sol)
errorCheck(-600, y_min)
plot(sol) # how to get both to plot to jupyter without overriding like plt.figure()?

# Contact model
surfaceArea = 2
Rc_pp = 5

@named contact = Contact(surfaceArea = surfaceArea, Rc_pp=Rc_pp)

eqs =
[
    connect(boundaryT_a.port,contact.port_a)
    connect(contact.port_b,boundaryT_b.port)
    D(Q_total) ~ contact.port_a.Q_flow
]

@named contact_model = ODESystem(eqs, t, [Q_total],[], systems=[boundaryT_a,boundaryT_b,contact])

sys = structural_simplify(contact_model)
u0 = [Q_total=>0.0]
prob = ODAEProblem(sys, u0, (0, 1.0), [T_a, T_b, surfaceArea, Rc_pp])
sol = solve(prob, Tsit5())
y_min, t_min, y_max, t_max = reportMinMax("Q_total","Contact Model",sol)
errorCheck(-8, y_min)
plot(sol)

# Radiation model
surfaceArea = 2.0
epsilon = 0.5

@named radiation = Radiation(surfaceArea = surfaceArea, epsilon=epsilon)

eqs =
[
    connect(boundaryT_a.port,radiation.port_a)
    connect(radiation.port_b,boundaryT_b.port)
    D(Q_total) ~ radiation.port_a.Q_flow
]

@named radiation_model = ODESystem(eqs, t, [Q_total],[], systems=[boundaryT_a,boundaryT_b,radiation])

sys = structural_simplify(radiation_model)
u0 = [Q_total=>0.0]
prob = ODAEProblem(sys, u0, (0, 1.0), [T_a, T_b, surfaceArea, epsilon])
sol = solve(prob, Tsit5())
y_min, t_min, y_max, t_max = reportMinMax("Q_total","Radiation Model",sol)
errorCheck(-126.51638, y_min)
plot(sol)


text:
function rrule(::typeof(free_energy), K::Matrix{T}, model::AbstractSampler, samples) where T <: Real
    free_energy(K, model, samples), function (adjy)
        nt = map(x->x === nothing ? NoTangent() : x .* adjy, grad_model(K, model, samples))
        adjmodel = Tangent{typeof(model)}(; nt...)
        return (NoTangent(), NoTangent(), adjmodel, NoTangent())
    end
end

@non_differentiable gen_samples(model, nbatch)
@non_differentiable createmasks(order, hs)
@non_differentiable AutoRegressiveModel(nbits, nhidden)
@non_differentiable PSAModel(nbits)


text:
using DashBootstrapComponents

modal = html_div([
    dbc_button("Open modal", id = "open", n_clicks = 0),
    dbc_modal(
        [
            dbc_modalheader(dbc_modaltitle("Header")),
            dbc_modalbody("This is the content of the modal"),
            dbc_modalfooter(
                dbc_button("Close", id = "close", className = "ms-auto", n_clicks = 0),
            ),
        ],
        id = "modal",
        is_open = false,
    ),
]);

callback!(
    app,
    Output("modal", "is_open"),
    Input("open", "n_clicks"),
    Input("close", "n_clicks"),
    State("modal", "is_open"),
) do n1, n2, is_open
    return n1 > 0 || n2 > 0 ? is_open == 0 : is_open
end;

max_issues_repo_name: sthagen/dash-bootstrap-components

max_forks_repo_name: sthagen/dash-bootstrap-components


text:
using CmdStan, Turing, ContinuousBenchmarks

include(joinpath(ContinuousBenchmarks.STAN_DATA_DIR, "bernoulli-stan.data.jl"))
include(joinpath(ContinuousBenchmarks.STAN_MODELS_DIR, "bernoulli-stan.model.jl"))

stan_model_name = "bernoulli"
berstan = Stanmodel(name=stan_model_name, model=berstanmodel, nchains=1);

rc, ber_stan_sim = stan(berstan, berstandata, CmdStanDir=ContinuousBenchmarks.CMDSTAN_HOME, summary=false)

theta_stan = ber_stan_sim[1:1000, ["theta"], :].value[:]
ber_time = get_stan_time(stan_model_name)


text:
module ExtremeLearning

using LinearAlgebra
import NNlib:sigmoid
include("base.jl")
export fit!, predict, ELM, AbstractELM

end


text:
using ITensors

import ITensors: op

function op(::OpName"expτSS", ::SiteType"S=1/2", s1::Index, s2::Index; τ)
  h =
    1 / 2 * op("S+", s1) * op("S-", s2) +
    1 / 2 * op("S-", s1) * op("S+", s2) +
    op("Sz", s1) * op("Sz", s2)
  return exp(τ * h)
end

function main(; N=10, cutoff=1E-8, δt=0.1, ttotal=5.0)
  # Compute the number of steps to do
  Nsteps = Int(ttotal / δt)

  # Make an array of 'site' indices
  s = siteinds("S=1/2", N; conserve_qns=true)

  # Make gates (1,2),(2,3),(3,4),...
  gates = ops([("expτSS", (n, n + 1), (τ=-δt * im / 2,)) for n in 1:(N - 1)], s)

  # Include gates in reverse order too
  # (N,N-1),(N-1,N-2),...
  append!(gates, reverse(gates))

  # Function that measures <Sz> on site n
  function measure_Sz(psi::MPS, n)
    psi = orthogonalize(psi, n)
    sn = siteind(psi, n)
    Sz = scalar(dag(prime(psi[n], "Site")) * op("Sz", sn) * psi[n])
    return real(Sz)
  end

  # Initialize psi to be a product state (alternating up and down)
  psi0 = productMPS(s, n -> isodd(n) ? "Up" : "Dn")

  c = div(N, 2)

  # Compute and print initial <Sz> value
  t = 0.0
  Sz = measure_Sz(psi0, c)
  println("$t $Sz")

  # Do the time evolution by applying the gates
  # for Nsteps steps
  psi = psi0
  for step in 1:Nsteps
    psi = apply(gates, psi; cutoff=cutoff)
    t += δt
    Sz = measure_Sz(psi, c)
    println("$t $Sz")
  end

  # Now do the same evolution with an MPO
  rho0 = MPO(psi0)
  rho = rho0
  for step in 1:Nsteps
    rho = apply(gates, rho; cutoff=cutoff, apply_dag=true)
    t += δt
  end
  @show inner(psi, rho, psi)
  @show inner(psi, psi)
  @show tr(rho)

  return nothing
end


text:
# This file is a part of TypeDBClient.  License is MIT: https://github.com/Humans-of-Julia/TypeDBClient.jl/blob/main/LICENSE

mutable struct TypeDBOptions
    infer::Optional{Bool}
    trace_inference::Optional{Bool}
    explain::Optional{Bool}
    parallel::Optional{Bool}
    batch_size::Optional{Int}
    prefetch::Optional{Bool}
    session_idle_timeout_millis::Optional{Int}
    schema_lock_acquire_timeout_millis::Optional{Int}
end

function TypeDBOptions()
    return TypeDBOptions(nothing,nothing,nothing,nothing,nothing,nothing,nothing,nothing)
end

function typedb_options_core()
    return TypeDBOptions()
end

#
# package typedb.client.api;
#
# import typedb.client.common.exception.TypeDBClientException;
# import typedb.protocol.OptionsProto;
#
# import javax.annotation.CheckReturnValue;
# import java.util.Optional;
#
# import static typedb.client.common.exception.ErrorMessage.Client.NEGATIVE_VALUE_NOT_ALLOWED;
# import static typedb.client.common.exception.ErrorMessage.Internal.ILLEGAL_CAST;
# import static typedb.common.util.Objects.className;
#
# public class TypeDBOptions {
#
#     private Boolean infer = null;
#     private Boolean traceInference = null;
#     private Boolean explain = null;
#     private Boolean parallel = null;
#     private Integer batchSize = null;
#     private Boolean prefetch = null;
#     private Integer sessionIdleTimeoutMillis = null;
#     private Integer schemaLockAcquireTimeoutMillis = null;
#
#     @CheckReturnValue
#     public static TypeDBOptions core() {
#         return new TypeDBOptions();
#     }
#
#     @CheckReturnValue
#     public static TypeDBOptions.Cluster cluster() {
#         return new Cluster();
#     }
#
#     @CheckReturnValue
#     public boolean isCluster() {
#         return false;
#     }
#
#     @CheckReturnValue
#     public Optional<Boolean> infer() {
#         return Optional.ofNullable(infer);
#     }
#
#     public TypeDBOptions infer(boolean infer) {
#         this.infer = infer;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Boolean> traceInference() {
#         return Optional.ofNullable(traceInference);
#     }
#
#     public TypeDBOptions traceInference(boolean traceInference) {
#         this.traceInference = traceInference;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Boolean> explain() {
#         return Optional.ofNullable(explain);
#     }
#
#     public TypeDBOptions explain(boolean explain) {
#         this.explain = explain;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Boolean> parallel() {
#         return Optional.ofNullable(parallel);
#     }
#
#     public TypeDBOptions parallel(boolean parallel) {
#         this.parallel = parallel;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Integer> batchSize() {
#         return Optional.ofNullable(batchSize);
#     }
#
#     public TypeDBOptions batchSize(int batchSize) {
#         if (batchSize < 1) {
#             throw new TypeDBClientException(NEGATIVE_VALUE_NOT_ALLOWED, batchSize);
#         }
#         this.batchSize = batchSize;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Boolean> prefetch() {
#         return Optional.ofNullable(prefetch);
#     }
#
#     public TypeDBOptions prefetch(boolean prefetch) {
#         this.prefetch = prefetch;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Integer> sessionIdleTimeoutMillis() {
#         return Optional.ofNullable(sessionIdleTimeoutMillis);
#     }
#
#     public TypeDBOptions sessionIdleTimeoutMillis(int sessionIdleTimeoutMillis) {
#         if (sessionIdleTimeoutMillis < 1) {
#             throw new TypeDBClientException(NEGATIVE_VALUE_NOT_ALLOWED, sessionIdleTimeoutMillis);
#         }
#         this.sessionIdleTimeoutMillis = sessionIdleTimeoutMillis;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Optional<Integer> schemaLockAcquireTimeoutMillis() {
#         return Optional.ofNullable(schemaLockAcquireTimeoutMillis);
#     }
#
#     public TypeDBOptions schemaLockAcquireTimeoutMillis(int schemaLockAcquireTimeoutMillis) {
#         if (schemaLockAcquireTimeoutMillis < 1) {
#             throw new TypeDBClientException(NEGATIVE_VALUE_NOT_ALLOWED, schemaLockAcquireTimeoutMillis);
#         }
#         this.schemaLockAcquireTimeoutMillis = schemaLockAcquireTimeoutMillis;
#         return this;
#     }
#
#     @CheckReturnValue
#     public Cluster asCluster() {
#         throw new TypeDBClientException(ILLEGAL_CAST, className(Cluster.class));
#     }
#
#     @CheckReturnValue
#     public OptionsProto.Options proto() {
#         OptionsProto.Options.Builder builder = OptionsProto.Options.newBuilder();
#         infer().ifPresent(builder::setInfer);
#         traceInference().ifPresent(builder::setTraceInference);
#         explain().ifPresent(builder::setExplain);
#         parallel().ifPresent(builder::setParallel);
#         batchSize().ifPresent(builder::setBatchSize);
#         prefetch().ifPresent(builder::setPrefetch);
#         sessionIdleTimeoutMillis().ifPresent(builder::setSessionIdleTimeoutMillis);
#         schemaLockAcquireTimeoutMillis().ifPresent(builder::setSchemaLockAcquireTimeoutMillis);
#         if (isCluster()) asCluster().readAnyReplica().ifPresent(builder::setReadAnyReplica);
#
#         return builder.build();
#     }
#
#     public static class Cluster extends TypeDBOptions {
#
#         private Boolean readAnyReplica = null;
#
#         @CheckReturnValue
#         public Optional<Boolean> readAnyReplica() {
#             return Optional.ofNullable(readAnyReplica);
#         }
#
#         public Cluster readAnyReplica(boolean readAnyReplica) {
#             this.readAnyReplica = readAnyReplica;
#             return this;
#         }
#
#         @Override
#         @CheckReturnValue
#         public boolean isCluster() {
#             return true;
#         }
#
#         @Override
#         @CheckReturnValue
#         public Cluster asCluster() {
#             return this;
#         }
#     }
# }


text:
using MAT

"""
    mpc = loadcase(caseName)
    mpc = loadcase(fpath)

Return a Dict containing power system data in MATPOWER's format.
Argument may be any of the names returned by casenames(), or a
path to a .mat file containing MATPOWER-format data.

Set `describe` to `false` for silent operation.
"""
function loadcase(caseName::AbstractString; describe=true)
    if caseName[end-3:end] == ".mat"
        p = caseName
        !isfile(p) && error("File not found.")
    else
        s = joinpath(@__DIR__, "..", "data")
        println("joined path is $(s).")
        p = joinpath(s,"$(caseName).mat")
        !isfile(p) && error("No data for network \"$(caseName)\".\nUse casenames() to list all valid names.")
    end

    mpc = matread(p)["mpc"]
    ds = get(mpc, "docstring", "")
    # ds = mpc["docstring"]
    if describe
        println(split(ds,"\n")[1])
    end
    return mpc
end

"""
    casenames()

Return an array containing all valid
MatpowerCases case names.
"""
function casenames()
    s = joinpath(@__DIR__, "..", "data")
    names = readdir(s)
    [splitext(name)[1] for name in names]
end


text:
module RadioactiveHeat

# If you want to add a new method here, feel free to do so.
# Remember to also export the function name in GeoParams.jl (in addition to here)

using Parameters, LaTeXStrings, Unitful
using ..Units
using GeoParams: AbstractMaterialParam
using ..MaterialParameters: MaterialParamsInfo
import Base.show, GeoParams.param_info

abstract type AbstractRadioactiveHeat{T} <: AbstractMaterialParam end

export  compute_radioactive_heat,                  # calculation routines
        compute_radioactive_heat!,
        param_info,
        ConstantRadioactiveHeat,                  # constant
        ExpDepthDependentRadioactiveHeat

include("../Computations.jl")
include("../Utils.jl")

# Constant  -------------------------------------------------------
"""
    ConstantRadioactiveHeat(H_r=1e-6Watt/m^3)

Set a constant radioactive heat:
```math
    H_r  = cst
```
where ``H_r`` is the radioactive heat source [``Watt/m^3``].
"""
@with_kw_noshow struct ConstantRadioactiveHeat{T,U} <: AbstractRadioactiveHeat{T}
    H_r::GeoUnit{T,U}         =   1e-6Watt/m^3
end
ConstantRadioactiveHeat(args...) = ConstantRadioactiveHeat(convert.(GeoUnit,args)...)

function param_info(s::ConstantRadioactiveHeat) # info about the struct
    return MaterialParamsInfo(Equation = L"H_r = cst")
end

# Calculation routine
function (s::ConstantRadioactiveHeat{_T})(;kwargs...) where _T
    @unpack_val H_r   = s

    return H_r
end

compute_radioactive_heat(s::ConstantRadioactiveHeat{_T}; kwargs...) where _T = s()

function (s::ConstantRadioactiveHeat{_T})(I::Integer...) where _T
    @unpack_val H_r = s

    return fill(H_r, I...)
end

function compute_radioactive_heat!(Hr::AbstractArray{_T,N}, s::ConstantRadioactiveHeat{_T}; kwargs...) where {_T,N}
    @unpack_val H_r = s
    for i in eachindex(Hr)
        @inbounds Hr[i] = H_r
    end
    return nothing
end

# Print info
function show(io::IO, g::ConstantRadioactiveHeat)
    print(io, "Constant radioactive heat: H_r=$(Value(g.H_r))")
end
#-------------------------------------------------------------------------

# Exponential Depth-dependent  -------------------------------------------------------
"""
    ExpDepthDependent(H_0=1e-6Watt/m^3, h_r=10e3m, z_0=0m)

Sets an exponential depth-dependent radioactive
```math
    H_r  = H_0 \\exp \\left( {- {(z - z_0) \\over h_r}} \\right)
```
where ``H_0`` is the radioactive heat source [``Watt/m^3``] at ``z=z_0`` which decays with depth over a characteristic distance ``h_r``.
"""
@with_kw_noshow struct ExpDepthDependentRadioactiveHeat{T,U,U1} <: AbstractRadioactiveHeat{T}
    H_0::GeoUnit{T,U}         =   1e-6Watt/m^3
    h_r::GeoUnit{T,U1}        =   10e3m
    z_0::GeoUnit{T,U1}        =   0m
end
ExpDepthDependentRadioactiveHeat(args...) = ExpDepthDependentRadioactiveHeat(convert.(GeoUnit,args)...)

function param_info(s::ExpDepthDependentRadioactiveHeat) # info about the struct
    return MaterialParamsInfo(Equation = L"H_r = H_0 \\exp(-(z-z_0)/h_r)")
end

# Calculation routines
function (s::ExpDepthDependentRadioactiveHeat{_T})(; z::_T=zero(_T), kwargs...) where _T
    @unpack_val H_0, z_0, h_r   = s

    H_r = H_0*exp(-(z-z_0)/h_r);

    return H_r
end

compute_radioactive_heat(s::ExpDepthDependentRadioactiveHeat{_T}; z::_T=zero(_T)) where _T = s(; z=z)

# Calculation routine
function (s::ExpDepthDependentRadioactiveHeat{_T})(z::AbstractArray{_T,N}; kwargs...) where {_T,N}
    Hr = similar(z)
    @unpack_val H_0, z_0, h_r   = s

    @. Hr = H_0*exp(-(z - z_0)/h_r);
    return Hr
end

(s::ExpDepthDependentRadioactiveHeat{_T})(z::AbstractArray{_T,N}, args...) where {_T,N} = s(z; args...)
compute_radioactive_heat(s::ExpDepthDependentRadioactiveHeat{_T}, z::AbstractArray{_T,N}, args...) where {_T,N} = s(z; args...)

function compute_radioactive_heat!(Hr::AbstractArray{_T,N}, s::ExpDepthDependentRadioactiveHeat{_T}; z::AbstractArray{_T,N}, kwargs...) where {N,_T}
    @unpack_val H_0, z_0, h_r   = s

    @inbounds for i in eachindex(z)
        Hr[i] = H_0*exp(-(z[i] - z_0)/h_r);
    end

    return nothing
end

# Print info
function show(io::IO, g::ExpDepthDependentRadioactiveHeat)
    print(io, "Exponential depth-dependent radioactive heat: H_r=$(Value(g.H_0)) exp(-(z-$(Value(g.z_0)))/$(Value(g.h_r)))")
end
#-------------------------------------------------------------------------

# Computational routines needed for computations with the MaterialParams structure
function compute_radioactive_heat(s::AbstractMaterialParamsStruct, args)
    if isempty(s.RadioactiveHeat)
        return isempty(args) ? 0.0 : zero(typeof(args).types[1])  # return zero if not specified
    else
        return s.RadioactiveHeat[1](args)
    end
end

# Help info for the calculation routines
"""
    H_r = compute_radioactive_heat(s:<AbstractRadioactiveHeat)

Returns the radioactive heat `H_r`

"""
#compute_radioactive_heat()

"""
    compute_radioactive_heat!(H_r, s:<AbstractRadioactiveHeat, z)

In-place computation of radioactive heat `H_r`

"""
#compute_radioactive_heat!()

# add methods programatically
for myType in ( :ExpDepthDependentRadioactiveHeat,
                :ConstantRadioactiveHeat)
@eval begin
(s::$(myType))(args)= s(; args...)
compute_radioactive_heat(s::$(myType), args) = s(args)
compute_radioactive_heat!(H::AbstractArray{_T,N}, s::$(myType){_T}, args) where {_T,N} = compute_radioactive_heat!(H, s; args...)
end
end

compute_radioactive_heat(args...) = compute_param(compute_radioactive_heat, args...)
compute_radioactive_heat!(args...) = compute_param!(compute_radioactive_heat, args...)

end


text:
using ViZDoom
using Test

# TODO: just check these exist instead of printing
# Type tests
println(ViZDoom.Mode)
println(ViZDoom.ScreenFormat)
println(ViZDoom.ScreenResolution)
println(ViZDoom.AutomapMode)
println(ViZDoom.Button)
println(ViZDoom.Label)
println(ViZDoom.ServerState)
println(ViZDoom.DoomGame)
# Cosnt tests
@assert ViZDoom.MAX_PLAYERS == 16
# Enum tests
@assert typeof(ViZDoom.PLAYER) == ViZDoom.Mode

# trying to access before init throws load error
try
    game = basic_game(;window_visible=false)
    # this should throw
    ViZDoom.get_screen_buffer(game)
catch LoadError
end

# this should throw nullptr: accessing after a game is over without reset
game = basic_game(;window_visible=false)
ViZDoom.init(game)
ViZDoom.new_episode(game)
while !ViZDoom.is_episode_finished(game)
    ViZDoom.make_action(game, [1.])
end
try
    ViZDoom.get_screen_buffer(game)
catch LoadError
end
try
    ViZDoom.get_automap_buffer(game)
catch LoadError
end
try
    ViZDoom.get_depth_buffer(game)
catch LoadError
end
try
    ViZDoom.get_labels_buffer(game)
catch LoadError
end

# Basic test
include("basic.jl")


text:
@inline add_dim(x) = reshape(x, (size(x)..., 1))

function upsample(input, o_size)
    h, w, c, n = size(input)
    oh, ow, _, _ = size(o_size)
    output = zeros(oh, ow, c, n)
    for i in 1:n
        if c == 1
            output[:,:,:,i] = add_dim(imresize(input[:,:,1,i], (oh, ow)))
        else
            output[:,:,:,i] = imresize(input[:, :, :, i], (oh, ow, c))
        end
    end
    return output
end

function rebnconv(in_ch::Int=3, out_ch::Int=3, dirate::Int=1)
    layers = []
    push!(layers, Conv((3, 3), in_ch => out_ch; pad=1*dirate, dilation=1*dirate))
    push!(layers, BatchNorm(out_ch, relu))
    return Tuple(layers)
end

function rebnconv_pool(in_ch=3, out_ch=3, dirate=1)
    conv = Chain(rebnconv(in_ch,out_ch,dirate)...)
    pool = MaxPool((2, 2),stride=2, pad=SamePad())

    layer = x -> begin
        x_conv = conv(x)
        x_pool = pool(x_conv)
        return x_conv, x_pool
    end
end

function rebnconv_upsample(in_ch=3, out_ch=3, dirate=1)
    conv = Chain(rebnconv(in_ch,out_ch,dirate)...)

    layer = (n, n1, n2) -> begin
        hxd = conv(cat(n2, n1; dims=3))
        return upsample(hxd, n)
    end
end