Explorar o código

Document a few miscellaneous functions;

bjorn hai 11 meses
pai
achega
c100e5586b
Modificáronse 3 ficheiros con 88 adicións e 0 borrados
  1. 42 0
      api/init.lua
  2. 26 0
      api/lovr/headset/getHandles.lua
  3. 20 0
      api/lovr/headset/update.lua

+ 42 - 0
api/init.lua

@@ -25355,6 +25355,31 @@ return {
             }
             }
           }
           }
         },
         },
+        {
+          name = "getHandles",
+          tag = "headset-misc",
+          summary = "Get native pointers to OpenXR objects.",
+          description = "Returns pointers to the OpenXR instance and session objects.\n\nThis can be used with FFI or other native plugins to integrate with other OpenXR code.",
+          key = "lovr.headset.getHandles",
+          module = "lovr.headset",
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "instance",
+                  type = "lightuserdata",
+                  description = "The OpenXR instance handle (`XrInstance`)."
+                },
+                {
+                  name = "session",
+                  type = "lightuserdata",
+                  description = "The OpenXR session handle (`XrSession`)."
+                }
+              }
+            }
+          }
+        },
         {
         {
           name = "getHands",
           name = "getHands",
           tag = "input",
           tag = "input",
@@ -26536,6 +26561,23 @@ return {
             }
             }
           }
           }
         },
         },
+        {
+          name = "update",
+          tag = "headset-misc",
+          summary = "Update the headset module.",
+          description = "Updates the headset module, blocking until it is time to start a new frame and polling new input states.  This should only be called once at the beginning of a frame, and is normally taken care of by the default `lovr.run` implementation.",
+          key = "lovr.headset.update",
+          module = "lovr.headset",
+          related = {
+            "lovr.headset.submit"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {}
+            }
+          }
+        },
         {
         {
           name = "vibrate",
           name = "vibrate",
           tag = "input",
           tag = "input",

+ 26 - 0
api/lovr/headset/getHandles.lua

@@ -0,0 +1,26 @@
+return {
+  tag = 'headset-misc',
+  summary = 'Get native pointers to OpenXR objects.',
+  description = [[
+    Returns pointers to the OpenXR instance and session objects.
+
+    This can be used with FFI or other native plugins to integrate with other OpenXR code.
+  ]],
+  arguments = {},
+  returns = {
+    instance = {
+      type = 'lightuserdata',
+      description = 'The OpenXR instance handle (`XrInstance`).'
+    },
+    session = {
+      type = 'lightuserdata',
+      description = 'The OpenXR session handle (`XrSession`).'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'instance', 'session' }
+    }
+  }
+}

+ 20 - 0
api/lovr/headset/update.lua

@@ -0,0 +1,20 @@
+return {
+  tag = 'headset-misc',
+  summary = 'Update the headset module.',
+  description = [[
+    Updates the headset module, blocking until it is time to start a new frame and polling new input
+    states.  This should only be called once at the beginning of a frame, and is normally taken care
+    of by the default `lovr.run` implementation.
+  ]],
+  arguments = {},
+  returns = {},
+  variants = {
+    {
+      arguments = {},
+      returns = {}
+    }
+  },
+  related = {
+    'lovr.headset.submit'
+  }
+}