Browse Source

lovr.headset.getMirrorTexture;

bjorn 6 years ago
parent
commit
d09a406930
2 changed files with 48 additions and 0 deletions
  1. 23 0
      api/init.lua
  2. 25 0
      api/lovr/headset/getMirrorTexture.lua

+ 23 - 0
api/init.lua

@@ -13934,6 +13934,29 @@ return {
             }
           }
         },
+        {
+          name = "getMirrorTexture",
+          tag = "headset",
+          summary = "Get the Texture containing a view of what's in the headset.",
+          description = "Returns a Texture that contains whatever is currently rendered to the headset.\n\nSometimes this can be `nil` if the current headset driver doesn't have a mirror texture, which can happen if the driver renders directly to the display.  Currently the `fake`, `webvr`, and `oculusmobile` drivers do not have a mirror texture.\n\nIt also isn't guaranteed that the same Texture will be returned by subsequent calls to this function.  Currently, the `oculus` driver exhibits this behavior.",
+          key = "lovr.headset.getMirrorTexture",
+          module = "lovr.headset",
+          related = {
+            "lovr.mirror"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "mirror",
+                  type = "Texture",
+                  description = "The mirror texture."
+                }
+              }
+            }
+          }
+        },
         {
           name = "getOrientation",
           tag = "headset",

+ 25 - 0
api/lovr/headset/getMirrorTexture.lua

@@ -0,0 +1,25 @@
+return {
+  tag = 'headset',
+  summary = 'Get the Texture containing a view of what\'s in the headset.',
+  description = [[
+    Returns a Texture that contains whatever is currently rendered to the headset.
+
+    Sometimes this can be `nil` if the current headset driver doesn't have a mirror texture, which
+    can happen if the driver renders directly to the display.  Currently the `fake`, `webvr`, and
+    `oculusmobile` drivers do not have a mirror texture.
+
+    It also isn't guaranteed that the same Texture will be returned by subsequent calls to this
+    function.  Currently, the `oculus` driver exhibits this behavior.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'mirror',
+      type = 'Texture',
+      description = 'The mirror texture.'
+    }
+  },
+  related = {
+    'lovr.mirror'
+  }
+}