setRefreshRate.lua 832 B

12345678910111213141516171819202122232425262728293031
  1. return {
  2. tag = 'headset',
  3. summary = 'Set the display refresh rate.',
  4. description = 'Sets the display refresh rate, in Hz.',
  5. arguments = {
  6. rate = {
  7. type = 'number',
  8. description = 'The new refresh rate, in Hz.',
  9. }
  10. },
  11. returns = {
  12. success = {
  13. type = 'boolean',
  14. description = 'Whether the display refresh rate was successfully set.'
  15. }
  16. },
  17. variants = {
  18. {
  19. arguments = { 'rate' },
  20. returns = { 'success' }
  21. }
  22. },
  23. notes = [[
  24. Changing the display refresh-rate usually also changes the frequency of lovr.update() and
  25. lovr.draw() as they depend on the refresh rate. However, it's ultimately up to the VR
  26. runtime to decide how often the application gets to render, based on available resources.
  27. ]],
  28. related = {
  29. 'lovr.headset.getRefreshRates'
  30. }
  31. }