Browse Source

Texture:getFormat; rg16f; rg32f;

bjorn 7 years ago
parent
commit
cd2a0a8a58
3 changed files with 57 additions and 0 deletions
  1. 30 0
      api/init.lua
  2. 19 0
      api/lovr/graphics/Texture/getFormat.lua
  3. 8 0
      api/lovr/graphics/TextureFormat.lua

+ 30 - 0
api/init.lua

@@ -5810,6 +5810,14 @@ return {
               name = "r32f",
               description = "A 32-bit floating point format with a single color channel."
             },
+            {
+              name = "rg16f",
+              description = "A 16-bit floating point format with two color channels."
+            },
+            {
+              name = "rg32f",
+              description = "A 32-bit floating point format with two color channels."
+            },
             {
               name = "rgb5a1",
               description = "A 16 bit format with 5-bit color channels and a single alpha bit."
@@ -12383,6 +12391,28 @@ return {
                 }
               }
             },
+            {
+              name = "getFormat",
+              summary = "Get the format of the Texture.",
+              description = "Returns the format of the Texture.  This describes how many color channels are in the texture as well as the size of each one.  The most common format used is `rgba`, which contains red, green, blue, and alpha color channels.  See `TextureFormat` for all of the possible formats.",
+              key = "Texture:getFormat",
+              module = "lovr.graphics",
+              related = {
+                "TextureFormat"
+              },
+              variants = {
+                {
+                  arguments = {},
+                  returns = {
+                    {
+                      name = "format",
+                      type = "TextureFormat",
+                      description = "The format of the Texture."
+                    }
+                  }
+                }
+              }
+            },
             {
               name = "getHeight",
               summary = "Get the height of the Texture.",

+ 19 - 0
api/lovr/graphics/Texture/getFormat.lua

@@ -0,0 +1,19 @@
+return {
+  summary = 'Get the format of the Texture.',
+  description = [[
+    Returns the format of the Texture.  This describes how many color channels are in the texture
+    as well as the size of each one.  The most common format used is `rgba`, which contains red,
+    green, blue, and alpha color channels.  See `TextureFormat` for all of the possible formats.
+  ]],
+  arguments = {},
+  returns = {
+    {
+      name = 'format',
+      type = 'TextureFormat',
+      description = 'The format of the Texture.'
+    }
+  },
+  related = {
+    'TextureFormat'
+  }
+}

+ 8 - 0
api/lovr/graphics/TextureFormat.lua

@@ -34,6 +34,14 @@ return {
       name = 'r32f',
       description = 'A 32-bit floating point format with a single color channel.'
     },
+    {
+      name = 'rg16f',
+      description = 'A 16-bit floating point format with two color channels.'
+    },
+    {
+      name = 'rg32f',
+      description = 'A 32-bit floating point format with two color channels.'
+    },
     {
       name = 'rgb5a1',
       description = 'A 16 bit format with 5-bit color channels and a single alpha bit.'