Browse Source

lovr.headset.getDriver returns runtime name;

It also doesn't support the per-device variant.
bjorn 1 year ago
parent
commit
1b2c12c968
2 changed files with 21 additions and 38 deletions
  1. 9 19
      api/init.lua
  2. 12 19
      api/lovr/headset/getDriver.lua

+ 9 - 19
api/init.lua

@@ -22867,35 +22867,25 @@ return {
           name = "getDriver",
           tag = "headset",
           summary = "Get the VR API currently in use for a device.",
-          description = "Returns the `HeadsetDriver` that is currently in use, optionally for a specific device.  The order of headset drivers can be changed using `lovr.conf` to prefer or exclude specific VR APIs.",
+          description = "Returns the `HeadsetDriver` that is currently in use, plus the name of the VR runtime.  The order of headset drivers can be changed using `lovr.conf`.",
           key = "lovr.headset.getDriver",
           module = "lovr.headset",
+          related = {
+            "lovr.headset.getName"
+          },
           variants = {
             {
-              description = "Get the current headset driver that LÖVR is submitting frames to.",
               arguments = {},
               returns = {
                 {
                   name = "driver",
                   type = "HeadsetDriver",
-                  description = "The driver of the headset in use, e.g. \"OpenVR\"."
-                }
-              }
-            },
-            {
-              description = "Get the current input driver for a device.",
-              arguments = {
-                {
-                  name = "device",
-                  type = "Device",
-                  description = "The device to get the active driver of.  This will be the first driver that is currently returning a pose for the device."
-                }
-              },
-              returns = {
+                  description = "The current headset backend, e.g. `openxr` or `simulator`."
+                },
                 {
-                  name = "driver",
-                  type = "HeadsetDriver",
-                  description = "The driver of the headset in use, e.g. \"OpenVR\"."
+                  name = "runtime",
+                  type = "string",
+                  description = "The name of the VR runtime, e.g. `SteamVR/OpenXR`."
                 }
               }
             }

+ 12 - 19
api/lovr/headset/getDriver.lua

@@ -2,34 +2,27 @@ return {
   tag = 'headset',
   summary = 'Get the VR API currently in use for a device.',
   description = [[
-    Returns the `HeadsetDriver` that is currently in use, optionally for a specific device.  The
-    order of headset drivers can be changed using `lovr.conf` to prefer or exclude specific VR APIs.
+    Returns the `HeadsetDriver` that is currently in use, plus the name of the VR runtime.  The
+    order of headset drivers can be changed using `lovr.conf`.
   ]],
-  arguments = {
-    device = {
-      type = 'Device',
-      description = [[
-        The device to get the active driver of.  This will be the first driver that is currently
-        returning a pose for the device.
-      ]]
-    }
-  },
+  arguments = {},
   returns = {
     driver = {
       type = 'HeadsetDriver',
-      description = 'The driver of the headset in use, e.g. "OpenVR".'
+      description = 'The current headset backend, e.g. `openxr` or `simulator`.'
+    },
+    runtime = {
+      type = 'string',
+      description = 'The name of the VR runtime, e.g. `SteamVR/OpenXR`.'
     }
   },
   variants = {
     {
-      description = 'Get the current headset driver that LÖVR is submitting frames to.',
       arguments = {},
-      returns = { 'driver' }
-    },
-    {
-      description = 'Get the current input driver for a device.',
-      arguments = { 'device' },
-      returns = { 'driver' }
+      returns = { 'driver', 'runtime' }
     }
+  },
+  related = {
+    'lovr.headset.getName'
   }
 }