getTime.lua 863 B

1234567891011121314151617181920212223242526272829303132
  1. return {
  2. tag = 'headset-misc',
  3. summary = 'Get the predicted display time.',
  4. description = [[
  5. Returns the estimated time in the future at which the light from the pixels of the current frame
  6. will hit the eyes of the user.
  7. This can be used as a replacement for `lovr.timer.getTime` for timestamps that are used for
  8. rendering to get a smoother result that is synchronized with the display of the headset.
  9. ]],
  10. arguments = {},
  11. returns = {
  12. time = {
  13. type = 'number',
  14. description = 'The predicted display time, in seconds.'
  15. }
  16. },
  17. variants = {
  18. {
  19. arguments = {},
  20. returns = { 'time' }
  21. }
  22. },
  23. notes = [[
  24. This has a different epoch than `lovr.timer.getTime`, so it is not guaranteed to be close to
  25. that value.
  26. ]],
  27. related = {
  28. 'lovr.headset.getDeltaTime',
  29. 'lovr.timer.getTime'
  30. }
  31. }