Skip to content

Commit

Permalink
🚧 Merging using vr_steamvr_rel_to_sdk_release to create OpenVR SDK v1…
Browse files Browse the repository at this point in the history
….2.10 (broken, waiting for lwjgl)
  • Loading branch information
elect86 committed Jan 31, 2019
1 parent 5656804 commit b4f1b54
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 17 deletions.
3 changes: 1 addition & 2 deletions src/main/kotlin/openvr/EventListener.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import openvr.plugin.Utils
import org.lwjgl.openvr.VRControllerState
import org.lwjgl.openvr.VREvent
import org.lwjgl.openvr.VREventController
import java.rmi.ServerError

open class EventListener {

Expand Down Expand Up @@ -86,7 +85,7 @@ open class EventListener {
ET.MouseButtonUp.i -> mouseButtonUp()
ET.FocusEnter.i -> focusEnter()
ET.FocusLeave.i -> focusLeave()
ET.Scroll.i -> scroll()
ET.ScrollDiscrete.i -> scroll()
ET.TouchPadMove.i -> {
val state = vr.VRControllerState()
val pos = when {
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/openvr/lib/direct fields.kt
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ val VREventProcess.oldPid: Int
get() = VREventProcess.noldPid(adr)
val VREventProcess.forced: Boolean
get() = VREventProcess.nbForced(adr)
/** If the associated event was triggered by a connection loss */
val VREventProcess.connectionLost: Boolean
get() = VREventProcess.nbConnectionLost(adr)


val VREventOverlay.overlayHandle: Ptr
Expand Down
112 changes: 107 additions & 5 deletions src/main/kotlin/openvr/lib/enums.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ enum class TrackingUniverseOrigin(@JvmField val i: Int) {
}
}

enum class AdditionalRadioFeatures(@JvmField val i: Int) {
None(0x00000000),
HTCLinkBox(0x00000001),
InternalDongle(0x00000002),
ExternalDongle(0x00000004)
}

/** Each entry in this value represents a property that can be retrieved about a tracked device.
* Many fields are only valid for one openvr.lib.TrackedDeviceClass. */
enum class TrackedDeviceProperty(@JvmField val i: Int) {
Expand Down Expand Up @@ -200,6 +207,7 @@ enum class TrackedDeviceProperty(@JvmField val i: Int) {
AdditionalDeviceSettingsPath_String(1042),
/** Whether device supports being identified from vrmonitor (e.g. blink LED, vibrate haptics, etc) */
Identifiable_Bool(1043),
BootloaderVersion_Uint64(1044),

// Properties that are unique to TrackedDeviceClass_HMD
ReportsTimeSinceVSync_Bool(2000),
Expand Down Expand Up @@ -276,6 +284,15 @@ enum class TrackedDeviceProperty(@JvmField val i: Int) {
ImuFactoryAccelerometerScale_Vector3(2067),
// reserved 2068
ConfigurationIncludesLighthouse20Features_Bool(2069),
AdditionalRadioFeatures_Uint64(2070),
/** Prop_NumCameras_Int32-sized array of float[4] RGBG white balance calibration data (max size is vr::k_unMaxCameras) */
CameraWhiteBalance_Vector4_Array(2071),
/** Prop_NumCameras_Int32-sized array of vr::EVRDistortionFunctionType values (max size is vr::k_unMaxCameras) */
CameraDistortionFunction_Int32_Array(2072),
/** Prop_NumCameras_Int32-sized array of double[vr::k_unMaxDistortionFunctionParameters] (max size is vr::k_unMaxCameras) */
CameraDistortionCoefficients_Float_Array(2073),
ExpectedControllerType_String(2074),

// Driver requested mura correction properties
DriverRequestedMuraCorrectionMode_Int32(2200),
DriverRequestedMuraFeather_InnerLeft_Int32(2201),
Expand Down Expand Up @@ -493,15 +510,17 @@ enum class VREventType(@JvmField val i: Int) {
FocusEnter(303),
/** data is overlay */
FocusLeave(304),
/** data is mouse */
Scroll(305),
/** data is scroll */
ScrollDiscrete(305),
/** data is mouse */
TouchPadMove(306),
/** data is overlay, global event */
OverlayFocusChanged(307),
ReloadOverlays(308),
/** data is scroll */
ScrollSmooth(309),
/** JVM openvr custom */
HairTriggerMove(309),
HairTriggerMove(310),

/** data is process DEPRECATED */
InputFocusCaptured(400),
Expand Down Expand Up @@ -629,6 +648,7 @@ enum class VREventType(@JvmField val i: Int) {
WebInterfaceSectionSettingChanged(865),
TrackersSectionSettingChanged(866),
LastKnownSectionSettingChanged(867),
DismissedWarningsSectionSettingChanged(868),

StatusUpdate(900),

Expand Down Expand Up @@ -683,6 +703,7 @@ enum class VREventType(@JvmField val i: Int) {
/** data is progressUpdate */
ProgressUpdate(1705),
Input_TrackerActivated(1706),
Input_BindingsUpdated(1707),
/** data is spatialAnchor. broadcast */
SpatialAnchors_PoseUpdated(1800),
/** data is spatialAnchor. broadcast */
Expand Down Expand Up @@ -792,7 +813,8 @@ enum class DualAnalogWhich {
}
}

enum class ShowUiType { ControllerBinding, ManageTrackers, QuickStart;
enum class ShowUiType {
ControllerBinding, ManageTrackers, QuickStart, Pairing;

@JvmField
val i = ordinal
Expand Down Expand Up @@ -998,6 +1020,85 @@ enum class VRInitError(@JvmField val i: Int) {
Compositor_OverlayInitFailed(403),
Compositor_ScreenshotsInitFailed(404),
Compositor_UnableToCreateDevice(405),
Compositor_SharedStateIsNull(406),
Compositor_NotificationManagerIsNull(407),
Compositor_ResourceManagerClientIsNull(408),
Compositor_MessageOverlaySharedStateInitFailure(409),
Compositor_PropertiesInterfaceIsNull(410),
Compositor_CreateFullscreenWindowFailed(411),
Compositor_SettingsInterfaceIsNull(412),
Compositor_FailedToShowWindow(413),
Compositor_DistortInterfaceIsNull(414),
Compositor_DisplayFrequencyFailure(415),
Compositor_RendererInitializationFailed(416),
Compositor_DXGIFactoryInterfaceIsNull(417),
Compositor_DXGIFactoryCreateFailed(418),
Compositor_DXGIFactoryQueryFailed(419),
Compositor_InvalidAdapterDesktop(420),
Compositor_InvalidHmdAttachment(421),
Compositor_InvalidOutputDesktop(422),
Compositor_InvalidDeviceProvided(423),
Compositor_D3D11RendererInitializationFailed(424),
Compositor_FailedToFindDisplayMode(425),
Compositor_FailedToCreateSwapChain(426),
Compositor_FailedToGetBackBuffer(427),
Compositor_FailedToCreateRenderTarget(428),
Compositor_FailedToCreateDXGI2SwapChain(429),
Compositor_FailedtoGetDXGI2BackBuffer(430),
Compositor_FailedToCreateDXGI2RenderTarget(431),
Compositor_FailedToGetDXGIDeviceInterface(432),
Compositor_SelectDisplayMode(433),
Compositor_FailedToCreateNvAPIRenderTargets(434),
Compositor_NvAPISetDisplayMode(435),
Compositor_FailedToCreateDirectModeDisplay(436),
Compositor_InvalidHmdPropertyContainer(437),
Compositor_UpdateDisplayFrequency(438),
Compositor_CreateRasterizerState(439),
Compositor_CreateWireframeRasterizerState(440),
Compositor_CreateSamplerState(441),
Compositor_CreateClampToBorderSamplerState(442),
Compositor_CreateAnisoSamplerState(443),
Compositor_CreateOverlaySamplerState(444),
Compositor_CreatePanoramaSamplerState(445),
Compositor_CreateFontSamplerState(446),
Compositor_CreateNoBlendState(447),
Compositor_CreateBlendState(448),
Compositor_CreateAlphaBlendState(449),
Compositor_CreateBlendStateMaskR(450),
Compositor_CreateBlendStateMaskG(451),
Compositor_CreateBlendStateMaskB(452),
Compositor_CreateDepthStencilState(453),
Compositor_CreateDepthStencilStateNoWrite(454),
Compositor_CreateDepthStencilStateNoDepth(455),
Compositor_CreateFlushTexture(456),
Compositor_CreateDistortionSurfaces(457),
Compositor_CreateConstantBuffer(458),
Compositor_CreateHmdPoseConstantBuffer(459),
Compositor_CreateHmdPoseStagingConstantBuffer(460),
Compositor_CreateSharedFrameInfoConstantBuffer(461),
Compositor_CreateOverlayConstantBuffer(462),
Compositor_CreateSceneTextureIndexConstantBuffer(463),
Compositor_CreateReadableSceneTextureIndexConstantBuffer(464),
Compositor_CreateLayerGraphicsTextureIndexConstantBuffer(465),
Compositor_CreateLayerComputeTextureIndexConstantBuffer(466),
Compositor_CreateLayerComputeSceneTextureIndexConstantBuffer(467),
Compositor_CreateComputeHmdPoseConstantBuffer(468),
Compositor_CreateGeomConstantBuffer(469),
Compositor_CreatePanelMaskConstantBuffer(470),
Compositor_CreatePixelSimUBO(471),
Compositor_CreateMSAARenderTextures(472),
Compositor_CreateResolveRenderTextures(473),
Compositor_CreateComputeResolveRenderTextures(474),
Compositor_CreateDriverDirectModeResolveTextures(475),
Compositor_OpenDriverDirectModeResolveTextures(476),
Compositor_CreateFallbackSyncTexture(477),
Compositor_ShareFallbackSyncTexture(478),
Compositor_CreateOverlayIndexBuffer(479),
Compositor_CreateOverlayVertextBuffer(480),
Compositor_CreateTextVertexBuffer(481),
Compositor_CreateTextIndexBuffer(482),
Compositor_CreateMirrorTextures(483),
Compositor_CreateLastFrameRenderTexture(484),

VendorSpecific_UnableToConnectToOculusRuntime(1000),
VendorSpecific_WindowsNotInDevMode(1001),
Expand Down Expand Up @@ -1041,7 +1142,8 @@ enum class VSync {
NoWaitRender
}

enum class VRMuraCorrectionMode { Default, NoCorrection;
enum class VRMuraCorrectionMode {
Default, NoCorrection;

@JvmField
val i = ordinal
Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/openvr/lib/ivrIOBuffer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ object vrIOBuffer : vrInterface {
/** Retrieves the property container of a buffer. */
infix fun propertyContainer(buffer: IOBufferHandle): PropertyContainerHandle = VRIOBuffer_PropertyContainer(buffer)

/** inexpensively checks for readers to allow writers to fast-fail potentially expensive copies and writes. */
fun hasReaders(buffer: IOBufferHandle): Boolean = VRIOBuffer_HasReaders(buffer)

override val version: String
get() = "IVRIOBuffer_001"
get() = "IVRIOBuffer_002"
}
13 changes: 10 additions & 3 deletions src/main/kotlin/openvr/lib/ivrOverlay.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ object vrOverlay : vrInterface {
/** Indicates that the overlay should dim/brighten to show gamepad focus */
ShowGamepadFocus(5),

/** When in VROverlayInputMethod_Mouse you can optionally enable sending VRScroll */
SendVRScrollEvents(6),
/** When this is set the overlay will receive VREvent_ScrollDiscrete events like a mouse wheel.
* Requires mouse input mode. */
SendVRDiscreteScrollEvents(6),

/** Indicates that the overlay would like to receive */
SendVRTouchpadEvents(7),

/** If set this will render a vertical scroll wheel on the primary controller), only needed if not using
Expand Down Expand Up @@ -172,7 +175,11 @@ object vrOverlay : vrInterface {

/** If this is set and the overlay's input method is not none, the system-wide laser mouse
* mode will be activated whenever this overlay is visible. */
MakeOverlaysInteractiveIfVisible(16);
MakeOverlaysInteractiveIfVisible(16),

/** If this is set the overlay will receive smooth VREvent_ScrollSmooth that emulate trackpad scrolling.
* Requires mouse input mode. */
SendVRSmoothScrollEvents(17);

companion object {
infix fun of(i: Int) = values().first { it.i == i }
Expand Down
15 changes: 11 additions & 4 deletions src/main/kotlin/openvr/lib/ivrSettings.kt
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,6 @@ object vrSettings : vrInterface {
get() = getBool(section, "debugInput")
set(value) = setBool(section, "debugInput", value)

var legacyInputRebinding: Boolean
get() = getBool(section, "legacyInputRebinding")
set(value) = setBool(section, "legacyInputRebinding", value)

var debugInputBinding: Boolean
get() = getBool(section, "debugInputBinding")
set(value) = setBool(section, "debugInputBinding", value)
Expand All @@ -261,6 +257,14 @@ object vrSettings : vrInterface {
var preferredRefreshRate: String
get() = getString(section, "preferredRefreshRate")
set(value) = setString(section, "preferredRefreshRate", value)

var lastVersionNotice: String // TODO check type
get() = getString(section, "lastVersionNotice")
set(value) = setString(section, "lastVersionNotice", value)

var lastVersionNoticeDate: String // TODO check type
get() = getString(section, "lastVersionNoticeDate")
set(value) = setString(section, "lastVersionNoticeDate", value)
}

object directMode {
Expand Down Expand Up @@ -711,6 +715,9 @@ object vrSettings : vrInterface {
set(value) = setString(section, "HMDModel", value)
}

// Dismissed warnings
// static const char * const k_pch_DismissedWarnings_Section = "DismissedWarnings";

/**
* Returns true if file sync occurred (force or settings dirty).
*
Expand Down
5 changes: 3 additions & 2 deletions src/main/kotlin/openvr/lib/openvr.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import org.lwjgl.system.MemoryUtil.*
object vr {

const val steamVrVersionMajor = 1
const val steamVrVersionMinor = 1
const val steamVrVersionBuild = "3b"
const val steamVrVersionMinor = 2
const val steamVrVersionBuild = 10

const val steamVrVersion = "$steamVrVersionMajor.$steamVrVersionMinor.$steamVrVersionBuild beta 00"

Expand Down Expand Up @@ -141,6 +141,7 @@ object vr {

const val spatialAnchorPosePropertyTag = 40
const val jsonPropertyTag = 41
const val activeActionSetPropertyTag = 42

const val openVRInternalReserved_Start: PropertyTypeTag = 1000
const val openVRInternalReserved_End: PropertyTypeTag = 10000
Expand Down

0 comments on commit b4f1b54

Please sign in to comment.