Browse Source

lovr.graphics.discard;

bjorn 6 years ago
parent
commit
db9e42f442
2 changed files with 68 additions and 0 deletions
  1. 36 0
      api/init.lua
  2. 32 0
      api/lovr/graphics/discard.lua

+ 36 - 0
api/init.lua

@@ -7200,6 +7200,42 @@ return {
             }
           }
         },
+        {
+          name = "discard",
+          tag = "graphicsPrimitives",
+          summary = "Discard the current pixel values.",
+          description = "Discards pixel information in the active Canvas or display.  This is mostly used as an optimization hint for the GPU, and is usually most helpful on mobile devices.",
+          key = "lovr.graphics.discard",
+          module = "lovr.graphics",
+          related = {
+            "lovr.graphics.clear"
+          },
+          variants = {
+            {
+              arguments = {
+                {
+                  name = "color",
+                  type = "boolean",
+                  description = "Whether or not to discard color information.",
+                  default = "true"
+                },
+                {
+                  name = "depth",
+                  type = "boolean",
+                  description = "Whether or not to discard depth information.",
+                  default = "true"
+                },
+                {
+                  name = "stencil",
+                  type = "boolean",
+                  description = "Whether or not to discard stencil information.",
+                  default = "true"
+                }
+              },
+              returns = {}
+            }
+          }
+        },
         {
           name = "fill",
           tag = "graphicsPrimitives",

+ 32 - 0
api/lovr/graphics/discard.lua

@@ -0,0 +1,32 @@
+return {
+  tag = 'graphicsPrimitives',
+  summary = 'Discard the current pixel values.',
+  description = [[
+    Discards pixel information in the active Canvas or display.  This is mostly used as an
+    optimization hint for the GPU, and is usually most helpful on mobile devices.
+  ]],
+  arguments = {
+    {
+      name = 'color',
+      type = 'boolean',
+      default = 'true',
+      description = 'Whether or not to discard color information.'
+    },
+    {
+      name = 'depth',
+      type = 'boolean',
+      default = 'true',
+      description = 'Whether or not to discard depth information.'
+    },
+    {
+      name = 'stencil',
+      type = 'boolean',
+      default = 'true',
+      description = 'Whether or not to discard stencil information.'
+    }
+  },
+  returns = {},
+  related = {
+    'lovr.graphics.clear'
+  }
+}