Browse Source

lovr.graphics.flush;

bjorn 6 years ago
parent
commit
e90ed780ce
2 changed files with 33 additions and 0 deletions
  1. 18 0
      api/init.lua
  2. 15 0
      api/lovr/graphics/flush.lua

+ 18 - 0
api/init.lua

@@ -7274,6 +7274,24 @@ return {
             }
           }
         },
+        {
+          name = "flush",
+          tag = "graphicsPrimitives",
+          summary = "Flush any pending batched draw calls.",
+          description = "Flushes the internal queue of draw batches.  Under normal circumstances this is done automatically when needed, but the ability to flush manually may be helpful if you're integrating a LÖVR project with some external rendering code.",
+          key = "lovr.graphics.flush",
+          module = "lovr.graphics",
+          related = {
+            "lovr.graphics.clear",
+            "lovr.graphics.discard"
+          },
+          variants = {
+            {
+              arguments = {},
+              returns = {}
+            }
+          }
+        },
         {
           name = "getBackgroundColor",
           tag = "graphicsState",

+ 15 - 0
api/lovr/graphics/flush.lua

@@ -0,0 +1,15 @@
+return {
+  tag = 'graphicsPrimitives',
+  summary = 'Flush any pending batched draw calls.',
+  description = [[
+    Flushes the internal queue of draw batches.  Under normal circumstances this is done
+    automatically when needed, but the ability to flush manually may be helpful if you're
+    integrating a LÖVR project with some external rendering code.
+  ]],
+  arguments = {},
+  returns = {},
+  related = {
+    'lovr.graphics.clear',
+    'lovr.graphics.discard'
+  }
+}