Browse Source

Merge pull request #79 from sgosselin/master

API documentation for setDisplayFrequency() and getDisplayFrequencies().
Bjorn 3 years ago
parent
commit
ea3453b0e8

+ 13 - 0
api/lovr/headset/getDisplayFrequencies.lua

@@ -0,0 +1,13 @@
+return {
+  tag = "headset",
+  summary = "Get the list of refresh rates supported by the headset display.",
+  description = "Returns a table with all the refresh rates supported by the headset display, in Hz.",
+  arguments = {},
+  returns = {
+    {
+      name = "frequencies",
+      type = "table",
+      description = "A flat table of the refresh rates supported by the headset display, nil if not supported."
+    }
+  }
+}

+ 21 - 0
api/lovr/headset/setDisplayFrequency.lua

@@ -0,0 +1,21 @@
+return {
+  tag = "headset",
+  summary = "Set the display refresh rate.",
+  description = "Sets the display refresh rate, in Hz.",
+  module = "lovr.headset",
+  arguments = {
+    {
+      name = "frequency",
+      type = "number",
+      description = "The refresh rate to set, in Hz",
+    }
+  },
+  returns = {
+    {
+      name = "success",
+      type = "boolean",
+      description = "Whether the display refresh rate was successfully set."
+    }
+  },
+  notes = "Changing the display refresh-rate also changes the frequency of lovr.update() and lovr.draw() as they depend on the display frequency."
+}