renderTo.lua 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. return {
  2. tag = 'headset',
  3. summary = 'Render to the headset using a function.',
  4. description = [[
  5. Renders to each eye of the headset using a function.
  6. This function takes care of setting the appropriate graphics transformations to ensure that the
  7. scene is rendered as though it is being viewed through each eye of the player. It also takes
  8. care of setting the correct projection for the headset lenses.
  9. If the headset module is enabled, this function is called automatically by `lovr.run` with
  10. `lovr.draw` as the callback.
  11. ]],
  12. arguments = {
  13. {
  14. name = 'callback',
  15. type = 'function',
  16. arguments = {},
  17. returns = {},
  18. description = [[
  19. The function used to render. Any functions called will render to the headset instead of to
  20. the window.
  21. ]]
  22. }
  23. },
  24. returns = {},
  25. notes = [[
  26. When using the `pico` headset driver, headset rendering is asynchronous and the callback passed
  27. to `lovr.headset.renderTo` will not be called immediately.
  28. If the callback is `nil`, an empty frame cleared to current graphics background color will be
  29. submitted to the headset.
  30. ]]
  31. }