Browse Source

app id; ShaderBlock:read; nil BlendMode;

bjorn 6 years ago
parent
commit
17fca54fe4

+ 58 - 1
api/init.lua

@@ -4782,6 +4782,25 @@ return {
             }
             }
           }
           }
         },
         },
+        {
+          name = "getApplicationId",
+          summary = "Get the application ID.",
+          description = "Returns the platform-specific application ID, or `nil` if this does not apply.\n\nCurrently only implemented on Android.",
+          key = "lovr.filesystem.getApplicationId",
+          module = "lovr.filesystem",
+          variants = {
+            {
+              arguments = {},
+              returns = {
+                {
+                  name = "id",
+                  type = "string",
+                  description = "The application ID."
+                }
+              }
+            }
+          }
+        },
         {
         {
           name = "getDirectoryItems",
           name = "getDirectoryItems",
           summary = "Get a list of files in a directory..",
           summary = "Get a list of files in a directory..",
@@ -7353,7 +7372,7 @@ return {
           name = "getBlendMode",
           name = "getBlendMode",
           tag = "graphicsState",
           tag = "graphicsState",
           summary = "Get the blend mode.",
           summary = "Get the blend mode.",
-          description = "Returns the current blend mode.  The blend mode controls how each pixel's color is blended with the previous pixel's color when drawn.",
+          description = "Returns the current blend mode.  The blend mode controls how each pixel's color is blended with the previous pixel's color when drawn.\n\nIf blending is disabled, `nil` will be returned.",
           key = "lovr.graphics.getBlendMode",
           key = "lovr.graphics.getBlendMode",
           module = "lovr.graphics",
           module = "lovr.graphics",
           related = {
           related = {
@@ -9494,6 +9513,11 @@ return {
                 }
                 }
               },
               },
               returns = {}
               returns = {}
+            },
+            {
+              description = "Disable blending.",
+              arguments = {},
+              returns = {}
             }
             }
           }
           }
         },
         },
@@ -13294,6 +13318,39 @@ return {
                 }
                 }
               }
               }
             },
             },
+            {
+              name = "read",
+              summary = "Read a variable from the ShaderBlock.",
+              description = "Returns a variable in the ShaderBlock.",
+              key = "ShaderBlock:read",
+              module = "lovr.graphics",
+              related = {
+                "Shader:send",
+                "Shader:sendBlock",
+                "ShaderBlock:getShaderCode",
+                "ShaderBlock:getOffset",
+                "ShaderBlock:getSize"
+              },
+              variants = {
+                {
+                  arguments = {
+                    {
+                      name = "name",
+                      type = "string",
+                      description = "The name of the variable to read."
+                    }
+                  },
+                  returns = {
+                    {
+                      name = "value",
+                      type = "*",
+                      description = "The value of the variable."
+                    }
+                  }
+                }
+              },
+              notes = "This function is really slow!  Only read back values when you need to.\n\nVectors and matrices will be returned as (flat) tables."
+            },
             {
             {
               name = "send",
               name = "send",
               summary = "Update a variable in the ShaderBlock.",
               summary = "Update a variable in the ShaderBlock.",

+ 16 - 0
api/lovr/filesystem/getApplicationId.lua

@@ -0,0 +1,16 @@
+return {
+  summary = 'Get the application ID.',
+  description = [[
+    Returns the platform-specific application ID, or `nil` if this does not apply.
+
+    Currently only implemented on Android.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'id',
+      type = 'string',
+      description = 'The application ID.'
+    }
+  }
+}

+ 30 - 0
api/lovr/graphics/ShaderBlock/read.lua

@@ -0,0 +1,30 @@
+return {
+  summary = 'Read a variable from the ShaderBlock.',
+  description = 'Returns a variable in the ShaderBlock.',
+  arguments = {
+    {
+      name = 'name',
+      type = 'string',
+      description = 'The name of the variable to read.'
+    }
+  },
+  returns = {
+    {
+      name = 'value',
+      type = '*',
+      description = 'The value of the variable.'
+    }
+  },
+  notes = [[
+    This function is really slow!  Only read back values when you need to.
+
+    Vectors and matrices will be returned as (flat) tables.
+  ]],
+  related = {
+    'Shader:send',
+    'Shader:sendBlock',
+    'ShaderBlock:getShaderCode',
+    'ShaderBlock:getOffset',
+    'ShaderBlock:getSize'
+  }
+}

+ 2 - 0
api/lovr/graphics/getBlendMode.lua

@@ -4,6 +4,8 @@ return {
   description = [[
   description = [[
     Returns the current blend mode.  The blend mode controls how each pixel's color is blended with
     Returns the current blend mode.  The blend mode controls how each pixel's color is blended with
     the previous pixel's color when drawn.
     the previous pixel's color when drawn.
+
+    If blending is disabled, `nil` will be returned.
   ]],
   ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {

+ 13 - 4
api/lovr/graphics/setBlendMode.lua

@@ -6,18 +6,27 @@ return {
     previous pixel's color when drawn.
     previous pixel's color when drawn.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'blend',
+    blend = {
       type = 'BlendMode',
       type = 'BlendMode',
       description = 'The blend mode.'
       description = 'The blend mode.'
     },
     },
-    {
-      name = 'alphaBlend',
+    alphaBlend = {
       type = 'BlendAlphaMode',
       type = 'BlendAlphaMode',
       description = 'The alpha blend mode.'
       description = 'The alpha blend mode.'
     }
     }
   },
   },
   returns = {},
   returns = {},
+  variants = {
+    {
+      arguments = { 'blend', 'alphaBlend' },
+      returns = {}
+    },
+    {
+      description = 'Disable blending.',
+      arguments = {},
+      returns = {}
+    }
+  },
   related = {
   related = {
     'BlendMode',
     'BlendMode',
     'BlendAlphaMode'
     'BlendAlphaMode'