Browse Source

Buffer:getPointer;

unknown 3 years ago
parent
commit
36904adea4
3 changed files with 707 additions and 1808 deletions
  1. 682 1802
      api/init.lua
  2. 6 6
      api/lovr/graphics/Buffer/getFormat.lua
  3. 19 0
      api/lovr/graphics/Buffer/getPointer.lua

File diff suppressed because it is too large
+ 682 - 1802
api/init.lua


+ 6 - 6
api/lovr/graphics/Buffer/getFormat.lua

@@ -12,11 +12,6 @@ return {
       description = 'The format of the Buffer.'
     }
   },
-  related = {
-    'Buffer:getSize',
-    'Buffer:getLength',
-    'Buffer:getStride'
-  },
   example = [=[
     function lovr.load()
       buffer = lovr.graphics.newBuffer(1, { 'vec3', 'vec3', 'vec2' })
@@ -32,5 +27,10 @@ return {
       -- Field 2: Type = f32x3, Offset = 12, Location = 1
       -- Field 3: Type = f32x2, Offset = 24, Location = 2
     end
-  ]=]
+  ]=],
+  related = {
+    'Buffer:getSize',
+    'Buffer:getLength',
+    'Buffer:getStride'
+  }
 }

+ 19 - 0
api/lovr/graphics/Buffer/getPointer.lua

@@ -0,0 +1,19 @@
+return {
+  summary = 'Get a raw pointer to the Buffer\'s memory.',
+  description = [[
+    Returns a raw pointer to the Buffer's memory as a lightuserdata, intended for use with the
+    LuaJIT ffi or for passing to C libraries.  This is only available for temporary buffers, and as
+    such the pointer is only valid until `lovr.graphics.submit` is called.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'pointer',
+      type = 'lightuserdata',
+      description = 'A pointer to the Buffer\'s memory.'
+    }
+  },
+  related = {
+    'Blob:getPointer'
+  }
+}

Some files were not shown because too many files changed in this diff