createWindow.lua 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. return {
  2. tag = 'window',
  3. summary = 'Creates the window.',
  4. description = 'Create the desktop window, usually used to mirror the headset display.',
  5. arguments = {
  6. {
  7. name = 'flags',
  8. type = 'table',
  9. description = 'Flags to customize the window\'s appearance and behavior.',
  10. table = {
  11. {
  12. name = 'width',
  13. type = 'number',
  14. default = '1080',
  15. description = 'The width of the window, or 0 to use the size of the monitor.'
  16. },
  17. {
  18. name = 'height',
  19. type = 'number',
  20. default = '600',
  21. description = 'The height of the window, or 0 to use the size of the monitor.'
  22. },
  23. {
  24. name = 'fullscreen',
  25. type = 'boolean',
  26. default = 'false',
  27. description = 'Whether the window should be fullscreen.'
  28. },
  29. {
  30. name = 'resizable',
  31. type = 'boolean',
  32. default = 'false',
  33. description = 'Whether the window should be resizable.'
  34. },
  35. {
  36. name = 'msaa',
  37. type = 'number',
  38. default = '0',
  39. description = 'The number of samples to use for multisample antialiasing.'
  40. },
  41. {
  42. name = 'title',
  43. type = 'string',
  44. default = 'LÖVR',
  45. description = 'The window title.'
  46. },
  47. {
  48. name = 'icon',
  49. type = 'string',
  50. default = 'nil',
  51. description = 'A path to an image to use for the window icon.'
  52. },
  53. {
  54. name = 'vsync',
  55. type = 'number',
  56. default = '0',
  57. description = [[
  58. 0 to disable vsync, 1 to enable. This is only a hint, and may not be respected if
  59. necessary for the current VR display.
  60. ]]
  61. }
  62. }
  63. }
  64. },
  65. returns = {},
  66. notes = [[
  67. This function can only be called once. It is normally called internally, but you can override
  68. this by setting window to `nil` in conf.lua. See `lovr.conf` for more information.
  69. The window must be created before any `lovr.graphics` functions can be used.
  70. ]],
  71. related = {
  72. 'lovr.graphics.hasWindow',
  73. 'lovr.conf'
  74. }
  75. }