Browse Source

lovr.headset.getTime;

bjorn 5 years ago
parent
commit
eb6621f17a
3 changed files with 51 additions and 0 deletions
  1. 23 0
      api/init.lua
  2. 25 0
      api/lovr/headset/getTime.lua
  3. 3 0
      api/lovr/timer/getTime.lua

File diff suppressed because it is too large
+ 23 - 0
api/init.lua


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

@@ -0,0 +1,25 @@
+return {
+  summary = 'Get the predicted display time.',
+  description = [[
+    Returns the estimated time in the future at which the light from the pixels of the current frame
+    will hit the eyes of the user.
+
+    This can be used as a replacement for `lovr.timer.getTime` for timestamps that are used for
+    rendering to get a smoother result that is synchronized with the display of the headset.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'time',
+      type = 'number',
+      description = 'The predicted display time, in seconds.'
+    }
+  },
+  notes = [[
+    This has a different epoch than `lovr.timer.getTime`, so it is not guaranteed to be close to
+    that value.
+  ]],
+  related = {
+    'lovr.timer.getTime'
+  }
+}

+ 3 - 0
api/lovr/timer/getTime.lua

@@ -11,5 +11,8 @@ return {
       type = 'number',
       description = 'The current time, in seconds.'
     }
+  },
+  related = {
+    'lovr.headset.getTime'
   }
 }

Some files were not shown because too many files changed in this diff