Browse Source

Fix Buffer:getData;

bjorn 1 year ago
parent
commit
41c173f81d
2 changed files with 26 additions and 5 deletions
  1. 22 3
      api/init.lua
  2. 4 2
      api/lovr/graphics/Buffer/getData.lua

+ 22 - 3
api/init.lua

@@ -12932,9 +12932,28 @@ return {
                 "Readback:getData"
               },
               variants = {
-                arguments = {},
-                returns = {
-                  "t"
+                {
+                  arguments = {
+                    {
+                      name = "index",
+                      type = "number",
+                      description = "The index of the first item to read.",
+                      default = "1"
+                    },
+                    {
+                      name = "count",
+                      type = "number",
+                      description = "The number of items to read.  If nil, reads the remainder of the buffer.",
+                      default = "nil"
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "t",
+                      type = "table",
+                      description = "The table with the Buffer's data."
+                    }
+                  }
                 }
               }
             },

+ 4 - 2
api/lovr/graphics/Buffer/getData.lua

@@ -26,8 +26,10 @@ return {
     }
   },
   variants = {
-    arguments = {},
-    returns = { 't' }
+    {
+      arguments = { 'index', 'count' },
+      returns = { 't' }
+    }
   },
   notes = [[
     The length of the table will equal the number of items read.  Here are some examples of how the