Browse Source

More docs;

bjorn 3 years ago
parent
commit
cd10c22ce1

File diff suppressed because it is too large
+ 277 - 263
api/init.lua


+ 2 - 3
api/lovr/event/push.lua

@@ -10,8 +10,7 @@ return {
       type = 'string',
       type = 'string',
       description = 'The name of the event.'
       description = 'The name of the event.'
     },
     },
-    {
-      name = '...',
+    ['...'] = {
       type = '*',
       type = '*',
       description = 'The arguments for the event.  Currently, up to 4 are supported.'
       description = 'The arguments for the event.  Currently, up to 4 are supported.'
     }
     }
@@ -19,7 +18,7 @@ return {
   returns = {},
   returns = {},
   variants = {
   variants = {
     {
     {
-      arguments = { 'name' },
+      arguments = { 'name', '...' },
       returns = {}
       returns = {}
     }
     }
   },
   },

+ 14 - 4
api/lovr/graphics/Font/getAscent.lua

@@ -1,15 +1,25 @@
 return {
 return {
   summary = 'Get the ascent of the Font.',
   summary = 'Get the ascent of the Font.',
-  description = 'TODO',
+  description = [[
+    Returns the ascent of the font.  The ascent is the maximum amount glyphs ascend above the
+    baseline.  The units depend on the font's pixel density.  With the default density, the units
+    correspond to meters.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'ascent',
+    ascent = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The ascent of the font.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'ascent' }
     }
     }
   },
   },
   related = {
   related = {
+    'Rasterizer:getAscent',
     'Font:getDescent',
     'Font:getDescent',
     'Font:getHeight',
     'Font:getHeight',
     'Font:getKerning',
     'Font:getKerning',

+ 7 - 2
api/lovr/graphics/Font/getDescent.lua

@@ -1,15 +1,20 @@
 return {
 return {
   summary = 'Get the descent of the Font.',
   summary = 'Get the descent of the Font.',
-  description = 'TODO',
+  description = [[
+    Returns the descent of the font.  The descent is the maximum amount glyphs descend below the
+    baseline.  The units depend on the font's pixel density.  With the default density, the units
+    correspond to meters.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     {
     {
       name = 'descent',
       name = 'descent',
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The descent of the font.'
     }
     }
   },
   },
   related = {
   related = {
+    'Rasterizer:getDescent',
     'Font:getAscent',
     'Font:getAscent',
     'Font:getHeight',
     'Font:getHeight',
     'Font:getKerning',
     'Font:getKerning',

+ 10 - 2
api/lovr/graphics/Font/getHeight.lua

@@ -1,15 +1,23 @@
 return {
 return {
   summary = 'Get the height of the Font.',
   summary = 'Get the height of the Font.',
-  description = 'TODO',
+  description = [[
+    Returns the height of the font, sometimes also called the leading.  This is the full height of a
+    line of text, including the space between lines.  Each line of a multiline string is separated
+    on the y axis by this height, multiplied by the font's line spacing.  The units depend on the
+    font's pixel density.  With the default density, the units correspond to meters.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     {
     {
       name = 'height',
       name = 'height',
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The height of the font.'
     }
     }
   },
   },
   related = {
   related = {
+    'Rasterizer:getLeading',
+    'Font:getLineSpacing',
+    'Font:setLineSpacing',
     'Font:getAscent',
     'Font:getAscent',
     'Font:getDescent',
     'Font:getDescent',
     'Font:getKerning',
     'Font:getKerning',

+ 42 - 13
api/lovr/graphics/Font/getKerning.lua

@@ -1,26 +1,55 @@
 return {
 return {
-  summary = 'Get the kerning of the Font.',
-  description = 'TODO',
+  summary = 'Get the kerning between 2 glyphs.',
+  description = [[
+    Returns the kerning between 2 glyphs.  Kerning is a slight horizontal adjustment between 2
+    glyphs to improve the visual appearance.  It will often be negative.  The units depend on the
+    font's pixel density.  With the default density, the units correspond to meters.
+  ]],
   arguments = {
   arguments = {
-    {
-      name = 'first',
-      type = 'Codepoint',
-      description = 'TODO'
+    first = {
+      type = 'string',
+      description = 'The first character.'
     },
     },
-    {
-      name = 'second',
-      type = 'Codepoint',
-      description = 'TODO'
+    firstCodepoint = {
+      type = 'number',
+      description = 'The first codepoint.'
+    },
+    second = {
+      type = 'string',
+      description = 'The second letter.'
+    },
+    secondCodepoint = {
+      name = 'secondCodepoint',
+      type = 'number',
+      description = 'The second codepoint.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'kerning',
+    keming = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The kerning between the two glyphs.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'first', 'second' },
+      returns = { 'keming' }
+    },
+    {
+      arguments = { 'firstCodepoint', 'second' },
+      returns = { 'keming' }
+    },
+    {
+      arguments = { 'first', 'secondCodepoint' },
+      returns = { 'keming' }
+    },
+    {
+      arguments = { 'firstCodepoint', 'secondCodepoint' },
+      returns = { 'keming' }
     }
     }
   },
   },
   related = {
   related = {
+    'Rasterizer:getKerning',
     'Font:getAscent',
     'Font:getAscent',
     'Font:getDescent',
     'Font:getDescent',
     'Font:getHeight',
     'Font:getHeight',

+ 16 - 5
api/lovr/graphics/Font/getLineSpacing.lua

@@ -1,12 +1,23 @@
 return {
 return {
-  summary = 'Set the pixel density of the Font.',
-  description = 'TODO',
+  summary = 'Get the line spacing of the Font.',
+  description = [[
+    Returns the line spacing of the Font.  When spacing out lines, the height of the font is
+    multiplied the line spacing to get the final spacing value.  The default is 1.0.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
-    {
-      name = 'spacing',
+    spacing = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The line spacing of the font.'
+    }
+  },
+  variants = {
+    {
+      arguments = {},
+      returns = { 'spacing' }
     }
     }
+  },
+  related = {
+    'Font:getHeight'
   }
   }
 }
 }

+ 30 - 12
api/lovr/graphics/Font/getLines.lua

@@ -1,23 +1,41 @@
 return {
 return {
-  summary = 'Turn a long string into a sequence of wrapped lines.',
-  description = 'TODO',
+  summary = 'Wrap a string into a sequence of lines.',
+  description = [[
+    Returns a table of wrapped lines for a piece of text, given a line length limit.  Newlines are
+    handled correctly.  The wrap limit units depend on the pixel density of the font.  With the
+    default pixel density, the units correspond to meters when the font is drawn at 1.0 scale.
+  ]],
   arguments = {
   arguments = {
-    {
-      name = 'text',
-      type = 'Text',
-      description = 'TODO'
+    string = {
+      type = 'string',
+      description = 'The text to wrap.'
     },
     },
-    {
-      name = 'wrap',
+    strings = {
+      type = 'table',
+      description = [[
+        A table of colored strings, each given as a `{ color, string }` pair.  The color can be a
+        `Vec3`, `Vec4`, table, or hexcode.
+      ]]
+    },
+    wrap = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The line length to wrap at.'
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = 'lines',
+    lines = {
       type = 'table',
       type = 'table',
-      description = 'TODO'
+      description = 'A table strings, one for each wrapped line (without any color information).'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'string', 'wrap' },
+      returns = { 'lines' }
+    },
+    {
+      arguments = { 'strings', 'wrap' },
+      returns = { 'lines' }
     }
     }
   },
   },
   related = {
   related = {

+ 12 - 2
api/lovr/graphics/Font/getPixelDensity.lua

@@ -1,12 +1,22 @@
 return {
 return {
   summary = 'Get the pixel density of the Font.',
   summary = 'Get the pixel density of the Font.',
-  description = 'TODO',
+  description = [[
+    Returns the pixel density of the font.  The density is a "pixels per world unit" factor that
+    controls how the pixels in the font's texture are mapped to units in the coordinate space.
+
+    The default pixel density is set to the height of the font.  This means that lines of text
+    rendered with a scale of 1.0 come out to 1 unit (meter) tall.  However, if this font was drawn
+    to a 2D texture where the units are in pixels, the font would still be drawn 1 unit (pixel)
+    tall!  Scaling the coordinate space or the size of the text by the height of the font would fix
+    this.  However, a more convenient option is to set the pixel density of the font to 1.0 when
+    doing 2D rendering to make the font's size match up with the pixels of the canvas.
+  ]],
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     {
     {
       name = 'density',
       name = 'density',
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The pixel density of the font.'
     }
     }
   }
   }
 }
 }

+ 1 - 1
api/lovr/graphics/Font/getRasterizer.lua

@@ -1,6 +1,6 @@
 return {
 return {
   summary = 'Get the Font\'s Rasterizer.',
   summary = 'Get the Font\'s Rasterizer.',
-  description = 'TODO',
+  description = 'Returns the Rasterizer object backing the Font.',
   arguments = {},
   arguments = {},
   returns = {
   returns = {
     {
     {

+ 20 - 11
api/lovr/graphics/Font/getVertices.lua

@@ -2,29 +2,38 @@ return {
   summary = 'Get the vertices for a piece of text.',
   summary = 'Get the vertices for a piece of text.',
   description = [[
   description = [[
     Returns a table of vertices for a piece of text, along with a Material to use when rendering it.
     Returns a table of vertices for a piece of text, along with a Material to use when rendering it.
-    The Material may change over time if the Font's texture atlas needs to be resized to make room
-    for more glyphs.
+    The Material returned by this function may not be the same if the Font's texture atlas needs to
+    be recreated with a bigger size to make room for more glyphs.
   ]],
   ]],
   arguments = {
   arguments = {
-    {
-      name = 'text',
-      type = 'Text',
-      description = 'TODO'
+    string = {
+      type = 'string',
+      description = 'The text to render.'
     },
     },
-    {
-      name = 'wrap',
+    strings = {
+      type = 'table',
+      description = [[
+        A table of colored strings, each given as a `{ color, string }` pair.  The color can be a
+        `Vec3`, `Vec4`, table, or hexcode.
+      ]]
+    },
+    wrap = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      default = '0',
+      description = [[
+        The maximum line length.  The units depend on the pixel density of the font, but are in
+        meters by default.
+      ]]
     },
     },
     {
     {
       name = 'halign',
       name = 'halign',
       type = 'HorizontalAlign',
       type = 'HorizontalAlign',
-      description = 'TODO'
+      description = 'The horizontal align.'
     },
     },
     {
     {
       name = 'valign',
       name = 'valign',
       type = 'VerticalAlign',
       type = 'VerticalAlign',
-      description = 'TODO'
+      description = 'The vertical align.'
     }
     }
   },
   },
   returns = {
   returns = {

+ 27 - 9
api/lovr/graphics/Font/getWidth.lua

@@ -1,18 +1,36 @@
 return {
 return {
   summary = 'Get the width of rendered text.',
   summary = 'Get the width of rendered text.',
-  description = 'TODO',
+  description = [[
+    Returns the maximum width of a piece of text.  This function does not perform wrapping but does
+    respect newlines in the text.
+  ]],
   arguments = {
   arguments = {
-    {
-      name = 'text',
-      type = 'Text',
-      description = 'TODO'
-    }
+    string = {
+      type = 'string',
+      description = 'The text to measure.'
+    },
+    strings = {
+      type = 'table',
+      description = [[
+        A table of colored strings, each given as a `{ color, string }` pair.  The color can be a
+        `Vec3`, `Vec4`, table, or hexcode.
+      ]]
+    },
   },
   },
   returns = {
   returns = {
-    {
-      name = 'width',
+    width = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The maximum width of the text.'
+    }
+  },
+  variants = {
+    {
+      arguments = { 'string' },
+      returns = { 'width' }
+    },
+    {
+      arguments = { 'strings' },
+      returns = { 'width' }
     }
     }
   },
   },
   related = {
   related = {

+ 16 - 5
api/lovr/graphics/Font/setLineSpacing.lua

@@ -1,12 +1,23 @@
 return {
 return {
   summary = 'Set the line spacing of the Font.',
   summary = 'Set the line spacing of the Font.',
-  description = 'TODO',
+  description = [[
+    Sets the line spacing of the Font.  When spacing out lines, the height of the font is multiplied
+    the line spacing to get the final spacing value.  The default is 1.0.
+  ]],
   arguments = {
   arguments = {
-    {
-      name = 'spacing',
+    spacing = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The new line spacing.'
+    }
+  },
+  returns = {},
+  variants = {
+    {
+      arguments = { 'spacing' },
+      returns = {}
     }
     }
   },
   },
-  returns = {}
+  related = {
+    'Font:getHeight'
+  }
 }
 }

+ 25 - 5
api/lovr/graphics/Font/setPixelDensity.lua

@@ -1,12 +1,32 @@
 return {
 return {
   summary = 'Set the pixel density of the Font.',
   summary = 'Set the pixel density of the Font.',
-  description = 'TODO',
+  description = [[
+    Returns the pixel density of the font.  The density is a "pixels per world unit" factor that
+    controls how the pixels in the font's texture are mapped to units in the coordinate space.
+
+    The default pixel density is set to the height of the font.  This means that lines of text
+    rendered with a scale of 1.0 come out to 1 unit (meter) tall.  However, if this font was drawn
+    to a 2D texture where the units are in pixels, the font would still be drawn 1 unit (pixel)
+    tall!  Scaling the coordinate space or the size of the text by the height of the font would fix
+    this.  However, a more convenient option is to set the pixel density of the font to 1.0 when
+    doing 2D rendering to make the font's size match up with the pixels of the canvas.
+  ]],
   arguments = {
   arguments = {
-    {
-      name = 'density',
+    density = {
       type = 'number',
       type = 'number',
-      description = 'TODO'
+      description = 'The new pixel density of the font.'
     }
     }
   },
   },
-  returns = {}
+  returns = {},
+  variants = {
+    {
+      arguments = { 'density' },
+      returns = {}
+    },
+    {
+      description = 'Resets the pixel density to the default, which is given by `Font:getHeight`.',
+      arguments = {},
+      returns = {}
+    }
+  }
 }
 }

+ 18 - 4
api/lovr/graphics/MeshMode.lua

@@ -1,18 +1,32 @@
 return {
 return {
   summary = 'Different ways to draw mesh vertices.',
   summary = 'Different ways to draw mesh vertices.',
-  description = 'TODO',
+  description = [[
+    Different ways vertices in a mesh can be connected together and filled in with pixels.
+  ]],
   values = {
   values = {
     {
     {
       name = 'points',
       name = 'points',
-      description = 'TODO'
+      description = [[
+        Each vertex is rendered as a single point.  The size of the point can be controlled using
+        the `pointSize` shader flag, or by writing to the `PointSize` variable in shaders.  The
+        maximum point size is given by the `pointSize` limit from `lovr.graphics.getLimits`.
+      ]]
     },
     },
     {
     {
       name = 'lines',
       name = 'lines',
-      description = 'TODO'
+      description = [[
+        Pairs of vertices are connected with line segments.  To draw a single line through all of
+        the vertices, an index buffer can be used to repeat vertices.  It is not currently possible
+        to change the width of the lines, although cylinders or capsules can be used as an
+        alternative.
+      ]]
     },
     },
     {
     {
       name = 'triangles',
       name = 'triangles',
-      description = 'TODO'
+      description = [[
+        Every 3 vertices form a triangle, which is filled in with pixels (unless `Pass:setWireframe`
+        is used).  This mode is the most commonly used.
+      ]]
     }
     }
   }
   }
 }
 }

+ 11 - 4
api/lovr/graphics/Pass/box.lua

@@ -1,12 +1,17 @@
 return {
 return {
   tag = 'drawing',
   tag = 'drawing',
   summary = 'Draw a box.',
   summary = 'Draw a box.',
-  description = 'TODO',
+  description = [[
+    Draw a box.  This is like `Pass:cube`, except it takes 3 separate values for the scale.
+  ]],
   arguments = {
   arguments = {
     {
     {
       name = 'transform',
       name = 'transform',
-      type = 'Transform3',
-      description = 'The transform to apply to the box.'
+      type = 'Mat4',
+      description = [[
+        The transform of the box.  Can also be provided as position, scale, and rotation using a mix
+        of `Vectors` or numbers.  When using numbers for the scale, 3 numbers are used.
+      ]]
     },
     },
     {
     {
       name = 'style',
       name = 'style',
@@ -16,5 +21,7 @@ return {
     }
     }
   },
   },
   returns = {},
   returns = {},
-  notes = 'TODO'
+  related = {
+    'Pass:cube'
+  }
 }
 }

+ 21 - 9
api/lovr/graphics/Pass/capsule.lua

@@ -1,39 +1,51 @@
 return {
 return {
   tag = 'drawing',
   tag = 'drawing',
   summary = 'Draw a capsule.',
   summary = 'Draw a capsule.',
-  description = 'TODO',
+  description = [[
+    Draws a capsule.  A capsule is shaped like a cylinder with a hemisphere on each end.
+  ]],
   arguments = {
   arguments = {
     transform = {
     transform = {
-      type = 'TransformXY2',
+      type = 'Mat4',
       description = [[
       description = [[
-        The transform to apply to the capsule.  The x and y scale is the radius, the z scale is the
-        length.
+        The transform of the capsule.  Can also be provided as position, radius, length, and
+        rotation using a mix of `Vectors` or numbers.  When using a `Vec3` for the scale, the X and
+        Y components are used for the radius and the Z component is used for the length.
       ]]
       ]]
     },
     },
     p1 = {
     p1 = {
-      type = 'Point3',
+      type = 'Vec3',
       description = 'The starting point of the capsule.'
       description = 'The starting point of the capsule.'
     },
     },
     p2 = {
     p2 = {
-      type = 'Point3',
+      type = 'Vec3',
       description = 'The ending point of the capsule.'
       description = 'The ending point of the capsule.'
     },
     },
+    radius = {
+      type = 'number',
+      default = '1.0',
+      description = 'The radius of the capsule.'
+    },
     segments = {
     segments = {
       type = 'number',
       type = 'number',
       default = '32',
       default = '32',
       description = 'The number of circular segments to render.'
       description = 'The number of circular segments to render.'
     }
     }
   },
   },
+  returns = {},
   variants = {
   variants = {
     {
     {
       arguments = { 'transform', 'segments' },
       arguments = { 'transform', 'segments' },
       returns = {}
       returns = {}
     },
     },
     {
     {
-      arguments = { 'p1', 'p2', 'segments' },
+      description = 'Draws a capsule between two points.',
+      arguments = { 'p1', 'p2', 'radius', 'segments' },
       returns = {}
       returns = {}
     }
     }
   },
   },
-  returns = {},
-  notes = 'TODO'
+  notes = [[
+    The length of the capsule does not include the end caps.  The local origin of the capsule is in
+    the center, and the local z axis points towards the end caps.
+  ]]
 }
 }

+ 9 - 4
api/lovr/graphics/Pass/circle.lua

@@ -1,12 +1,15 @@
 return {
 return {
   tag = 'drawing',
   tag = 'drawing',
   summary = 'Draw a circle.',
   summary = 'Draw a circle.',
-  description = 'TODO',
+  description = 'Draws a circle.',
   arguments = {
   arguments = {
     {
     {
       name = 'transform',
       name = 'transform',
-      type = 'Transform',
-      description = 'The transform to apply to the circle.'
+      type = 'Mat4',
+      description = [[
+        The transform of the circle.  Can also be provided as position, radius, and rotation, using
+        a mix of `Vectors` or numbers.  When using numbers for the scale, 1 number is used.
+      ]]
     },
     },
     {
     {
       name = 'style',
       name = 'style',
@@ -34,5 +37,7 @@ return {
     }
     }
   },
   },
   returns = {},
   returns = {},
-  notes = 'TODO'
+  notes = [[
+    The local origin of the circle is in its center, and the local z axis goes through the center.
+  ]]
 }
 }

+ 6 - 2
api/lovr/graphics/Pass/cylinder.lua

@@ -1,7 +1,7 @@
 return {
 return {
   tag = 'drawing',
   tag = 'drawing',
   summary = 'Draw a cylinder.',
   summary = 'Draw a cylinder.',
-  description = 'TODO',
+  description = 'Draws a cylinder.',
   arguments = {
   arguments = {
     transform = {
     transform = {
       type = 'TransformXY2',
       type = 'TransformXY2',
@@ -18,6 +18,10 @@ return {
       type = 'Point3',
       type = 'Point3',
       description = 'The ending point of the cylinder.'
       description = 'The ending point of the cylinder.'
     },
     },
+    radius = {
+      type = 'number',
+      description = 'The radius of the cylinder.'
+    },
     capped = {
     capped = {
       type = 'boolean',
       type = 'boolean',
       default = 'true',
       default = 'true',
@@ -45,7 +49,7 @@ return {
       returns = {}
       returns = {}
     },
     },
     {
     {
-      arguments = { 'p1', 'p2', 'capped', 'angle1', 'angle2', 'segments' },
+      arguments = { 'p1', 'p2', 'radius', 'capped', 'angle1', 'angle2', 'segments' },
       returns = {}
       returns = {}
     }
     }
   },
   },

+ 26 - 7
api/lovr/graphics/compileShader.lua

@@ -1,30 +1,49 @@
 return {
 return {
   tag = 'graphics-objects',
   tag = 'graphics-objects',
-  summary = 'Compile a Shader.',
-  description = 'TODO',
+  summary = 'Compile a Shader to bytecode.',
+  description = [[
+    Compiles shader code to SPIR-V bytecode.  The bytecode can be passed to
+    `lovr.graphics.newShader` to create shaders, which will be faster than creating it from GLSL.
+    The bytecode is portable, so bytecode compiled on one platform will work on other platforms.
+    This allows shaders to be precompiled in a build step.
+  ]],
   arguments = {
   arguments = {
     stage = {
     stage = {
       type = 'ShaderStage',
       type = 'ShaderStage',
-      description = 'TODO'
+      description = 'The type of shader to compile.'
     },
     },
     source = {
     source = {
-      type = 'ShaderSource',
-      description = 'TODO'
+      type = 'string',
+      description = 'A string or filename with shader code.'
+    },
+    blob = {
+      type = 'Blob',
+      description = 'A Blob containing shader code.'
     }
     }
   },
   },
   returns = {
   returns = {
     bytecode = {
     bytecode = {
       type = 'Blob',
       type = 'Blob',
-      description = 'TODO'
+      description = 'A Blob containing compiled SPIR-V code.'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
       arguments = { 'stage', 'source' },
       arguments = { 'stage', 'source' },
       returns = { 'bytecode' }
       returns = { 'bytecode' }
+    },
+    {
+      arguments = { 'stage', 'blob' },
+      returns = { 'bytecode' }
     }
     }
   },
   },
+  notes = [[
+    The input can be GLSL or SPIR-V.  If it's SPIR-V, it will be returned unchanged as a Blob.
+
+    If the shader fails to compile, an error will be thrown with the error message.
+  ]],
   related = {
   related = {
-    'lovr.graphics.newShader'
+    'lovr.graphics.newShader',
+    'Shader'
   }
   }
 }
 }

+ 1 - 2
api/lovr/graphics/getDevice.lua

@@ -86,7 +86,6 @@ return {
   ]],
   ]],
   related = {
   related = {
     'lovr.graphics.getFeatures',
     'lovr.graphics.getFeatures',
-    'lovr.graphics.getLimits',
-    'lovr.graphics.getStats'
+    'lovr.graphics.getLimits'
   }
   }
 }
 }

+ 1 - 2
api/lovr/graphics/getFeatures.lua

@@ -74,7 +74,6 @@ return {
   related = {
   related = {
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.getDevice',
     'lovr.graphics.getDevice',
-    'lovr.graphics.getLimits',
-    'lovr.graphics.getStats'
+    'lovr.graphics.getLimits'
   }
   }
 }
 }

+ 1 - 2
api/lovr/graphics/getLimits.lua

@@ -367,7 +367,6 @@ return {
   related = {
   related = {
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.isFormatSupported',
     'lovr.graphics.getDevice',
     'lovr.graphics.getDevice',
-    'lovr.graphics.getFeatures',
-    'lovr.graphics.getStats'
+    'lovr.graphics.getFeatures'
   }
   }
 }
 }

+ 0 - 163
api/lovr/graphics/getStats.lua

@@ -1,163 +0,0 @@
-return {
-  tag = 'graphics-misc',
-  summary = 'Get graphics-related statistics.',
-  description = 'TODO',
-  arguments = {},
-  returns = {
-    stats = {
-      type = 'table',
-      description = 'Graphics statistics.',
-      table = {
-        {
-          name = 'memory',
-          type = 'table',
-          description = 'TODO',
-          table = {
-            {
-              name = 'total',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'buffer',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'texture',
-              type = 'number',
-              description = 'TODO'
-            }
-          }
-        },
-        {
-          name = 'objects',
-          type = 'table',
-          description = 'TODO',
-          table = {
-            {
-              name = 'buffers',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'textures',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'samplers',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'shaders',
-              type = 'number',
-              description = 'TODO'
-            }
-          }
-        },
-        {
-          name = 'frame',
-          type = 'table',
-          description = 'TODO',
-          table = {
-            {
-              name = 'scratchMemory',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'renderPasses',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'computePasses',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'transferPasses',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'pipelineBinds',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'bundleBinds',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'drawCalls',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'dispatches',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'workgroups',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'copies',
-              type = 'number',
-              description = 'TODO'
-            }
-          }
-        },
-        {
-          name = 'internal',
-          type = 'table',
-          description = 'TODO',
-          table = {
-            {
-              name = 'blocks',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'canvases',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'pipelines',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'layouts',
-              type = 'number',
-              description = 'TODO'
-            },
-            {
-              name = 'bunches',
-              type = 'number',
-              description = 'TODO'
-            }
-          }
-        }
-      }
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'stats' }
-    }
-  },
-  related = {
-    'lovr.graphics.getDevice',
-    'lovr.graphics.getFeatures',
-    'lovr.graphics.getLimits'
-  }
-}

+ 10 - 7
api/lovr/graphics/isFormatSupported.lua

@@ -1,27 +1,30 @@
 return {
 return {
   tag = 'graphics-misc',
   tag = 'graphics-misc',
   summary = 'Check if a Texture format is supported.',
   summary = 'Check if a Texture format is supported.',
-  description = 'TODO',
+  description = 'Returns the type of operations the GPU supports for a texture format, if any.',
   arguments = {
   arguments = {
     format = {
     format = {
       type = 'TextureFormat',
       type = 'TextureFormat',
-      description = 'TODO'
+      description = 'The texture format to query.'
     },
     },
-    {
-      name = '...features',
+    ['...features'] = {
       type = 'TextureFeature',
       type = 'TextureFeature',
-      description = 'TODO'
+      description = [[
+        Zero or more features to check.  If no features are given, this function will return whether
+        the GPU supports *any* feature for this format.  Otherwise, this function will only return
+        true if *all* of the input features are supported.
+      ]]
     }
     }
   },
   },
   returns = {
   returns = {
     supported = {
     supported = {
       type = 'boolean',
       type = 'boolean',
-      description = 'TODO'
+      description = 'Whether the GPU supports these operations for textures with this format.'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'format' },
+      arguments = { 'format', '...features' },
       returns = { 'supported' }
       returns = { 'supported' }
     }
     }
   },
   },

+ 13 - 5
api/lovr/graphics/newFont.lua

@@ -5,25 +5,33 @@ return {
   arguments = {
   arguments = {
     filename = {
     filename = {
       type = 'string',
       type = 'string',
-      description = 'TODO'
+      description = 'A path to a TTF file.'
     },
     },
     blob = {
     blob = {
       type = 'Blob',
       type = 'Blob',
-      description = 'TODO'
+      description = 'A Blob containing TTF file data.'
     },
     },
     rasterizer = {
     rasterizer = {
       type = 'Rasterizer',
       type = 'Rasterizer',
-      description = 'TODO'
+      description = 'An existing Rasterizer to use to load glyph images.'
     },
     },
     size = {
     size = {
       type = 'number',
       type = 'number',
       default = '32',
       default = '32',
-      description = 'TODO'
+      description = [[
+        The size of the Font in pixels.  Larger sizes are slower to initialize and use more memory,
+        but have better quality.
+      ]]
     },
     },
     spread = {
     spread = {
       type = 'number',
       type = 'number',
       default = '4',
       default = '4',
-      description = 'TODO'
+      description = [[
+        For signed distance field fonts (currently all fonts), the width of the SDF, in pixels.  The
+        greater the distance the font is viewed from, the larger this value needs to be for the font
+        to remain properly antialiased.  Increasing this will have a performance penalty similar to
+        increasing the size of the font.
+      ]]
     }
     }
   },
   },
   returns = {
   returns = {

+ 9 - 6
api/lovr/graphics/newModel.lua

@@ -1,19 +1,21 @@
 return {
 return {
   tag = 'graphics-objects',
   tag = 'graphics-objects',
   summary = 'Create a new Model.',
   summary = 'Create a new Model.',
-  description = 'TODO',
+  description = [[
+    Loads a 3D model from a file.  Currently, OBJ, glTF, and binary STL files are supported.
+  ]],
   arguments = {
   arguments = {
     filename = {
     filename = {
       type = 'string',
       type = 'string',
-      description = 'TODO'
+      description = 'The path to model file.'
     },
     },
     blob = {
     blob = {
       type = 'Blob',
       type = 'Blob',
-      description = 'TODO'
+      description = 'A Blob containing 3D model data.'
     },
     },
     modelData = {
     modelData = {
       type = 'ModelData',
       type = 'ModelData',
-      description = 'TODO'
+      description = 'An existing ModelData object to use for the Model.'
     },
     },
     options = {
     options = {
       type = 'table',
       type = 'table',
@@ -22,7 +24,8 @@ return {
         {
         {
           name = 'mipmaps',
           name = 'mipmaps',
           type = 'boolean',
           type = 'boolean',
-          description = 'TODO'
+          default = 'true',
+          description = 'Whether the textures created for the Model should have mipmaps generated.'
         }
         }
       }
       }
     }
     }
@@ -43,7 +46,7 @@ return {
       returns = { 'model' }
       returns = { 'model' }
     },
     },
     {
     {
-      arguments = { 'modelData' },
+      arguments = { 'modelData', 'options' },
       returns = { 'model' }
       returns = { 'model' }
     }
     }
   },
   },

+ 4 - 4
api/lovr/graphics/newSampler.lua

@@ -3,9 +3,9 @@ return {
   summary = 'Create a new Sampler.',
   summary = 'Create a new Sampler.',
   description = 'TODO',
   description = 'TODO',
   arguments = {
   arguments = {
-    options = {
+    parameters = {
       type = 'table',
       type = 'table',
-      description = 'TODO',
+      description = 'Parameters for the sampler.',
       table = {
       table = {
         {
         {
           name = 'filter',
           name = 'filter',
@@ -38,12 +38,12 @@ return {
   returns = {
   returns = {
     sampler = {
     sampler = {
       type = 'Sampler',
       type = 'Sampler',
-      description = 'TODO'
+      description = 'The new sampler.'
     }
     }
   },
   },
   variants = {
   variants = {
     {
     {
-      arguments = { 'options' },
+      arguments = { 'parameters' },
       returns = { 'sampler' }
       returns = { 'sampler' }
     }
     }
   },
   },

+ 2 - 3
api/lovr/headset/getAxis.lua

@@ -18,8 +18,7 @@ return {
     }
     }
   },
   },
   returns = {
   returns = {
-    {
-      name = '...',
+    ['...'] = {
       type = 'number',
       type = 'number',
       description = [[
       description = [[
         The current state of the components of the axis, or `nil` if the device does not have any
         The current state of the components of the axis, or `nil` if the device does not have any
@@ -30,7 +29,7 @@ return {
   variants = {
   variants = {
     {
     {
       arguments = { 'device', 'axis' },
       arguments = { 'device', 'axis' },
-      returns = {}
+      returns = { '...' }
     }
     }
   },
   },
   notes = [[
   notes = [[

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