Browse Source

rm everything graphics;

bjorn 4 years ago
parent
commit
1c5c436910
100 changed files with 0 additions and 3284 deletions
  1. 0 20
      api/lovr/graphics/ArcMode.lua
  2. 0 43
      api/lovr/graphics/AttributeType.lua
  3. 0 28
      api/lovr/graphics/BlendAlphaMode.lua
  4. 0 50
      api/lovr/graphics/BlendMode.lua
  5. 0 29
      api/lovr/graphics/BlockType.lua
  6. 0 24
      api/lovr/graphics/BufferUsage.lua
  7. 0 19
      api/lovr/graphics/Canvas/getDepthTexture.lua
  8. 0 22
      api/lovr/graphics/Canvas/getDimensions.lua
  9. 0 17
      api/lovr/graphics/Canvas/getHeight.lua
  10. 0 21
      api/lovr/graphics/Canvas/getMSAA.lua
  11. 0 13
      api/lovr/graphics/Canvas/getTexture.lua
  12. 0 17
      api/lovr/graphics/Canvas/getWidth.lua
  13. 0 70
      api/lovr/graphics/Canvas/init.lua
  14. 0 20
      api/lovr/graphics/Canvas/isStereo.lua
  15. 0 25
      api/lovr/graphics/Canvas/newImage.lua
  16. 0 36
      api/lovr/graphics/Canvas/renderTo.lua
  17. 0 36
      api/lovr/graphics/Canvas/setTexture.lua
  18. 0 48
      api/lovr/graphics/CompareMode.lua
  19. 0 16
      api/lovr/graphics/CoordinateSpace.lua
  20. 0 38
      api/lovr/graphics/DefaultShader.lua
  21. 0 49
      api/lovr/graphics/DrawMode.lua
  22. 0 16
      api/lovr/graphics/DrawStyle.lua
  23. 0 28
      api/lovr/graphics/FilterMode.lua
  24. 0 19
      api/lovr/graphics/Font/getAscent.lua
  25. 0 15
      api/lovr/graphics/Font/getBaseline.lua
  26. 0 16
      api/lovr/graphics/Font/getDescent.lua
  27. 0 17
      api/lovr/graphics/Font/getHeight.lua
  28. 0 16
      api/lovr/graphics/Font/getLineHeight.lua
  29. 0 15
      api/lovr/graphics/Font/getPixelDensity.lua
  30. 0 16
      api/lovr/graphics/Font/getRasterizer.lua
  31. 0 36
      api/lovr/graphics/Font/getWidth.lua
  32. 0 29
      api/lovr/graphics/Font/hasGlyphs.lua
  33. 0 8
      api/lovr/graphics/Font/init.lua
  34. 0 19
      api/lovr/graphics/Font/setLineHeight.lua
  35. 0 25
      api/lovr/graphics/Font/setPixelDensity.lua
  36. 0 22
      api/lovr/graphics/HorizontalAlign.lua
  37. 0 41
      api/lovr/graphics/Material/getColor.lua
  38. 0 21
      api/lovr/graphics/Material/getScalar.lua
  39. 0 25
      api/lovr/graphics/Material/getTexture.lua
  40. 0 37
      api/lovr/graphics/Material/getTransform.lua
  41. 0 9
      api/lovr/graphics/Material/init.lua
  42. 0 58
      api/lovr/graphics/Material/setColor.lua
  43. 0 20
      api/lovr/graphics/Material/setScalar.lua
  44. 0 33
      api/lovr/graphics/Material/setTexture.lua
  45. 0 40
      api/lovr/graphics/Material/setTransform.lua
  46. 0 21
      api/lovr/graphics/MaterialColor.lua
  47. 0 21
      api/lovr/graphics/MaterialScalar.lua
  48. 0 41
      api/lovr/graphics/MaterialTexture.lua
  49. 0 57
      api/lovr/graphics/Mesh/attachAttributes.lua
  50. 0 37
      api/lovr/graphics/Mesh/detachAttributes.lua
  51. 0 66
      api/lovr/graphics/Mesh/draw.lua
  52. 0 14
      api/lovr/graphics/Mesh/getDrawMode.lua
  53. 0 24
      api/lovr/graphics/Mesh/getDrawRange.lua
  54. 0 12
      api/lovr/graphics/Mesh/getMaterial.lua
  55. 0 22
      api/lovr/graphics/Mesh/getVertex.lua
  56. 0 27
      api/lovr/graphics/Mesh/getVertexAttribute.lua
  57. 0 17
      api/lovr/graphics/Mesh/getVertexCount.lua
  58. 0 18
      api/lovr/graphics/Mesh/getVertexFormat.lua
  59. 0 40
      api/lovr/graphics/Mesh/getVertexMap.lua
  60. 0 87
      api/lovr/graphics/Mesh/init.lua
  61. 0 21
      api/lovr/graphics/Mesh/isAttributeEnabled.lua
  62. 0 19
      api/lovr/graphics/Mesh/setAttributeEnabled.lua
  63. 0 12
      api/lovr/graphics/Mesh/setDrawMode.lua
  64. 0 29
      api/lovr/graphics/Mesh/setDrawRange.lua
  65. 0 15
      api/lovr/graphics/Mesh/setMaterial.lua
  66. 0 34
      api/lovr/graphics/Mesh/setVertex.lua
  67. 0 26
      api/lovr/graphics/Mesh/setVertexAttribute.lua
  68. 0 37
      api/lovr/graphics/Mesh/setVertexMap.lua
  69. 0 39
      api/lovr/graphics/Mesh/setVertices.lua
  70. 0 23
      api/lovr/graphics/MeshUsage.lua
  71. 0 91
      api/lovr/graphics/Model/animate.lua
  72. 0 66
      api/lovr/graphics/Model/draw.lua
  73. 0 40
      api/lovr/graphics/Model/getAABB.lua
  74. 0 17
      api/lovr/graphics/Model/getAnimationCount.lua
  75. 0 25
      api/lovr/graphics/Model/getAnimationDuration.lua
  76. 0 24
      api/lovr/graphics/Model/getAnimationName.lua
  77. 0 39
      api/lovr/graphics/Model/getMaterial.lua
  78. 0 16
      api/lovr/graphics/Model/getMaterialCount.lua
  79. 0 23
      api/lovr/graphics/Model/getMaterialName.lua
  80. 0 17
      api/lovr/graphics/Model/getNodeCount.lua
  81. 0 23
      api/lovr/graphics/Model/getNodeName.lua
  82. 0 72
      api/lovr/graphics/Model/getNodePose.lua
  83. 0 24
      api/lovr/graphics/Model/hasJoints.lua
  84. 0 22
      api/lovr/graphics/Model/init.lua
  85. 0 79
      api/lovr/graphics/Model/pose.lua
  86. 0 21
      api/lovr/graphics/Shader/getType.lua
  87. 0 27
      api/lovr/graphics/Shader/hasBlock.lua
  88. 0 25
      api/lovr/graphics/Shader/hasUniform.lua
  89. 0 135
      api/lovr/graphics/Shader/init.lua
  90. 0 125
      api/lovr/graphics/Shader/send.lua
  91. 0 42
      api/lovr/graphics/Shader/sendBlock.lua
  92. 0 55
      api/lovr/graphics/Shader/sendImage.lua
  93. 0 25
      api/lovr/graphics/ShaderBlock/getOffset.lua
  94. 0 64
      api/lovr/graphics/ShaderBlock/getShaderCode.lua
  95. 0 16
      api/lovr/graphics/ShaderBlock/getSize.lua
  96. 0 17
      api/lovr/graphics/ShaderBlock/getType.lua
  97. 0 61
      api/lovr/graphics/ShaderBlock/init.lua
  98. 0 30
      api/lovr/graphics/ShaderBlock/read.lua
  99. 0 58
      api/lovr/graphics/ShaderBlock/send.lua
  100. 0 24
      api/lovr/graphics/ShaderType.lua

+ 0 - 20
api/lovr/graphics/ArcMode.lua

@@ -1,20 +0,0 @@
-return {
-  summary = 'Different ways arcs can be drawn.',
-  description = 'Different ways arcs can be drawn with `lovr.graphics.arc`.',
-  values = {
-    {
-      name = 'pie',
-      description = [[
-        The arc is drawn with the center of its circle included in the list of points (default).
-      ]]
-    },
-    {
-      name = 'open',
-      description = 'The curve of the arc is drawn as a single line.'
-    },
-    {
-      name = 'closed',
-      description = 'The starting and ending points of the arc\'s curve are connected.'
-    }
-  }
-}

+ 0 - 43
api/lovr/graphics/AttributeType.lua

@@ -1,43 +0,0 @@
-return {
-  summary = 'Different data types for the vertex attributes of a Mesh.',
-  description = [[
-    Here are the different data types available for vertex attributes in a Mesh.  The ones that have
-    a smaller range take up less memory, which improves performance a bit.  The "u" stands for
-    "unsigned", which means it can't hold negative values but instead has a larger positive range.
-  ]],
-  values = {
-    {
-      name = 'byte',
-      description = 'A signed 8 bit number, from -128 to 127.'
-    },
-    {
-      name = 'ubyte',
-      description = 'An unsigned 8 bit number, from 0 to 255.'
-    },
-    {
-      name = 'short',
-      description = 'A signed 16 bit number, from -32768 to 32767.'
-    },
-    {
-      name = 'ushort',
-      description = 'An unsigned 16 bit number, from 0 to 65535.'
-    },
-    {
-      name = 'int',
-      description = 'A signed 32 bit number, from -2147483648 to 2147483647.'
-    },
-    {
-      name = 'uint',
-      description = 'An unsigned 32 bit number, from 0 to 4294967295.'
-    },
-    {
-      name = 'float',
-      description = 'A 32 bit floating-point number (large range, but can start to lose precision).'
-    }
-  },
-  related = {
-    'lovr.graphics.newMesh',
-    'Mesh:getVertexFormat',
-    'Mesh'
-  }
-}

+ 0 - 28
api/lovr/graphics/BlendAlphaMode.lua

@@ -1,28 +0,0 @@
-return {
-  summary = 'Different ways of blending alpha.',
-  description = 'Different ways the alpha channel of pixels affects blending.',
-  values = {
-    {
-      name = 'alphamultiply',
-      description = 'Color channel values are multiplied by the alpha channel during blending.'
-    },
-    {
-      name = 'premultiplied',
-      description = [[
-        Color channels are not multiplied by the alpha channel.  This should be used if the pixels
-        being drawn have already been blended, or "pre-multiplied", by the alpha channel.
-      ]]
-    }
-  },
-  notes = [[
-    The premultiplied mode should be used if pixels being drawn have already been blended, or
-    "pre-multiplied", by the alpha channel.  This happens when rendering a framebuffer that contains
-    pixels with transparent alpha values, since the stored color values have already been faded by
-    alpha and don't need to be faded a second time with the alphamultiply blend mode.
-  ]],
-  related = {
-    'BlendMode',
-    'lovr.graphics.getBlendMode',
-    'lovr.graphics.setBlendMode'
-  }
-}

+ 0 - 50
api/lovr/graphics/BlendMode.lua

@@ -1,50 +0,0 @@
-return {
-  summary = 'Different blend modes.',
-  description = [[
-    Blend modes control how overlapping pixels are blended together, similar to layers in Photoshop.
-  ]],
-  values = {
-    {
-      name = 'alpha',
-      description = 'Normal blending where the alpha value controls how the colors are blended.'
-    },
-    {
-      name = 'add',
-      description = 'The incoming pixel color is added to the destination pixel color.'
-    },
-    {
-      name = 'subtract',
-      description = 'The incoming pixel color is subtracted from the destination pixel color.'
-    },
-    {
-      name = 'multiply',
-      description = [[
-        The color channels from the two pixel values are multiplied together to produce a result.
-      ]]
-    },
-    {
-      name = 'lighten',
-      description = [[
-        The maximum value from each color channel is used, resulting in a lightening effect.
-      ]]
-    },
-    {
-      name = 'darken',
-      description = [[
-        The minimum value from each color channel is used, resulting in a darkening effect.
-      ]]
-    },
-    {
-      name = 'screen',
-      description = [[
-        The opposite of multiply: The pixel values are inverted, multiplied, and inverted again,
-        resulting in a lightening effect.
-      ]]
-    }
-  },
-  related = {
-    'BlendAlphaMode',
-    'lovr.graphics.getBlendMode',
-    'lovr.graphics.setBlendMode'
-  }
-}

+ 0 - 29
api/lovr/graphics/BlockType.lua

@@ -1,29 +0,0 @@
-return {
-  summary = 'Different types of ShaderBlocks.',
-  description = [[
-    There are two types of ShaderBlocks that can be used: `uniform` and `compute`.
-
-    Uniform blocks are read only in shaders, can sometimes be a bit faster than compute blocks, and
-    have a limited size (but the limit will be at least 16KB, you can check
-    `lovr.graphics.getLimits` to check).
-
-    Compute blocks can be written to by compute shaders, might be slightly slower than uniform
-    blocks, and have a much, much larger maximum size.
-  ]],
-  values = {
-    {
-      name = 'uniform',
-      description = 'A uniform block.'
-    },
-    {
-      name = 'compute',
-      description = 'A compute block.'
-    }
-  },
-  related = {
-    'ShaderBlock',
-    'lovr.graphics.newShaderBlock',
-    'ShaderBlock:getType',
-    'lovr.graphics.getLimits'
-  }
-}

+ 0 - 24
api/lovr/graphics/BufferUsage.lua

@@ -1,24 +0,0 @@
-return {
-  summary = 'How the buffer data will be updated.',
-  description = [[
-    This acts as a hint to the graphics driver about what kinds of data access should be optimized for.
-  ]],
-  values = {
-    {
-      name = 'static',
-      description = 'A buffer that you intend to create once and never modify.'
-    },
-    {
-      name = 'dynamic',
-      description = 'A buffer which is modified occasionally.'
-    },
-    {
-      name = 'stream',
-      description = 'A buffer which is entirely replaced on the order of every frame.'
-    }
-  },
-  related = {
-    'ShaderBlock',
-    'lovr.graphics.newShaderBlock',
-  }
-}

+ 0 - 19
api/lovr/graphics/Canvas/getDepthTexture.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the depth buffer used by the Canvas.',
-  description = [[
-    Returns the depth buffer used by the Canvas as a Texture.  If the Canvas was not created with a
-    readable depth buffer (the `depth.readable` flag in `lovr.graphics.newCanvas`), then this
-    function will return `nil`.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'texture',
-      type = 'Texture',
-      description = 'The depth Texture of the Canvas.'
-    }
-  },
-  related = {
-    'lovr.graphics.newCanvas'
-  }
-}

+ 0 - 22
api/lovr/graphics/Canvas/getDimensions.lua

@@ -1,22 +0,0 @@
-return {
-  summary = 'Get the dimensions of the Canvas.',
-  description = 'Returns the dimensions of the Canvas, its Textures, and its depth buffer.',
-  arguments = {},
-  returns = {
-    {
-      name = 'width',
-      type = 'number',
-      description = 'The width of the Canvas, in pixels.'
-    },
-    {
-      name = 'height',
-      type = 'number',
-      description = 'The height of the Canvas, in pixels.'
-    }
-  },
-  notes = 'The dimensions of a Canvas can not be changed after it is created.',
-  related = {
-    'Canvas:getWidth',
-    'Canvas:getHeight'
-  }
-}

+ 0 - 17
api/lovr/graphics/Canvas/getHeight.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the height of the Canvas.',
-  description = 'Returns the height of the Canvas, its Textures, and its depth buffer.',
-  arguments = {},
-  returns = {
-    {
-      name = 'height',
-      type = 'number',
-      description = 'The height of the Canvas, in pixels.'
-    }
-  },
-  notes = 'The height of a Canvas can not be changed after it is created.',
-  related = {
-    'Canvas:getWidth',
-    'Canvas:getDimensions'
-  }
-}

+ 0 - 21
api/lovr/graphics/Canvas/getMSAA.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Get the number of MSAA samples used by the Canvas.',
-  description = [[
-    Returns the number of multisample antialiasing samples to use when rendering to the Canvas.
-    Increasing this number will make the contents of the Canvas appear more smooth at the cost of
-    performance.  It is common to use powers of 2 for this value.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'samples',
-      type = 'number',
-      description = 'The number of MSAA samples.'
-    }
-  },
-  notes = 'All textures attached to the Canvas must be created with this MSAA value.',
-  related = {
-    'lovr.graphics.newCanvas',
-    'lovr.graphics.newTexture'
-  }
-}

+ 0 - 13
api/lovr/graphics/Canvas/getTexture.lua

@@ -1,13 +0,0 @@
-return {
-  summary = 'Get the Textures attached to the Canvas.',
-  description = 'Returns the set of Textures currently attached to the Canvas.',
-  arguments = {},
-  returns = {
-    {
-      name = '...',
-      type = 'Texture',
-      description = 'One or more Textures attached to the Canvas.'
-    }
-  },
-  notes = 'Up to 4 Textures can be attached at once.'
-}

+ 0 - 17
api/lovr/graphics/Canvas/getWidth.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the width of the Canvas.',
-  description = 'Returns the width of the Canvas, its Textures, and its depth buffer.',
-  arguments = {},
-  returns = {
-    {
-      name = 'width',
-      type = 'number',
-      description = 'The width of the Canvas, in pixels.'
-    }
-  },
-  notes = 'The width of a Canvas can not be changed after it is created.',
-  related = {
-    'Canvas:getHeight',
-    'Canvas:getDimensions'
-  }
-}

+ 0 - 70
api/lovr/graphics/Canvas/init.lua

@@ -1,70 +0,0 @@
-return {
-  summary = 'An offscreen render target.',
-  description = [[
-    A Canvas is also known as a framebuffer or render-to-texture.  It allows you to render to a
-    texture instead of directly to the screen.  This lets you postprocess or transform the results
-    later before finally rendering them to the screen.
-
-    After creating a Canvas, you can attach Textures to it using `Canvas:setTexture`.
-  ]],
-  constructors = {
-    'lovr.graphics.newCanvas'
-  },
-  notes = [[
-    Up to four textures can be attached to a Canvas and anything rendered to the Canvas will be
-    broadcast to all attached Textures.  If you want to do render different things to different
-    textures, use the `multicanvas` shader flag when creating your shader and implement the `void
-    colors` function instead of the usual `vec4 color` function.  You can then assign different
-    output colors to `lovrCanvas[0]`, `lovrCanvas[1]`, etc. instead of returning a single color.
-    Each color written to the array will end up in the corresponding texture attached to the Canvas.
-  ]],
-  example = {
-    description = 'Apply a postprocessing effect (wave) using a Canvas and a fragment shader.',
-    code = [=[
-      function lovr.load()
-        lovr.graphics.setBackgroundColor(.1, .1, .1)
-        canvas = lovr.graphics.newCanvas(lovr.headset.getDisplayDimensions())
-
-        wave = lovr.graphics.newShader([[
-          vec4 lovrMain() {
-            return lovrRVertex;
-          }
-        ]], [[
-          uniform float time;
-          vec4 lovrMain() {
-            uv.x += sin(uv.y * 10 + time * 4) * .01;
-            uv.y += cos(uv.x * 10 + time * 4) * .01;
-            return lovrGraphicsColor * lovrDiffuseColor * lovrVertexColor * texture(lovrDiffuseTexture, lovrTexCoord);
-          }
-        ]])
-      end
-
-      function lovr.update(dt)
-        wave:send('time', lovr.timer.getTime())
-      end
-
-      function lovr.draw()
-        -- Render the scene to the canvas instead of the headset.
-        canvas:renderTo(function()
-          lovr.graphics.clear()
-          local size = 5
-          for i = 1, size do
-            for j = 1, size do
-              for k = 1, size do
-                lovr.graphics.setColor(i / size, j / size, k / size)
-                local x, y, z = i - size / 2, j - size / 2, k - size / 2
-                lovr.graphics.cube('fill', x, y, z, .5)
-              end
-            end
-          end
-        end)
-
-        -- Render the canvas to the headset using a shader.
-        lovr.graphics.setColor(1, 1, 1)
-        lovr.graphics.setShader(wave)
-        lovr.graphics.fill(canvas:getTexture())
-        lovr.graphics.setShader()
-      end
-    ]=]
-  }
-}

+ 0 - 20
api/lovr/graphics/Canvas/isStereo.lua

@@ -1,20 +0,0 @@
-return {
-  summary = 'Check if the Canvas is stereo.',
-  description = [[
-    Returns whether the Canvas was created with the `stereo` flag.  Drawing something to a stereo
-    Canvas will draw it to two viewports in the left and right half of the Canvas, using transform
-    information from two different eyes.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'stereo',
-      type = 'boolean',
-      description = 'Whether the Canvas is stereo.'
-    }
-  },
-  related = {
-    'lovr.graphics.newCanvas',
-    'lovr.graphics.fill'
-  }
-}

+ 0 - 25
api/lovr/graphics/Canvas/newImage.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Create a new Image from a Canvas texture.',
-  description = [[
-    Returns a new Image containing the contents of a Texture attached to the Canvas.
-  ]],
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      default = '1',
-      description = 'The index of the Texture to read from.'
-    }
-  },
-  returns = {
-    {
-      name = 'image',
-      type = 'Image',
-      description = 'The new Image.'
-    }
-  },
-  related = {
-    'lovr.data.newImage',
-    'Image'
-  }
-}

+ 0 - 36
api/lovr/graphics/Canvas/renderTo.lua

@@ -1,36 +0,0 @@
-return {
-  summary = 'Render to the Canvas using a function.',
-  description = [[
-    Renders to the Canvas using a function.  All graphics functions inside the callback will affect
-    the Canvas contents instead of directly rendering to the headset.  This can be used in
-    `lovr.update`.
-  ]],
-  arguments = {
-    {
-      name = 'callback',
-      type = 'function',
-      arguments = {
-        {
-          name = '...',
-          type = '*'
-        }
-      },
-      returns = {},
-      description = 'The function to use to render to the Canvas.'
-    },
-    {
-      name = '...',
-      type = '*',
-      description = 'Additional arguments to pass to the callback.'
-    }
-  },
-  returns = {},
-  notes = [[
-    Make sure you clear the contents of the canvas before rendering by using `lovr.graphics.clear`.
-    Otherwise there might be data in the canvas left over from a previous frame.
-
-    Also note that the transform stack is not modified by this function.  If you plan on modifying
-    the transform stack inside your callback it may be a good idea to use `lovr.graphics.push` and
-    `lovr.graphics.pop` so you can revert to the previous transform afterwards.
-  ]]
-}

+ 0 - 36
api/lovr/graphics/Canvas/setTexture.lua

@@ -1,36 +0,0 @@
-return {
-  summary = 'Attach one or more Textures to the Canvas.',
-  description = [[
-    Attaches one or more Textures to the Canvas.  When rendering to the Canvas, everything will be
-    drawn to all attached Textures.  You can attach different layers of an array, cubemap, or volume
-    texture, and also attach different mipmap levels of Textures.
-  ]],
-  arguments = {
-    {
-      name = '...',
-      type = '*',
-      description = 'One or more Textures to attach to the Canvas.'
-    }
-  },
-  returns = {},
-  notes = [[
-    There are some restrictions on how textures can be attached:
-
-    - Up to 4 textures can be attached at once.
-    - Textures must have the same dimensions and multisample settings as the Canvas.
-
-    To specify layers and mipmaps to attach, specify them after the Texture.  You can also
-    optionally wrap them in a table.
-  ]],
-  example = {
-    description = 'Various ways to attach textures to a Canvas.',
-    code = [[
-      canvas:setTexture(textureA)
-      canvas:setTexture(textureA, textureB) -- Attach two textures
-      canvas:setTexture(textureA, layer, mipmap) -- Attach a specific layer and mipmap
-      canvas:setTexture(textureA, layer, textureB, layer) -- Attach specific layers
-      canvas:setTexture({ textureA, layer, mipmap }, textureB, { textureC, layer }) -- Tables
-      canvas:setTexture({ { textureA, layer, mipmap }, textureB, { textureC, layer } })
-    ]]
-  }
-}

+ 0 - 48
api/lovr/graphics/CompareMode.lua

@@ -1,48 +0,0 @@
-return {
-  summary = 'Different depth test modes.',
-  description = [[
-    The method used to compare z values when deciding how to overlap rendered objects.  This is
-    called the "depth test", and it happens on a pixel-by-pixel basis every time new objects are
-    drawn.  If the depth test "passes" for a pixel, then the pixel color will be replaced by the
-    new color and the depth value in the depth buffer will be updated.  Otherwise, the pixel will
-    not be changed and the depth value will not be updated.
-  ]],
-  values = {
-    {
-      name = 'equal',
-      description = 'The depth test passes when the depth values are equal.',
-    },
-    {
-      name = 'notequal',
-      description = 'The depth test passes when the depth values are not equal.',
-    },
-    {
-      name = 'less',
-      description = 'The depth test passes when the new depth value is less than the existing one.',
-    },
-    {
-      name = 'lequal',
-      description = [[
-        The depth test passes when the new depth value is less than or equal to the existing one.
-      ]],
-    },
-    {
-      name = 'gequal',
-      description = [[
-        The depth test passes when the new depth value is greater than or equal to the existing one.
-      ]],
-    },
-    {
-      name = 'greater',
-      description = [[
-        The depth test passes when the new depth value is greater than the existing one.
-      ]]
-    }
-  },
-  related = {
-    'lovr.graphics.getDepthTest',
-    'lovr.graphics.setDepthTest',
-    'lovr.graphics.getStencilTest',
-    'lovr.graphics.setStencilTest'
-  }
-}

+ 0 - 16
api/lovr/graphics/CoordinateSpace.lua

@@ -1,16 +0,0 @@
-return {
-  description = 'Different coordinate spaces for nodes in a Model.',
-  values = {
-    {
-      name = 'local',
-      description = 'The coordinate space relative to the node\'s parent.'
-    },
-    {
-      name = 'global',
-      description = 'The coordinate space relative to the root node of the Model.'
-    }
-  },
-  related = {
-    'Model:pose'
-  }
-}

+ 0 - 38
api/lovr/graphics/DefaultShader.lua

@@ -1,38 +0,0 @@
-return {
-  summary = 'The set of builtin shaders.',
-  description = [[
-    The following shaders are built in to LÖVR, and can be used as an argument to
-    `lovr.graphics.newShader` instead of providing raw GLSL shader code.  The shaders can be further
-    customized by using the `flags` argument.  If you pass in `nil` to `lovr.graphics.setShader`,
-    LÖVR will automatically pick a DefaultShader to use based on whatever is being drawn.
-  ]],
-  values = {
-    {
-      name = 'unlit',
-      description = 'A simple shader without lighting, using only colors and a diffuse texture.'
-    },
-    {
-      name = 'standard',
-      description = 'A physically-based rendering (PBR) shader, using advanced material properties.'
-    },
-    {
-      name = 'cube',
-      description = 'A shader that renders a cubemap texture.'
-    },
-    {
-      name = 'pano',
-      description = 'A shader that renders a 2D equirectangular texture with spherical coordinates.'
-    },
-    {
-      name = 'font',
-      description = 'A shader that renders font glyphs.'
-    },
-    {
-      name = 'fill',
-      description = [[
-        A shader that passes its vertex coordinates unmodified to the fragment shader, used to
-        render view-independent fixed geometry like fullscreen quads.
-      ]]
-    }
-  }
-}

+ 0 - 49
api/lovr/graphics/DrawMode.lua

@@ -1,49 +0,0 @@
-return {
-  summary = 'Different ways Mesh objects can be drawn.',
-  description = [[
-    Meshes are lists of arbitrary vertices.  These vertices can be connected in different ways,
-    leading to different shapes like lines and triangles.
-  ]],
-  values = {
-    {
-      name = 'points',
-      description = 'Draw each vertex as a single point.'
-    },
-    {
-      name = 'lines',
-      description = [[
-        The vertices represent a list of line segments. Each pair of vertices will have a line drawn
-        between them.
-      ]]
-    },
-    {
-      name = 'linestrip',
-      description = [[
-        The first two vertices have a line drawn between them, and each vertex after that will be
-        connected to the previous vertex with a line.
-      ]]
-    },
-    {
-      name = 'lineloop',
-      description = 'Similar to linestrip, except the last vertex is connected back to the first.'
-    },
-    {
-      name = 'strip',
-      description = [[
-        The first three vertices define a triangle.  Each vertex after that creates a triangle using
-        the new vertex and last two vertices.
-      ]]
-    },
-    {
-      name = 'triangles',
-      description = 'Each set of three vertices represents a discrete triangle.'
-    },
-    {
-      name = 'fan',
-      description = [[
-        Draws a set of triangles.  Each one shares the first vertex as a common point, leading to a
-        fan-like shape.
-      ]]
-    }
-  }
-}

+ 0 - 16
api/lovr/graphics/DrawStyle.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Different ways graphics primitives can be drawn.',
-  description = [[
-    Most graphics primitives can be drawn in one of two modes: a filled mode and a wireframe mode.
-  ]],
-  values = {
-    {
-      name = 'fill',
-      description = 'The shape is drawn as a filled object.'
-    },
-    {
-      name = 'line',
-      description = 'The shape is drawn as a wireframe object.'
-    }
-  }
-}

+ 0 - 28
api/lovr/graphics/FilterMode.lua

@@ -1,28 +0,0 @@
-return {
-  summary = 'How textures are sampled.',
-  description = [[
-    The method used to downsample (or upsample) a texture.  "nearest" can be used for a pixelated
-    effect, whereas "linear" leads to more smooth results.  Nearest is slightly faster than linear.
-  ]],
-  values = {
-    {
-      name = 'nearest',
-      description = 'Fast nearest-neighbor sampling.  Leads to a pixelated style.'
-    },
-    {
-      name = 'bilinear',
-      description = 'Smooth pixel sampling.'
-    },
-    {
-      name = 'trilinear',
-      description = 'Smooth pixel sampling, with smooth sampling across mipmap levels.'
-    }
-  },
-  related = {
-    'Texture:getFilter',
-    'Texture:setFilter',
-    'lovr.graphics.getDefaultFilter',
-    'lovr.graphics.setDefaultFilter',
-    'WrapMode'
-  }
-}

+ 0 - 19
api/lovr/graphics/Font/getAscent.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Get the ascent of the Font.',
-  description = [[
-    Returns the maximum distance that any glyph will extend above the Font's baseline.  Units are
-    generally in meters, see `Font:getPixelDensity`.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'ascent',
-      type = 'number',
-      description = 'The ascent of the Font.'
-    }
-  },
-  related = {
-    'Font:getDescent',
-    'Rasterizer:getAscent'
-  }
-}

+ 0 - 15
api/lovr/graphics/Font/getBaseline.lua

@@ -1,15 +0,0 @@
-return {
-  summary = 'Get the baseline of the Font.',
-  description = [[
-    Returns the baseline of the Font.  This is where the characters "rest on", relative to the y
-    coordinate of the drawn text.  Units are generally in meters, see `Font:setPixelDensity`.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'baseline',
-      type = 'number',
-      description = 'The baseline of the Font.'
-    }
-  }
-}

+ 0 - 16
api/lovr/graphics/Font/getDescent.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the descent of the Font.',
-  description = [[
-    Returns the maximum distance that any glyph will extend below the Font's baseline.  Units are
-    generally in meters, see `Font:getPixelDensity` for more information.  Note that due to the
-    coordinate system for fonts, this is a negative value.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'descent',
-      type = 'number',
-      description = 'The descent of the Font.'
-    }
-  }
-}

+ 0 - 17
api/lovr/graphics/Font/getHeight.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the height of a line of text.',
-  description = [[
-    Returns the height of a line of text.  Units are in meters, see `Font:setPixelDensity`.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'height',
-      type = 'number',
-      description = 'The height of a rendered line of text.'
-    }
-  },
-  related = {
-    'Rasterizer:getHeight'
-  }
-}

+ 0 - 16
api/lovr/graphics/Font/getLineHeight.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the line height of the Font.',
-  description = 'Returns the current line height multiplier of the Font.  The default is 1.0.',
-  arguments = {},
-  returns = {
-    {
-      name = 'lineHeight',
-      type = 'number',
-      description = 'The line height.'
-    }
-  },
-  related = {
-    'Font:getHeight',
-    'Rasterizer:getLineHeight'
-  }
-}

+ 0 - 15
api/lovr/graphics/Font/getPixelDensity.lua

@@ -1,15 +0,0 @@
-return {
-  summary = 'Get the pixel density of the Font.',
-  description = [[
-    Returns the current pixel density for the Font.  The default is 1.0.  Normally, this is in
-    pixels per meter.  When rendering to a 2D texture, the units are pixels.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'pixelDensity',
-      type = 'number',
-      description = 'The current pixel density.'
-    }
-  }
-}

+ 0 - 16
api/lovr/graphics/Font/getRasterizer.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the underlying Rasterizer.',
-  description = 'Returns the underlying `Rasterizer` object for a Font.',
-  arguments = {},
-  returns = {
-    {
-      name = 'rasterizer',
-      type = 'Rasterizer',
-      description = 'The rasterizer.'
-    }
-  },
-  related = {
-    'Rasterizer',
-    'lovr.data.newRasterizer'
-  }
-}

+ 0 - 36
api/lovr/graphics/Font/getWidth.lua

@@ -1,36 +0,0 @@
-return {
-  summary = 'Measure a line of text.',
-  description = [[
-    Returns the width and line count of a string when rendered using the font, taking into account
-    an optional wrap limit.
-  ]],
-  arguments = {
-    {
-      name = 'text',
-      type = 'string',
-      description = 'The text to get the width of.'
-    },
-    {
-      name = 'wrap',
-      type = 'number',
-      default = '0',
-      description = 'The width at which to wrap lines, or 0 for no wrap.'
-    }
-  },
-  returns = {
-    {
-      name = 'width',
-      type = 'number',
-      description = 'The maximum width of any line in the text.'
-    },
-    {
-      name = 'lines',
-      type = 'number',
-      description = 'The number of lines in the wrapped text.'
-    }
-  },
-  notes = [[
-     To get the correct units returned, make sure the pixel density is set with
-    `Font:setPixelDensity`.
-  ]]
-}

+ 0 - 29
api/lovr/graphics/Font/hasGlyphs.lua

@@ -1,29 +0,0 @@
-return {
-  summary = 'Check if a Font has a set of glyphs.',
-  description = [[
-    Returns whether the Font has a set of glyphs.  Any combination of strings and numbers
-    (corresponding to character codes) can be specified.  This function will return true if the
-    Font is able to render *all* of the glyphs.
-  ]],
-  arguments = {
-    {
-      name = '...',
-      type = '*',
-      description = 'Strings or numbers to test.'
-    }
-  },
-  returns = {
-    {
-      name = 'has',
-      type = 'boolean',
-      description = 'Whether the Font has the glyphs.'
-    }
-  },
-  notes = [[
-    It is a good idea to use this function when you're rendering an unknown or user-supplied string
-    to avoid utterly embarrassing crashes.
-  ]],
-  related = {
-    'Rasterizer:hasGlyphs'
-  }
-}

+ 0 - 8
api/lovr/graphics/Font/init.lua

@@ -1,8 +0,0 @@
-return {
-  summary = 'A font used to render text.',
-  description = [[
-    A Font is an object created from a TTF file.  It can be used to render text with
-    `lovr.graphics.print`.
-  ]],
-  constructor = 'lovr.graphics.newFont'
-}

+ 0 - 19
api/lovr/graphics/Font/setLineHeight.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Set the line height of the Font.',
-  description = [[
-    Sets the line height of the Font, which controls how far lines apart lines are vertically
-    separated.  This value is a ratio and the default is 1.0.
-  ]],
-  arguments = {
-    {
-      name = 'lineHeight',
-      type = 'number',
-      description = 'The new line height.'
-    }
-  },
-  returns = {},
-  related = {
-    'Font:getHeight',
-    'Rasterizer:getLineHeight'
-  }
-}

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

@@ -1,25 +0,0 @@
-return {
-  summary = 'Set the pixel density of the Font.',
-  description = [[
-    Sets the pixel density for the Font.  Normally, this is in pixels per meter.  When rendering to
-    a 2D texture, the units are pixels.
-  ]],
-  arguments = {
-    pixelDensity = {
-      type = 'number',
-      description = 'The new pixel density.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'pixelDensity' },
-      returns = {}
-    },
-    {
-      description = 'Reset the pixel density to the default (`font:getRasterizer():getHeight()`).',
-      arguments = {},
-      returns = {}
-    }
-  }
-}

+ 0 - 22
api/lovr/graphics/HorizontalAlign.lua

@@ -1,22 +0,0 @@
-return {
-  summary = 'Different ways to horizontally align text.',
-  description = 'Different ways to horizontally align text when using `lovr.graphics.print`.',
-  values = {
-    {
-      name = 'left',
-      description = 'Left aligned lines of text.'
-    },
-    {
-      name = 'center',
-      description = 'Centered aligned lines of text.'
-    },
-    {
-      name = 'right',
-      description = 'Right aligned lines of text.'
-    }
-  },
-  related = {
-    'VerticalAlign',
-    'lovr.graphics.print'
-  }
-}

+ 0 - 41
api/lovr/graphics/Material/getColor.lua

@@ -1,41 +0,0 @@
-return {
-  summary = 'Get a color property of the Material.',
-  description = [[
-    Returns a color property for a Material.  Different types of colors are supported for different
-    lighting parameters.  Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected.
-  ]],
-  arguments = {
-    {
-      name = 'colorType',
-      type = 'MaterialColor',
-      default = [['diffuse']],
-      description = 'The type of color to get.'
-    }
-  },
-  returns = {
-    {
-      name = 'r',
-      type = 'number',
-      description = 'The red component of the color.'
-    },
-    {
-      name = 'g',
-      type = 'number',
-      description = 'The green component of the color.'
-    },
-    {
-      name = 'b',
-      type = 'number',
-      description = 'The blue component of the color.'
-    },
-    {
-      name = 'a',
-      type = 'number',
-      description = 'The alpha component of the color.'
-    }
-  },
-  related = {
-    'MaterialColor',
-    'lovr.graphics.setColor'
-  }
-}

+ 0 - 21
api/lovr/graphics/Material/getScalar.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Get a scalar property of the Material.',
-  description = 'Returns a numeric property of a Material.  Scalar properties default to 1.0.',
-  arguments = {
-    {
-      name = 'scalarType',
-      type = 'MaterialScalar',
-      description = 'The type of property to get.'
-    }
-  },
-  returns = {
-    {
-      name = 'x',
-      type = 'number',
-      description = 'The value of the property.'
-    }
-  },
-  related = {
-    'MaterialScalar'
-  }
-}

+ 0 - 25
api/lovr/graphics/Material/getTexture.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Get a texture for the Material.',
-  description = [[
-    Returns a texture for a Material.  Several predefined `MaterialTexture`s are supported.  Any
-    texture that is `nil` will use a single white pixel as a fallback.
-  ]],
-  arguments = {
-    {
-      name = 'textureType',
-      type = 'MaterialTexture',
-      default = [['diffuse']],
-      description = 'The type of texture to get.'
-    }
-  },
-  returns = {
-    {
-      name = 'texture',
-      type = 'Texture',
-      description = 'The texture that is set, or `nil` if no texture is set.'
-    }
-  },
-  related = {
-    'MaterialTexture'
-  }
-}

+ 0 - 37
api/lovr/graphics/Material/getTransform.lua

@@ -1,37 +0,0 @@
-return {
-  summary = 'Get the transformation applied to texture coordinates.',
-  description = 'Returns the transformation applied to texture coordinates of the Material.',
-  arguments = {},
-  returns = {
-    {
-      name = 'ox',
-      type = 'number',
-      description = 'The texture coordinate x offset.'
-    },
-    {
-      name = 'oy',
-      type = 'number',
-      description = 'The texture coordinate y offset.'
-    },
-    {
-      name = 'sx',
-      type = 'number',
-      description = 'The texture coordinate x scale.'
-    },
-    {
-      name = 'sy',
-      type = 'number',
-      description = 'The texture coordinate y scale.'
-    },
-    {
-      name = 'angle',
-      type = 'number',
-      description = 'The texture coordinate rotation, in radians.'
-    }
-  },
-  notes = [[
-    Although texture coordinates will automatically be transformed by the Material's transform, the
-    material transform is exposed as the `mat3 lovrMaterialTransform` uniform variable in shaders,
-    allowing it to be used for other purposes.
-  ]]
-}

+ 0 - 9
api/lovr/graphics/Material/init.lua

@@ -1,9 +0,0 @@
-return {
-  summary = 'An object that controls texturing and shading.',
-  description = [[
-    A Material is an object used to control how objects appear, through coloring, texturing, and
-    shading.  The Material itself holds sets of colors, textures, and other parameters that are made
-    available to Shaders.
-  ]],
-  constructor = 'lovr.graphics.newMaterial'
-}

+ 0 - 58
api/lovr/graphics/Material/setColor.lua

@@ -1,58 +0,0 @@
-return {
-  summary = 'Set a color property of the Material.',
-  description = [[
-    Sets a color property for a Material.  Different types of colors are supported for different
-    lighting parameters.  Colors default to `(1.0, 1.0, 1.0, 1.0)` and are gamma corrected.
-  ]],
-  arguments = {
-    colorType = {
-      type = 'MaterialColor',
-      default = [['diffuse']],
-      description = 'The type of color to set.'
-    },
-    r = {
-      type = 'number',
-      description = 'The red component of the color.'
-    },
-    g = {
-      type = 'number',
-      description = 'The green component of the color.'
-    },
-    b = {
-      type = 'number',
-      description = 'The blue component of the color.'
-    },
-    hex = {
-      type = 'number',
-      description = 'A hexcode to use for the color.'
-    },
-    a = {
-      type = 'number',
-      default = '1.0',
-      description = 'The alpha component of the color.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'colorType', 'r', 'g', 'b', 'a' },
-      returns = {}
-    },
-    {
-      arguments = { 'r', 'g', 'b', 'a' },
-      returns = {}
-    },
-    {
-      arguments = { 'colorType', 'hex', 'a' },
-      returns = {}
-    },
-    {
-      arguments = { 'hex', 'a' },
-      returns = {}
-    }
-  },
-  related = {
-    'MaterialColor',
-    'lovr.graphics.setColor'
-  }
-}

+ 0 - 20
api/lovr/graphics/Material/setScalar.lua

@@ -1,20 +0,0 @@
-return {
-  summary = 'Set a scalar property of the Material.',
-  description = 'Sets a numeric property of a Material.  Scalar properties default to 1.0.',
-  arguments = {
-    {
-      name = 'scalarType',
-      type = 'MaterialScalar',
-      description = 'The type of property to set.'
-    },
-    {
-      name = 'x',
-      type = 'number',
-      description = 'The value of the property.'
-    }
-  },
-  returns = {},
-  related = {
-    'MaterialScalar'
-  }
-}

+ 0 - 33
api/lovr/graphics/Material/setTexture.lua

@@ -1,33 +0,0 @@
-return {
-  summary = 'Set a texture for the Material.',
-  description = [[
-    Sets a texture for a Material.  Several predefined `MaterialTexture`s are supported.  Any
-    texture that is `nil` will use a single white pixel as a fallback.
-  ]],
-  arguments = {
-    textureType = {
-      type = 'MaterialTexture',
-      default = [['diffuse']],
-      description = 'The type of texture to set.'
-    },
-    texture = {
-      type = 'Texture',
-      description = 'The texture to apply, or `nil` to use the default.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'textureType', 'texture' },
-      returns = {}
-    },
-    {
-      arguments = { 'texture' },
-      returns = {}
-    }
-  },
-  related = {
-    'MaterialTexture',
-    'lovr.graphics.newTexture'
-  }
-}

+ 0 - 40
api/lovr/graphics/Material/setTransform.lua

@@ -1,40 +0,0 @@
-return {
-  summary = 'Set the transformation applied to texture coordinates.',
-  description = [[
-    Sets the transformation applied to texture coordinates of the Material.  This lets you offset,
-    scale, or rotate textures as they are applied to geometry.
-  ]],
-  arguments = {
-    {
-      name = 'ox',
-      type = 'number',
-      description = 'The texture coordinate x offset.'
-    },
-    {
-      name = 'oy',
-      type = 'number',
-      description = 'The texture coordinate y offset.'
-    },
-    {
-      name = 'sx',
-      type = 'number',
-      description = 'The texture coordinate x scale.'
-    },
-    {
-      name = 'sy',
-      type = 'number',
-      description = 'The texture coordinate y scale.'
-    },
-    {
-      name = 'angle',
-      type = 'number',
-      description = 'The texture coordinate rotation, in radians.'
-    }
-  },
-  returns = {},
-  notes = [[
-    Although texture coordinates will automatically be transformed by the Material's transform, the
-    material transform is exposed as the `mat3 lovrMaterialTransform` uniform variable in shaders,
-    allowing it to be used for other purposes.
-  ]]
-}

+ 0 - 21
api/lovr/graphics/MaterialColor.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Different material color parameters.',
-  description = 'The different types of color parameters `Material`s can hold.',
-  values = {
-    {
-      name = 'diffuse',
-      description = 'The diffuse color.'
-    },
-    {
-      name = 'emissive',
-      description = 'The emissive color.'
-    }
-  },
-  related = {
-    'Material:getColor',
-    'Material:setColor',
-    'MaterialScalar',
-    'MaterialTexture',
-    'Material'
-  }
-}

+ 0 - 21
api/lovr/graphics/MaterialScalar.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Different material parameters.',
-  description = 'The different types of float parameters `Material`s can hold.',
-  values = {
-    {
-      name = 'metalness',
-      description = 'The constant metalness factor.'
-    },
-    {
-      name = 'roughness',
-      description = 'The constant roughness factor.'
-    }
-  },
-  related = {
-    'Material:getScalar',
-    'Material:setScalar',
-    'MaterialColor',
-    'MaterialTexture',
-    'Material'
-  }
-}

+ 0 - 41
api/lovr/graphics/MaterialTexture.lua

@@ -1,41 +0,0 @@
-return {
-  summary = 'Different material texture parameters.',
-  description = 'The different types of texture parameters `Material`s can hold.',
-  values = {
-    {
-      name = 'diffuse',
-      description = 'The diffuse texture.'
-    },
-    {
-      name = 'emissive',
-      description = 'The emissive texture.'
-    },
-    {
-      name = 'metalness',
-      description = 'The metalness texture.'
-    },
-    {
-      name = 'roughness',
-      description = 'The roughness texture.'
-    },
-    {
-      name = 'occlusion',
-      description = 'The ambient occlusion texture.'
-    },
-    {
-      name = 'normal',
-      description = 'The normal map.'
-    },
-    {
-      name = 'environment',
-      description = 'The environment map, should be specified as a cubemap texture.'
-    }
-  },
-  related = {
-    'Material:getTexture',
-    'Material:setTexture',
-    'MaterialColor',
-    'MaterialScalar',
-    'Material'
-  }
-}

+ 0 - 57
api/lovr/graphics/Mesh/attachAttributes.lua

@@ -1,57 +0,0 @@
-return {
-  summary = 'Attach attributes from another Mesh onto this one.',
-  description = [[
-    Attaches attributes from another Mesh onto this one.  This can be used to share vertex data
-    across multiple meshes without duplicating the data, and can also be used for instanced
-    rendering by using the `divisor` parameter.
-  ]],
-  arguments = {
-    mesh = {
-      type = 'Mesh',
-      description = 'The Mesh to attach attributes from.'
-    },
-    divisor = {
-      type = 'number',
-      default = '0',
-      description = 'The attribute divisor for all attached attributes.'
-    },
-    attributes = {
-      type = 'table',
-      description = 'A table of attribute names to attach from the other Mesh.'
-    },
-    ['...'] = {
-      type = 'string',
-      description = 'The names of attributes to attach from the other Mesh.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      description = 'Attach all attributes from the other mesh.',
-      arguments = { 'mesh', 'divisor' },
-      returns = {}
-    },
-    {
-      arguments = { 'mesh', 'divisor', '...' },
-      returns = {}
-    },
-    {
-      arguments = { 'mesh', 'divisor', 'attributes' },
-      returns = {}
-    }
-  },
-  notes = [[
-    The attribute divisor is a  number used to control how the attribute data relates to instancing.
-    If 0, then the attribute data is considered "per vertex", and each vertex will get the next
-    element of the attribute's data.  If the divisor 1 or more, then the attribute data is
-    considered "per instance", and every N instances will get the next element of the attribute
-    data.
-
-    To prevent cycles, it is not possible to attach attributes onto a Mesh that already has
-    attributes attached to a different Mesh.
-  ]],
-  related = {
-    'Mesh:detachAttributes',
-    'Mesh:drawInstanced'
-  }
-}

+ 0 - 37
api/lovr/graphics/Mesh/detachAttributes.lua

@@ -1,37 +0,0 @@
-return {
-  summary = 'Detach attributes that were attached from a different Mesh.',
-  description = 'Detaches attributes that were attached using `Mesh:attachAttributes`.',
-  arguments = {
-    mesh = {
-      type = 'Mesh',
-      description = 'A Mesh.  The names of all of the attributes from this Mesh will be detached.'
-    },
-    attributes = {
-      type = 'table',
-      description = 'A table of attribute names to detach.'
-    },
-    ['...'] = {
-      type = 'string',
-      description = 'The names of attributes to detach.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      description = 'Detaches all attributes from the other mesh, by name.',
-      arguments = { 'mesh' },
-      returns = {}
-    },
-    {
-      arguments = { 'mesh', '...' },
-      returns = {}
-    },
-    {
-      arguments = { 'mesh', 'attributes' },
-      returns = {}
-    }
-  },
-  related = {
-    'Mesh:attachAttributes'
-  }
-}

+ 0 - 66
api/lovr/graphics/Mesh/draw.lua

@@ -1,66 +0,0 @@
-return {
-  summary = 'Draw the Mesh.',
-  description = 'Draws the contents of the Mesh.',
-  arguments = {
-    x = {
-      type = 'number',
-      default = '0',
-      description = 'The x coordinate to draw the Mesh at.'
-    },
-    y = {
-      type = 'number',
-      default = '0',
-      description = 'The y coordinate to draw the Mesh at.'
-    },
-    z = {
-      type = 'number',
-      default = '0',
-      description = 'The z coordinate to draw the Mesh at.'
-    },
-    scale = {
-      type = 'number',
-      default = '1',
-      description = 'The scale to draw the Mesh at.'
-    },
-    angle = {
-      type = 'number',
-      default = '0',
-      description = 'The angle to rotate the Mesh around the axis of rotation, in radians.'
-    },
-    ax = {
-      type = 'number',
-      default = '0',
-      description = 'The x component of the axis of rotation.'
-    },
-    ay = {
-      type = 'number',
-      default = '1',
-      description = 'The y component of the axis of rotation.'
-    },
-    az = {
-      type = 'number',
-      default = '0',
-      description = 'The z component of the axis of rotation.'
-    },
-    transform = {
-      type = 'mat4',
-      description = 'The transform to apply before drawing.'
-    },
-    instances = {
-      type = 'number',
-      default = '1',
-      description = 'The number of copies of the Mesh to draw.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'instances' },
-      returns = {}
-    },
-    {
-      arguments = { 'transform', 'instances' },
-      returns = {}
-    }
-  }
-}

+ 0 - 14
api/lovr/graphics/Mesh/getDrawMode.lua

@@ -1,14 +0,0 @@
-return {
-  summary = 'Get the draw mode of the Mesh.',
-  description = [[
-    Get the draw mode of the Mesh, which controls how the vertices are connected together.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'mode',
-      type = 'DrawMode',
-      description = 'The draw mode of the Mesh.'
-    }
-  }
-}

+ 0 - 24
api/lovr/graphics/Mesh/getDrawRange.lua

@@ -1,24 +0,0 @@
-return {
-  summary = 'Get the draw range of the Mesh.',
-  description = [[
-    Retrieve the current draw range for the Mesh.  The draw range is a subset of the vertices of the
-    Mesh that will be drawn.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'start',
-      type = 'number',
-      description = [[
-        The index of the first vertex that will be drawn, or nil if no draw range is set.
-      ]]
-    },
-    {
-      name = 'count',
-      type = 'number',
-      description = [[
-        The number of vertices that will be drawn, or nil if no draw range is set.
-      ]]
-    }
-  }
-}

+ 0 - 12
api/lovr/graphics/Mesh/getMaterial.lua

@@ -1,12 +0,0 @@
-return {
-  summary = 'Get the Material applied to the Mesh.',
-  description = 'Get the Material applied to the Mesh.',
-  arguments = {},
-  returns = {
-    {
-      name = 'material',
-      type = 'Material',
-      description = 'The current material applied to the Mesh.'
-    }
-  }
-}

+ 0 - 22
api/lovr/graphics/Mesh/getVertex.lua

@@ -1,22 +0,0 @@
-return {
-  summary = 'Get a single vertex in the Mesh.',
-  description = [[
-    Gets the data for a single vertex in the Mesh.  The set of data returned depends on the Mesh's
-    vertex format.  The default vertex format consists of 8 floating point numbers: the vertex
-    position, the vertex normal, and the texture coordinates.
-  ]],
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the vertex to retrieve.'
-    }
-  },
-  returns = {
-    {
-      name = '...',
-      type = 'number',
-      description = 'All attributes of the vertex.'
-    }
-  }
-}

+ 0 - 27
api/lovr/graphics/Mesh/getVertexAttribute.lua

@@ -1,27 +0,0 @@
-return {
-  summary = 'Get an attribute of a single vertex in the Mesh.',
-  description = 'Returns the components of a specific attribute of a single vertex in the Mesh.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the vertex to retrieve the attribute of.'
-    },
-    {
-      name = 'attribute',
-      type = 'number',
-      description = 'The index of the attribute to retrieve the components of.'
-    }
-  },
-  returns = {
-    {
-      name = '...',
-      type = 'number',
-      description = 'The components of the vertex attribute.'
-    }
-  },
-  notes = [[
-    Meshes without a custom format have the vertex position as their first attribute, the normal
-    vector as the second attribute, and the texture coordinate as the third attribute.
-  ]]
-}

+ 0 - 17
api/lovr/graphics/Mesh/getVertexCount.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the number of vertices the Mesh can hold.',
-  description = 'Returns the maximum number of vertices the Mesh can hold.',
-  arguments = {},
-  returns = {
-    {
-      name = 'size',
-      type = 'number',
-      description = 'The number of vertices the Mesh can hold.'
-    }
-  },
-  notes = [[
-    The size can only be set when creating the Mesh, and cannot be changed afterwards.
-
-    A subset of the Mesh's vertices can be rendered, see `Mesh:setDrawRange`.
-  ]]
-}

+ 0 - 18
api/lovr/graphics/Mesh/getVertexFormat.lua

@@ -1,18 +0,0 @@
-return {
-  summary = 'Get the vertex format of the Mesh.',
-  description = [[
-    Get the format table of the Mesh's vertices.  The format table describes the set of data that
-    each vertex contains.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'format',
-      type = 'table',
-      description = [[
-        The table of vertex attributes.  Each attribute is a table containing the name of the
-        attribute, the `AttributeType`, and the number of components.
-      ]]
-    }
-  }
-}

+ 0 - 40
api/lovr/graphics/Mesh/getVertexMap.lua

@@ -1,40 +0,0 @@
-return {
-  summary = 'Get the current vertex map of the Mesh.',
-  description = [[
-    Returns the current vertex map for the Mesh.  The vertex map is a list of indices in the Mesh,
-    allowing the reordering or reuse of vertices.
-  ]],
-  arguments = {
-    t = {
-      type = 'table',
-      description = 'The table to fill with the vertex map.'
-    },
-    blob = {
-      type = 'Blob',
-      description = [[
-        The Blob to fill with the vertex map data.  It must be big enough to hold all of the
-        indices.
-      ]]
-    }
-  },
-  returns = {
-    map = {
-      type = 'table',
-      description = 'The list of indices in the vertex map, or `nil` if no vertex map is set.'
-    }
-  },
-  variants = {
-    {
-      arguments = {},
-      returns = { 'map' }
-    },
-    {
-      arguments = { 't' },
-      returns = { 'map' }
-    },
-    {
-      arguments = { 'blob' },
-      returns = {}
-    }
-  }
-}

+ 0 - 87
api/lovr/graphics/Mesh/init.lua

@@ -1,87 +0,0 @@
-return {
-  summary = 'A drawable list of vertices.',
-  description = [[
-    A Mesh is a low-level graphics object that stores and renders a list of vertices.
-
-    Meshes are really flexible since you can pack pretty much whatever you want in them.  This makes
-    them great for rendering arbitrary geometry, but it also makes them kinda difficult to use since
-    you have to place each vertex yourself.
-
-    It's possible to batch geometry with Meshes too.  Instead of drawing a shape 100 times, it's
-    much faster to pack 100 copies of the shape into a Mesh and draw the Mesh once.  Even storing
-    just one copy in the Mesh and drawing that 100 times is usually faster.
-
-    Meshes are also a good choice if you have an object that changes its shape over time.
-  ]],
-  constructor = 'lovr.graphics.newMesh',
-  notes = [[
-    Each vertex in a Mesh can hold several pieces of data.  For example, you might want a vertex to
-    keep track of its position, color, and a weight.  Each one of these pieces of information is
-    called a vertex **attribute**.  A vertex attribute must have a name, a type, and a size.  Here's
-    what the "position" attribute would look like as a Lua table:
-
-        { 'vPosition', 'float', 3 } -- 3 floats, one for x, y, and z
-
-    Every vertex in a Mesh must have the same set of attributes.  We call this set of attributes the
-    **format** of the Mesh, and it's specified as a simple table of attributes.  For example, we
-    could represent the format described above as:
-
-        {
-          { 'vPosition', 'float', 3 },
-          { 'vColor',    'byte',  4 },
-          { 'vWeight',   'int',   1 }
-        }
-
-    When creating a Mesh, you can give it any format you want, or use the default.  The default Mesh
-    format looks like this:
-
-        {
-          { 'lovrPosition',    'float', 3 },
-          { 'lovrNormal',      'float', 3 },
-          { 'lovrTexCoord',    'float', 2 }
-        }
-
-    Great, so why do we go through the trouble of naming everything in our vertex and saying what
-    type and size it is?  The cool part is that we can access this data in a Shader.  We can write a
-    vertex Shader that has `in` variables for every vertex attribute in our Mesh:
-
-        in vec3 vPosition;
-        in vec4 vColor;
-        in int vWeight;
-
-        vec4 lovrMain() {
-          // Here we can access the vPosition, vColor, and vWeight of each vertex in the Mesh!
-        }
-
-    Specifying custom vertex data is really powerful and is often used for lighting, animation, and
-    more!
-
-    For more on the different data types available for the attributes, see `AttributeType`.
-  ]],
-  example = {
-    description = 'Draw a circle using a Mesh.',
-    code = [[
-      function lovr.load()
-        local x, y, z = 0, 1, -2
-        local radius = .3
-        local points = 40
-
-        -- A table to hold the Mesh data
-        local vertices = {}
-
-        for i = 0, points do
-          local angle = i / points * 2 * math.pi
-          local vx = x + math.cos(angle)
-          local vy = y + math.sin(angle)
-          table.insert(vertices, { vx, vy, z })
-        end
-
-        mesh = lovr.graphics.newMesh(vertices, 'fan')
-      end
-
-      function lovr.draw()
-        mesh:draw()
-      end
-    ]]
-  }
-}

+ 0 - 21
api/lovr/graphics/Mesh/isAttributeEnabled.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Check if a vertex attribute is enabled.',
-  description = [[
-    Returns whether or not a vertex attribute is enabled.  Disabled attributes won't be sent to
-    shaders.
-  ]],
-  arguments = {
-    {
-      name = 'attribute',
-      type = 'string',
-      description = 'The name of the attribute.'
-    }
-  },
-  returns = {
-    {
-      name = 'enabled',
-      type = 'boolean',
-      description = 'Whether or not the attribute is enabled when drawing the Mesh.'
-    }
-  }
-}

+ 0 - 19
api/lovr/graphics/Mesh/setAttributeEnabled.lua

@@ -1,19 +0,0 @@
-return {
-  summary = 'Enable or disable a vertex attribute.',
-  description = [[
-    Sets whether a vertex attribute is enabled.  Disabled attributes won't be sent to shaders.
-  ]],
-  arguments = {
-    {
-      name = 'attribute',
-      type = 'string',
-      description = 'The name of the attribute.'
-    },
-    {
-      name = 'enabled',
-      type = 'boolean',
-      description = 'Whether or not the attribute is enabled when drawing the Mesh.'
-    }
-  },
-  returns = {}
-}

+ 0 - 12
api/lovr/graphics/Mesh/setDrawMode.lua

@@ -1,12 +0,0 @@
-return {
-  summary = 'Change the draw mode of the Mesh.',
-  description = 'Set a new draw mode for the Mesh.',
-  arguments = {
-    {
-      name = 'mode',
-      type = 'DrawMode',
-      description = 'The new draw mode for the Mesh.'
-    }
-  },
-  returns = {}
-}

+ 0 - 29
api/lovr/graphics/Mesh/setDrawRange.lua

@@ -1,29 +0,0 @@
-return {
-  summary = 'Set the draw range of the Mesh.',
-  description = [[
-    Set the draw range for the Mesh.  The draw range is a subset of the vertices of the Mesh that
-    will be drawn.
-  ]],
-  arguments = {
-    start = {
-      type = 'number',
-      description = 'The first vertex that will be drawn.'
-    },
-    count = {
-      type = 'number',
-      description = 'The number of vertices that will be drawn.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'start', 'count' },
-      returns = {}
-    },
-    {
-      description = 'Remove the draw range, causing the Mesh to draw all of its vertices.',
-      arguments = {},
-      returns = {}
-    }
-  }
-}

+ 0 - 15
api/lovr/graphics/Mesh/setMaterial.lua

@@ -1,15 +0,0 @@
-return {
-  summary = 'Apply a Material to the Mesh.',
-  description = [[
-    Applies a Material to the Mesh.  This will cause it to use the Material's properties whenever it
-    is rendered.
-  ]],
-  arguments = {
-    {
-      name = 'material',
-      type = 'Material',
-      description = 'The Material to apply.'
-    }
-  },
-  returns = {}
-}

+ 0 - 34
api/lovr/graphics/Mesh/setVertex.lua

@@ -1,34 +0,0 @@
-return {
-  summary = 'Update a single vertex in the Mesh.',
-  description = 'Update a single vertex in the Mesh.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the vertex to set.'
-    },
-    {
-      name = '...',
-      type = 'number',
-      description = 'The attributes of the vertex.'
-    }
-  },
-  returns = {},
-  notes = 'Any unspecified components will be set to 0.',
-  example = {
-    description = 'Set the position of a vertex:',
-    code = [[
-      function lovr.load()
-        mesh = lovr.graphics.newMesh({
-          { -1, 1, 0,  0, 0, 1,  0, 0 },
-          { 1, 1, 0,  0, 0, 1,  1, 0 },
-          { -1, -1, 0,  0, 0, 1,  0, 1 },
-          { 1, -1, 0,  0, 0, 1,  1, 1 }
-        }, 'strip')
-
-        mesh:setVertex(2, { 7, 7, 7 })
-        print(mesh:getVertex(2)) -- 7, 7, 7, 0, 0, 0, 0, 0
-      end
-    ]]
-  }
-}

+ 0 - 26
api/lovr/graphics/Mesh/setVertexAttribute.lua

@@ -1,26 +0,0 @@
-return {
-  summary = 'Update a specific attribute of a single vertex in the Mesh.',
-  description = 'Set the components of a specific attribute of a vertex in the Mesh.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the vertex to update.'
-    },
-    {
-      name = 'attribute',
-      type = 'number',
-      description = 'The index of the attribute to update.'
-    },
-    {
-      name = '...',
-      type = 'number',
-      description = 'Thew new components for the attribute.'
-    }
-  },
-  returns = {},
-  notes = [[
-    Meshes without a custom format have the vertex position as their first attribute, the normal
-    vector as the second attribute, and the texture coordinate as the third attribute.
-  ]]
-}

+ 0 - 37
api/lovr/graphics/Mesh/setVertexMap.lua

@@ -1,37 +0,0 @@
-return {
-  summary = 'Set the vertex map of the Mesh.',
-  description = [[
-    Sets the vertex map.  The vertex map is a list of indices in the Mesh, allowing the reordering
-    or reuse of vertices.
-
-    Often, a vertex map is used to improve performance, since it usually requires less data to
-    specify the index of a vertex than it does to specify all of the data for a vertex.
-  ]],
-  arguments = {
-    map = {
-      type = 'table',
-      description = 'The new vertex map.  Each element of the table is an index of a vertex.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'A Blob to use to update vertex data.'
-    },
-    size = {
-      type = 'number',
-      default = '4',
-      description = 'The size of each element of the Blob, in bytes.  Must be 2 or 4.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'map' },
-      returns = {}
-    },
-    {
-      description = 'This variant is much faster than the previous one, but is harder to use.',
-      arguments = { 'blob', 'size' },
-      returns = {}
-    }
-  }
-}

+ 0 - 39
api/lovr/graphics/Mesh/setVertices.lua

@@ -1,39 +0,0 @@
-return {
-  summary = 'Update multiple vertices in the Mesh.',
-  description = 'Updates multiple vertices in the Mesh.',
-  arguments = {
-    vertices = {
-      type = 'table',
-      description = 'The new set of vertices.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'A Blob containing binary vertex data to upload (this is much more efficient).'
-    },
-    start = {
-      type = 'number',
-      default = '1',
-      description = 'The index of the vertex to start replacing at.'
-    },
-    count = {
-      type = 'number',
-      default = 'nil',
-      description = 'The number of vertices to replace.  If nil, all vertices will be used.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'vertices', 'start', 'count' },
-      returns = {}
-    },
-    {
-      arguments = { 'blob', 'start', 'count' },
-      returns = {}
-    }
-  },
-  notes = [[
-    The start index plus the number of vertices in the table should not exceed the maximum size of
-    the Mesh.
-  ]]
-}

+ 0 - 23
api/lovr/graphics/MeshUsage.lua

@@ -1,23 +0,0 @@
-return {
-  summary = 'How a Mesh is going to be updated.',
-  description = [[
-    Meshes can have a usage hint, describing how they are planning on being updated.  Setting the
-    usage hint allows the graphics driver optimize how it handles the data in the Mesh.
-  ]],
-  values = {
-    {
-      name = 'static',
-      description = 'The Mesh contents will rarely change.'
-    },
-    {
-      name = 'dynamic',
-      description = 'The Mesh contents will change often.'
-    },
-    {
-      name = 'stream',
-      description = [[
-        The Mesh contents will change constantly, potentially multiple times each frame.
-      ]]
-    }
-  }
-}

+ 0 - 91
api/lovr/graphics/Model/animate.lua

@@ -1,91 +0,0 @@
-return {
-  summary = 'Apply an animation to the pose of the Model.',
-  description = [[
-    Applies an animation to the current pose of the Model.
-
-    The animation is evaluated at the specified timestamp, and mixed with the current pose of the
-    Model using the alpha value.  An alpha value of 1.0 will completely override the pose of the
-    Model with the animation's pose.
-  ]],
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of an animation.'
-    },
-    index = {
-      type = 'number',
-      description = 'The index of an animation.'
-    },
-    time = {
-      type = 'number',
-      description = 'The timestamp to evaluate the keyframes at, in seconds.'
-    },
-    alpha = {
-      type = 'number',
-      default = '1',
-      description = 'How much of the animation to mix in, from 0 to 1.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'name', 'time', 'alpha' },
-      returns = {}
-    },
-    {
-      arguments = { 'index', 'time', 'alpha' },
-      returns = {}
-    }
-  },
-  notes = [[
-    For animations to properly show up, use a Shader created with the `animated` flag set to `true`.
-    See `lovr.graphics.newShader` for more.
-
-    Animations are always mixed in with the current pose, and the pose only ever changes by calling
-    `Model:animate` and `Model:pose`.  To clear the pose of a Model to the default, use
-    `Model:pose(nil)`.
-  ]],
-  examples = {
-    {
-      description = 'Render an animated model, with a custom speed.',
-      code = [[
-        function lovr.load()
-          model = lovr.graphics.newModel('model.gltf')
-          shader = lovr.graphics.newShader('unlit', { flags = { animated = true } })
-        end
-
-        function lovr.draw()
-          local speed = 1.0
-          model:animate(1, lovr.timer.getTime() * speed)
-          model:draw()
-        end
-      ]]
-    },
-    {
-      description = 'Mix from one animation to another, as the trigger is pressed.',
-      code = [[
-        function lovr.load()
-          model = lovr.graphics.newModel('model.gltf')
-          shader = lovr.graphics.newShader('unlit', { flags = { animated = true } })
-        end
-
-        function lovr.draw()
-          local t = lovr.timer.getTime()
-          local mix = lovr.headset.getAxis('right', 'trigger')
-
-          model:pose()
-          model:animate(1, t)
-          model:animate(2, t, mix)
-
-          model:draw()
-        end
-      ]]
-    }
-  },
-  related = {
-    'Model:pose',
-    'Model:getAnimationCount',
-    'Model:getAnimationName',
-    'Model:getAnimationDuration'
-  }
-}

+ 0 - 66
api/lovr/graphics/Model/draw.lua

@@ -1,66 +0,0 @@
-return {
-  summary = 'Draw the Model.',
-  description = 'Draw the Model.',
-  arguments = {
-    x = {
-      type = 'number',
-      default = '0',
-      description = 'The x coordinate to draw the Model at.'
-    },
-    y = {
-      type = 'number',
-      default = '0',
-      description = 'The y coordinate to draw the Model at.'
-    },
-    z = {
-      type = 'number',
-      default = '0',
-      description = 'The z coordinate to draw the Model at.'
-    },
-    scale = {
-      type = 'number',
-      default = '1',
-      description = 'The scale to draw the Model at.'
-    },
-    angle = {
-      type = 'number',
-      default = '0',
-      description = 'The angle to rotate the Model around the axis of rotation, in radians.'
-    },
-    ax = {
-      type = 'number',
-      default = '0',
-      description = 'The x component of the axis of rotation.'
-    },
-    ay = {
-      type = 'number',
-      default = '1',
-      description = 'The y component of the axis of rotation.'
-    },
-    az = {
-      type = 'number',
-      default = '0',
-      description = 'The z component of the axis of rotation.'
-    },
-    transform = {
-      type = 'mat4',
-      description = 'The transform to apply before drawing.'
-    },
-    instances = {
-      type = 'number',
-      default = '1',
-      description = 'The number of copies of the Model to draw.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'x', 'y', 'z', 'scale', 'angle', 'ax', 'ay', 'az', 'instances' },
-      returns = {}
-    },
-    {
-      arguments = { 'transform', 'instances' },
-      returns = {}
-    }
-  }
-}

+ 0 - 40
api/lovr/graphics/Model/getAABB.lua

@@ -1,40 +0,0 @@
-return {
-  summary = 'Get the Model\'s axis aligned bounding box.',
-  description = 'Returns a bounding box that encloses the vertices of the Model.',
-  arguments = {},
-  returns = {
-    {
-      name = 'minx',
-      type = 'number',
-      description = 'The minimum x coordinate of the box.'
-    },
-    {
-      name = 'maxx',
-      type = 'number',
-      description = 'The maximum x coordinate of the box.'
-    },
-    {
-      name = 'miny',
-      type = 'number',
-      description = 'The minimum y coordinate of the box.'
-    },
-    {
-      name = 'maxy',
-      type = 'number',
-      description = 'The maximum y coordinate of the box.'
-    },
-    {
-      name = 'minz',
-      type = 'number',
-      description = 'The minimum z coordinate of the box.'
-    },
-    {
-      name = 'maxz',
-      type = 'number',
-      description = 'The maximum z coordinate of the box.'
-    }
-  },
-  related = {
-    'Collider:getAABB'
-  }
-}

+ 0 - 17
api/lovr/graphics/Model/getAnimationCount.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the number of animations in the Model.',
-  description = 'Returns the number of animations in the Model.',
-  arguments = {},
-  returns = {
-    {
-      name = 'count',
-      type = 'number',
-      description = 'The number of animations in the Model.'
-    }
-  },
-  related = {
-    'Model:getAnimationName',
-    'Model:getAnimationDuration',
-    'Model:animate'
-  }
-}

+ 0 - 25
api/lovr/graphics/Model/getAnimationDuration.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Get the duration of an animation in the Model.',
-  description = 'Returns the duration of an animation in the Model, in seconds.',
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the animation.'
-    },
-    index = {
-      type = 'number',
-      description = 'The animation index.'
-    }
-  },
-  returns = {
-    duration = {
-      type = 'number',
-      description = 'The duration of the animation, in seconds.'
-    }
-  },
-  related = {
-    'Model:getAnimationCount',
-    'Model:getAnimationName',
-    'Model:animate'
-  }
-}

+ 0 - 24
api/lovr/graphics/Model/getAnimationName.lua

@@ -1,24 +0,0 @@
-return {
-  summary = 'Get the name of an animation in the Model.',
-  description = 'Returns the name of one of the animations in the Model.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the animation to get the name of.'
-    }
-  },
-  returns = {
-    {
-      name = 'name',
-      type = 'string',
-      description = 'The name of the animation.'
-    }
-  },
-  related = {
-    'Model:getAnimationCount',
-    'Model:getAnimationDuration',
-    'Model:getMaterialName',
-    'Model:getNodeName'
-  }
-}

+ 0 - 39
api/lovr/graphics/Model/getMaterial.lua

@@ -1,39 +0,0 @@
-return {
-  summary = 'Get a Material from the Model.',
-  description = [[
-    Returns a Material loaded from the Model, by name or index.
-
-    This includes `Texture` objects and other properties like colors, metalness/roughness, and more.
-  ]],
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the Material to return.'
-    },
-    index = {
-      type = 'number',
-      description = 'The index of the Material to return.'
-    }
-  },
-  returns = {
-    material = {
-      type = 'Material',
-      description = 'The material.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'name' },
-      returns = { 'material' }
-    },
-    {
-      arguments = { 'index' },
-      returns = { 'material' }
-    }
-  },
-  related = {
-    'Model:getMaterialCount',
-    'Model:getMaterialName',
-    'Material'
-  }
-}

+ 0 - 16
api/lovr/graphics/Model/getMaterialCount.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the number of materials in the Model.',
-  description = 'Returns the number of materials in the Model.',
-  arguments = {},
-  returns = {
-    {
-      name = 'count',
-      type = 'number',
-      description = 'The number of materials in the Model.'
-    }
-  },
-  related = {
-    'Model:getMaterialName',
-    'Model:getMaterial'
-  }
-}

+ 0 - 23
api/lovr/graphics/Model/getMaterialName.lua

@@ -1,23 +0,0 @@
-return {
-  summary = 'Get the name of a material in the Model.',
-  description = 'Returns the name of one of the materials in the Model.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the material to get the name of.'
-    }
-  },
-  returns = {
-    {
-      name = 'name',
-      type = 'string',
-      description = 'The name of the material.'
-    }
-  },
-  related = {
-    'Model:getMaterialCount',
-    'Model:getAnimationName',
-    'Model:getNodeName'
-  }
-}

+ 0 - 17
api/lovr/graphics/Model/getNodeCount.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the number of nodes in the Model.',
-  description = 'Returns the number of nodes (bones) in the Model.',
-  arguments = {},
-  returns = {
-    {
-      name = 'count',
-      type = 'number',
-      description = 'The number of nodes in the Model.'
-    }
-  },
-  related = {
-    'Model:getNodeName',
-    'Model:getNodePose',
-    'Model:pose'
-  }
-}

+ 0 - 23
api/lovr/graphics/Model/getNodeName.lua

@@ -1,23 +0,0 @@
-return {
-  summary = 'Get the name of a node in the Model.',
-  description = 'Returns the name of one of the nodes (bones) in the Model.',
-  arguments = {
-    {
-      name = 'index',
-      type = 'number',
-      description = 'The index of the node to get the name of.'
-    }
-  },
-  returns = {
-    {
-      name = 'name',
-      type = 'string',
-      description = 'The name of the node.'
-    }
-  },
-  related = {
-    'Model:getNodeCount',
-    'Model:getAnimationName',
-    'Model:getMaterialName'
-  }
-}

+ 0 - 72
api/lovr/graphics/Model/getNodePose.lua

@@ -1,72 +0,0 @@
-return {
-  summary = 'Get the pose of a single node.',
-  description = 'Returns the pose of a single node in the Model in a given `CoordinateSpace`.',
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
-    },
-    index = {
-      type = 'number',
-      description = 'The node index.'
-    },
-    space = {
-      type = 'CoordinateSpace',
-      default = [['global']],
-      description = [[
-        Whether the pose should be returned relative to the node's parent or relative to the root
-        node of the Model.
-      ]]
-    }
-  },
-  returns = {
-    x = {
-      type = 'number',
-      description = 'The x position of the node.'
-    },
-    y = {
-      type = 'number',
-      description = 'The y position of the node.'
-    },
-    z = {
-      type = 'number',
-      description = 'The z position of the node.'
-    },
-    angle = {
-      type = 'number',
-      description = 'The number of radians the node is rotated around its rotational axis.'
-    },
-    ax = {
-      type = 'number',
-      description = 'The x component of the axis of rotation.'
-    },
-    ay = {
-      type = 'number',
-      description = 'The y component of the axis of rotation.'
-    },
-    az = {
-      type = 'number',
-      description = 'The z component of the axis of rotation.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'name', 'space' },
-      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
-    },
-    {
-      arguments = { 'index', 'space' },
-      returns = { 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az' }
-    }
-  },
-  notes = [[
-    For skinned nodes to render correctly, use a Shader created with the `animated` flag set to
-    `true`.  See `lovr.graphics.newShader` for more.
-  ]],
-  related = {
-    'Model:pose',
-    'Model:animate',
-    'Model:getNodeName',
-    'Model:getNodeCount'
-  }
-}

+ 0 - 24
api/lovr/graphics/Model/hasJoints.lua

@@ -1,24 +0,0 @@
-return {
-  summary = 'Check if a Model has joints.',
-  description = [[
-    Returns whether the Model has any nodes associated with animated joints.  This can be used to
-    approximately determine whether an animated shader needs to be used with an arbitrary Model.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'skeletal',
-      type = 'boolean',
-      description = 'Whether the Model has any nodes that use skeletal animation.'
-    }
-  },
-  notes = [[
-    A model can still be animated even if this function returns false, since node transforms can
-    still be animated with keyframes without skinning.  These types of animations don't need to use
-    a Shader with the `animated = true` flag, though.
-  ]],
-  related = {
-    'Model:getAnimationCount',
-    'lovr.graphics.newShader'
-  }
-}

+ 0 - 22
api/lovr/graphics/Model/init.lua

@@ -1,22 +0,0 @@
-return {
-  summary = 'An asset imported from a 3D model file.',
-  description = [[
-    A Model is a drawable object loaded from a 3D file format.  The supported 3D file formats are
-    OBJ, glTF, and STL.
-  ]],
-  constructors = {
-    'lovr.graphics.newModel',
-    'lovr.headset.newModel'
-  },
-  example = [[
-    local model
-
-    function lovr.load()
-      model = lovr.graphics.newModel('assets/model.gltf')
-    end
-
-    function lovr.draw()
-      model:draw(0, 1, -1, 1, lovr.timer.getTime())
-    end
-  ]]
-}

+ 0 - 79
api/lovr/graphics/Model/pose.lua

@@ -1,79 +0,0 @@
-return {
-  summary = 'Set the pose of a single node, or clear the pose.',
-  description = [[
-    Applies a pose to a single node of the Model.  The input pose is assumed to be relative to the
-    pose of the node's parent.  This is useful for applying inverse kinematics (IK) to a chain of
-    bones in a skeleton.
-
-    The alpha parameter can be used to mix between the node's current pose and the input pose.
-  ]],
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the node.'
-    },
-    index = {
-      type = 'number',
-      description = 'The node index.'
-    },
-    x = {
-      type = 'number',
-      description = 'The x position.'
-    },
-    y = {
-      type = 'number',
-      description = 'The y position.'
-    },
-    z = {
-      type = 'number',
-      description = 'The z position.'
-    },
-    angle = {
-      type = 'number',
-      description = 'The angle of rotation around the axis, in radians.'
-    },
-    ax = {
-      type = 'number',
-      description = 'The x component of the rotation axis.'
-    },
-    ay = {
-      type = 'number',
-      description = 'The y component of the rotation axis.'
-    },
-    az = {
-      type = 'number',
-      description = 'The z component of the rotation axis.'
-    },
-    alpha = {
-      type = 'number',
-      default = '1',
-      description = 'How much of the pose to mix in, from 0 to 1.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'name', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az', 'alpha' },
-      returns = {}
-    },
-    {
-      arguments = { 'index', 'x', 'y', 'z', 'angle', 'ax', 'ay', 'az', 'alpha' },
-      returns = {}
-    },
-    {
-      description = 'Clear the pose of the Model.',
-      arguments = {},
-      returns = {}
-    }
-  },
-  notes = [[
-    For skinned nodes to render correctly, use a Shader created with the `animated` flag set to
-    `true`.  See `lovr.graphics.newShader` for more.
-  ]],
-  related = {
-    'Model:getNodePose',
-    'Model:animate',
-    'Model:getNodeName',
-    'Model:getNodeCount'
-  }
-}

+ 0 - 21
api/lovr/graphics/Shader/getType.lua

@@ -1,21 +0,0 @@
-return {
-  summary = 'Get the type of the Shader.',
-  description = [[
-    Returns the type of the Shader, which will be "graphics" or "compute".
-
-    Graphics shaders are created with `lovr.graphics.newShader` and can be used for rendering with
-    `lovr.graphics.setShader`.  Compute shaders are created with `lovr.graphics.newComputeShader`
-    and can be run using `lovr.graphics.compute`.
-  ]],
-  arguments = {},
-  returns = {
-    {
-      name = 'type',
-      type = 'ShaderType',
-      description = 'The type of the Shader.'
-    }
-  },
-  related = {
-    'ShaderType'
-  }
-}

+ 0 - 27
api/lovr/graphics/Shader/hasBlock.lua

@@ -1,27 +0,0 @@
-return {
-  summary = 'Check if a Shader has a block.',
-  description = [[
-    Returns whether a Shader has a block.
-
-    A block is added to the Shader code at creation time using `ShaderBlock:getShaderCode`.  The
-    block name (not the namespace) is used to link up the ShaderBlock object to the Shader.  This
-    function can be used to check if a Shader was created with a block using the given name.
-  ]],
-  arguments = {
-    {
-      name = 'block',
-      type = 'string',
-      description = 'The name of the block.'
-    }
-  },
-  returns = {
-    {
-      name = 'present',
-      type = 'boolean',
-      description = 'Whether the shader has the specified block.'
-    }
-  },
-  related = {
-    'Shader:sendBlock'
-  }
-}

+ 0 - 25
api/lovr/graphics/Shader/hasUniform.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Check if a Shader has a uniform variable.',
-  description = 'Returns whether a Shader has a particular uniform variable.',
-  arguments = {
-    {
-      name = 'uniform',
-      type = 'string',
-      description = 'The name of the uniform variable.'
-    }
-  },
-  returns = {
-    {
-      name = 'present',
-      type = 'boolean',
-      description = 'Whether the shader has the specified uniform.'
-    }
-  },
-  notes = [[
-    If a uniform variable is defined but unused in the shader, the shader compiler will optimize it
-    out and the uniform will not report itself as present.
-  ]],
-  related = {
-    'Shader:send'
-  }
-}

+ 0 - 135
api/lovr/graphics/Shader/init.lua

@@ -1,135 +0,0 @@
-return {
-  summary = 'A GLSL program used for low-level control over rendering.',
-  description = [[
-    Shaders are GLSL programs that transform the way vertices and pixels show up on the screen.
-    They can be used for lighting, postprocessing, particles, animation, and much more.  You can use
-    `lovr.graphics.setShader` to change the active Shader.
-  ]],
-  constructors = {
-    'lovr.graphics.newShader',
-    'lovr.graphics.newComputeShader'
-  },
-  notes = [[
-    GLSL version `330` is used on desktop systems, and `300 es` on WebGL/Android.
-
-    The default vertex shader:
-
-        vec4 position(mat4 projection, mat4 transform, vec4 vertex) {
-          return projection * transform * vertex;
-        }
-
-    The default fragment shader:
-
-        vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) {
-          return graphicsColor * lovrDiffuseColor * lovrVertexColor * texture(image, uv);
-        }
-
-    Additionally, the following headers are prepended to the shader source, giving you convenient
-    access to a default set of uniform variables and vertex attributes.
-
-    Vertex shader header:
-
-        in vec3 lovrPosition; // The vertex position
-        in vec3 lovrNormal; // The vertex normal vector
-        in vec2 lovrTexCoord;
-        in vec4 lovrVertexColor;
-        in vec3 lovrTangent;
-        in uvec4 lovrBones;
-        in vec4 lovrBoneWeights;
-        in uint lovrDrawID;
-        out vec4 lovrGraphicsColor;
-        uniform mat4 lovrModel;
-        uniform mat4 lovrView;
-        uniform mat4 lovrProjection;
-        uniform mat4 lovrTransform; // Model-View matrix
-        uniform mat3 lovrNormalMatrix; // Inverse-transpose of lovrModel
-        uniform mat3 lovrMaterialTransform;
-        uniform float lovrPointSize;
-        uniform mat4 lovrPose[48];
-        uniform int lovrViewportCount;
-        uniform int lovrViewID;
-        const mat4 lovrPoseMatrix; // Bone-weighted pose
-        const int lovrInstanceID; // Current instance ID
-
-    Fragment shader header:
-
-        in vec2 lovrTexCoord;
-        in vec4 lovrVertexColor;
-        in vec4 lovrGraphicsColor;
-        out vec4 lovrCanvas[gl_MaxDrawBuffers];
-        uniform float lovrMetalness;
-        uniform float lovrRoughness;
-        uniform vec4 lovrDiffuseColor;
-        uniform vec4 lovrEmissiveColor;
-        uniform sampler2D lovrDiffuseTexture;
-        uniform sampler2D lovrEmissiveTexture;
-        uniform sampler2D lovrMetalnessTexture;
-        uniform sampler2D lovrRoughnessTexture;
-        uniform sampler2D lovrOcclusionTexture;
-        uniform sampler2D lovrNormalTexture;
-        uniform samplerCube lovrEnvironmentTexture;
-        uniform int lovrViewportCount;
-        uniform int lovrViewID;
-
-    ### Compute Shaders
-
-    Compute shaders can be created with `lovr.graphics.newComputeShader` and run with
-    `lovr.graphics.compute`.  Currently, compute shaders are written with raw GLSL.  There is no
-    default compute shader, instead the `void compute();` function must be implemented.
-
-    You can use the `layout` qualifier to specify a local work group size:
-
-        layout(local_size_x = X, local_size_y = Y, local_size_z = Z) in;
-
-    And the following built in variables can be used:
-
-        in uvec3 gl_NumWorkGroups;       // The size passed to lovr.graphics.compute
-        in uvec3 gl_WorkGroupSize;       // The local work group size
-        in uvec3 gl_WorkGroupID;         // The current global work group
-        in uvec3 gl_LocalInvocationID;   // The current local work group
-        in uvec3 gl_GlobalInvocationID;  // A unique ID combining the global and local IDs
-        in uint gl_LocalInvocationIndex; // A 1D index of the LocalInvocationID
-
-    Compute shaders don't return anything but they can write data to `Texture`s or `ShaderBlock`s.
-    To bind a texture in a way that can be written to a compute shader, declare the uniforms with a
-    type of `image2D`, `imageCube`, etc. instead of the usual `sampler2D` or `samplerCube`.  Once a
-    texture is bound to an image uniform, you can use the `imageLoad` and `imageStore` GLSL
-    functions to read and write pixels in the image.  Variables in `ShaderBlock`s can be written to
-    using assignment syntax.
-
-    LÖVR handles synchronization of textures and shader blocks so there is no need to use manual
-    memory barriers to synchronize writes to resources from compute shaders.
-  ]],
-  example = {
-    description = 'Set a simple shader that colors pixels based on vertex normals.',
-    code = [=[
-      function lovr.load()
-        lovr.graphics.setShader(lovr.graphics.newShader([[
-          out vec3 vNormal; // This gets passed to the fragment shader
-
-          vec4 position(mat4 projection, mat4 transform, vec4 vertex) {
-            vNormal = lovrNormal;
-            return projection * transform * vertex;
-          }
-        ]], [[
-          in vec3 vNormal; // This gets passed from the vertex shader
-
-          vec4 color(vec4 gcolor, sampler2D image, vec2 uv) {
-            return vec4(vNormal * .5 + .5, 1.0);
-          }
-        ]]))
-
-        model = lovr.graphics.newModel('model.gltf')
-      end
-
-      function lovr.draw()
-        model:draw(x, y, z)
-      end
-    ]=]
-  },
-  related = {
-    'lovr.graphics.newComputeShader',
-    'lovr.graphics.setShader',
-    'lovr.graphics.getShader'
-  }
-}

+ 0 - 125
api/lovr/graphics/Shader/send.lua

@@ -1,125 +0,0 @@
-return {
-  summary = 'Update a uniform variable in the Shader.',
-  description = 'Updates a uniform variable in the Shader.',
-  arguments = {
-    {
-      name = 'uniform',
-      type = 'string',
-      description = 'The name of the uniform to update.'
-    },
-    {
-      name = 'value',
-      type = '*',
-      description = 'The new value of the uniform.'
-    }
-  },
-  returns = {
-    {
-      name = 'success',
-      type = 'boolean',
-      description = 'Whether the uniform exists and was updated.'
-    }
-  },
-  notes = [[
-    The shader does not need to be active to update its uniforms.
-
-    The following type combinations are supported:
-
-    <table>
-      <thead>
-        <tr>
-          <td>Uniform type</td>
-          <td>LÖVR type</td>
-        </tr>
-      </thead>
-      <tbody>
-        <tr>
-          <td>float</td>
-          <td>number</td>
-        </tr>
-        <tr>
-          <td>int</td>
-          <td>number</td>
-        </tr>
-        <tr>
-          <td>vec2</td>
-          <td>{ x, y }</td>
-        </tr>
-        <tr>
-          <td>vec3</td>
-          <td>{ x, y, z } or vec3</td>
-        </tr>
-        <tr>
-          <td>vec4</td>
-          <td>{ x, y, z, w }</td>
-        </tr>
-        <tr>
-          <td>ivec2</td>
-          <td>{ x, y }</td>
-        </tr>
-        <tr>
-          <td>ivec3</td>
-          <td>{ x, y, z }</td>
-        </tr>
-        <tr>
-          <td>ivec4</td>
-          <td>{ x, y, z, w }</td>
-        </tr>
-        <tr>
-          <td>mat2</td>
-          <td>{ x, ... }</td>
-        </tr>
-        <tr>
-          <td>mat3</td>
-          <td>{ x, ... }</td>
-        </tr>
-        <tr>
-          <td>mat4</td>
-          <td>{ x, ... } or mat4</td>
-        </tr>
-        <tr>
-          <td>sampler</td>
-          <td>Texture</td>
-        </tr>
-        <tr>
-          <td>image</td>
-          <td>Texture</td>
-        </tr>
-      </tbody>
-    </table>
-
-    Uniform arrays can be wrapped in tables or passed as multiple arguments.
-
-    Textures must match the type of sampler or image they are being sent to.
-
-    The following sampler (and image) types are currently supported:
-
-    - `sampler2D`
-    - `sampler3D`
-    - `samplerCube`
-    - `sampler2DArray`
-
-    `Blob`s can be used to pass arbitrary binary data to Shader variables.
-  ]],
-  example = {
-    description = 'Updating a `vec3` uniform:',
-    code = [=[
-      function lovr.load()
-        shader = lovr.graphics.newShader([[
-          uniform vec3 offset;
-          vec4 position(mat4 projection, mat4 transform, vec4 vertex) {
-            vertex.xyz += offset;
-            return projection * transform * vertex;
-          }
-        ]], nil)
-
-        shader:send('offset', { .3, .7, 0 })
-      end
-    ]=]
-  },
-  related = {
-    'Shader:hasUniform',
-    'ShaderBlock:send',
-    'Shader:sendBlock'
-  }
-}

+ 0 - 42
api/lovr/graphics/Shader/sendBlock.lua

@@ -1,42 +0,0 @@
-return {
-  summary = 'Send a ShaderBlock to a Shader.',
-  description = [[
-    Sends a ShaderBlock to a Shader.  After the block is sent, you can update the data in the block
-    without needing to resend the block.  The block can be sent to multiple shaders and they will
-    all see the same data from the block.
-  ]],
-  arguments = {
-    {
-      name = 'name',
-      type = 'string',
-      description = 'The name of the block to send to.'
-    },
-    {
-      name = 'block',
-      type = 'ShaderBlock',
-      description = 'The ShaderBlock to associate with the specified block.'
-    },
-    {
-      name = 'access',
-      type = 'UniformAccess',
-      default = [['readwrite']],
-      description = 'How the Shader will use this block (used as an optimization hint).'
-    }
-  },
-  returns = {},
-  notes = [[
-    The Shader does not need to be active to send it a block.
-
-    Make sure the ShaderBlock's variables line up with the block variables declared in the shader
-    code, otherwise you'll get garbage data in the block.  An easy way to do this is to use
-    `ShaderBlock:getShaderCode` to get a GLSL snippet that is compatible with the block.
-  ]],
-  related = {
-    'Shader:hasBlock',
-    'Shader:send',
-    'ShaderBlock:send',
-    'ShaderBlock:getShaderCode',
-    'UniformAccess',
-    'ShaderBlock'
-  }
-}

+ 0 - 55
api/lovr/graphics/Shader/sendImage.lua

@@ -1,55 +0,0 @@
-return {
-  summary = 'Send a Texture to a Shader for writing.',
-  description = [[
-    Sends a Texture to a Shader for writing.  This is meant to be used with compute shaders and only
-    works with uniforms declared as `image2D`, `imageCube`, `image2DArray`, and `image3D`.  The
-    normal `Shader:send` function accepts Textures and should be used most of the time.
-  ]],
-  arguments = {
-    name = {
-      type = 'string',
-      description = 'The name of the image uniform.'
-    },
-    index = {
-      type = 'number',
-      description = 'The array index to set.'
-    },
-    texture = {
-      type = 'Texture',
-      description = 'The Texture to assign.'
-    },
-    slice = {
-      type = 'number',
-      default = 'nil',
-      description = 'The slice of a cube, array, or volume texture to use, or `nil` for all slices.'
-    },
-    mipmap = {
-      type = 'number',
-      default = '1',
-      description = 'The mipmap of the texture to use.'
-    },
-    access = {
-      type = 'UniformAccess',
-      default = [['readwrite']],
-      description = 'Whether the image will be read from, written to, or both.'
-    }
-  },
-  returns = {},
-  variants = {
-    {
-      arguments = { 'name', 'texture', 'slice', 'mipmap', 'access' },
-      returns = {}
-    },
-    {
-      arguments = { 'name', 'index', 'texture', 'slice', 'mipmap', 'access' },
-      returns = {}
-    }
-  },
-  related = {
-    'Shader:send',
-    'ShaderBlock:send',
-    'ShaderBlock:getShaderCode',
-    'UniformAccess',
-    'ShaderBlock'
-  }
-}

+ 0 - 25
api/lovr/graphics/ShaderBlock/getOffset.lua

@@ -1,25 +0,0 @@
-return {
-  summary = 'Get the byte offset of a variable in the ShaderBlock.',
-  description = [[
-    Returns the byte offset of a variable in a ShaderBlock.  This is useful if you want to manually
-    send binary data to the ShaderBlock using a `Blob` in `ShaderBlock:send`.
-  ]],
-  arguments = {
-    {
-      name = 'field',
-      type = 'string',
-      description = 'The name of the variable to get the offset of.'
-    }
-  },
-  returns = {
-    {
-      name = 'offset',
-      type = 'number',
-      description = 'The byte offset of the variable.'
-    }
-  },
-  related = {
-    'ShaderBlock:getSize',
-    'lovr.graphics.newShaderBlock'
-  }
-}

+ 0 - 64
api/lovr/graphics/ShaderBlock/getShaderCode.lua

@@ -1,64 +0,0 @@
-return {
-  summary = 'Get a GLSL string that defines the ShaderBlock in a Shader.',
-  description = [[
-    Before a ShaderBlock can be used in a Shader, the Shader has to have the block's variables
-    defined in its source code.  This can be a tedious process, so you can call this function to
-    return a GLSL string that contains this definition.  Roughly, it will look something like this:
-
-        layout(std140) uniform <label> {
-          <type> <name>[<count>];
-        } <namespace>;
-  ]],
-  arguments = {
-    {
-      name = 'label',
-      type = 'string',
-      description = [[
-        The label of the block in the shader code.  This will be used to identify it when using
-        `Shader:sendBlock`.
-      ]]
-    },
-    {
-      name = 'namespace',
-      type = 'string',
-      default = 'nil',
-      description = [[
-        The namespace to use when accessing the block's variables in the shader code.  This can be
-        used to prevent naming conflicts if two blocks have variables with the same name.  If the
-        namespace is nil, the block's variables will be available in the global scope.
-      ]]
-    }
-  },
-  returns = {
-    {
-      name = 'code',
-      type = 'string',
-      description = 'The code that can be prepended to `Shader` code.'
-    }
-  },
-  example = [=[
-    block = lovr.graphics.newShaderBlock('uniform', {
-      sizes = { 'float', 10 }
-    })
-
-    code = [[
-      #ifdef VERTEX
-        ]] .. block:getShaderCode('MyBlock', 'sizeBlock') .. [[
-
-        // vertex shader goes here,
-        // it can access sizeBlock.sizes
-      #endif
-
-      #ifdef PIXEL
-        // fragment shader goes here
-      #endif
-    ]]
-
-    shader = lovr.graphics.newShader(code, code)
-    shader:sendBlock('MyBlock', block)
-  ]=],
-  related = {
-    'lovr.graphics.newShader',
-    'lovr.graphics.newComputeShader'
-  }
-}

+ 0 - 16
api/lovr/graphics/ShaderBlock/getSize.lua

@@ -1,16 +0,0 @@
-return {
-  summary = 'Get the size of the ShaderBlock.',
-  description = 'Returns the size of the ShaderBlock\'s data, in bytes.',
-  arguments = {},
-  returns = {
-    {
-      name = 'size',
-      type = 'number',
-      description = 'The size of the ShaderBlock, in bytes.'
-    }
-  },
-  related = {
-    'ShaderBlock:getOffset',
-    'lovr.graphics.newShaderBlock'
-  }
-}

+ 0 - 17
api/lovr/graphics/ShaderBlock/getType.lua

@@ -1,17 +0,0 @@
-return {
-  summary = 'Get the type of the ShaderBlock.',
-  description = 'Returns the type of the ShaderBlock.',
-  arguments = {},
-  returns = {
-    {
-      name = 'type',
-      type = 'BlockType',
-      description = 'The type of the ShaderBlock.'
-    }
-  },
-  related = {
-    'ShaderBlock:getOffset',
-    'lovr.graphics.newShaderBlock',
-    'lovr.graphics.getLimits'
-  }
-}

+ 0 - 61
api/lovr/graphics/ShaderBlock/init.lua

@@ -1,61 +0,0 @@
-return {
-  summary = 'A big ol\' block of data that can be sent to a Shader.',
-  description = [[
-    ShaderBlocks are objects that can hold large amounts of data and can be sent to Shaders.  It is
-    common to use "uniform" variables to send data to shaders, but uniforms are usually limited to
-    a few kilobytes in size.  ShaderBlocks are useful for a few reasons:
-
-    - They can hold a lot more data.
-    - Shaders can modify the data in them, which is really useful for compute shaders.
-    - Setting the data in a ShaderBlock updates the data for all Shaders using the block, so you
-      don't need to go around setting the same uniforms in lots of different shaders.
-
-    On systems that support compute shaders, ShaderBlocks can optionally be "writable".  A writable
-    ShaderBlock is a little bit slower than a non-writable one, but shaders can modify its contents
-    and it can be much, much larger than a non-writable ShaderBlock.
-  ]],
-  constructor = 'lovr.graphics.newShaderBlock',
-  notes = [[
-    - A Shader can use up to 8 ShaderBlocks.
-    - ShaderBlocks can not contain textures.
-    - Some systems have bugs with `vec3` variables in ShaderBlocks.  If you run into strange bugs,
-      try switching to a `vec4` for the variable.
-  ]],
-  example = [=[
-    function lovr.load()
-      -- Create a ShaderBlock to store positions for 1000 models
-      block = lovr.graphics.newShaderBlock('uniform', {
-        modelPositions = { 'mat4', 1000 }
-      }, { usage = 'static' })
-
-      -- Write some random transforms to the block
-      local transforms = {}
-      for i = 1, 1000 do
-        transforms[i] = lovr.math.mat4()
-        local random, randomNormal = lovr.math.random, lovr.math.randomNormal
-        transforms[i]:translate(randomNormal(8), randomNormal(8), randomNormal(8))
-        transforms[i]:rotate(random(2 * math.pi), random(), random(), random())
-      end
-      block:send('modelPositions', transforms)
-
-      -- Create the shader, injecting the shader code for the block
-      shader = lovr.graphics.newShader(
-        block:getShaderCode('ModelBlock') .. [[
-        vec4 lovrMain() {
-          return lovrProjection * lovrTransform * modelPositions[gl_InstanceID] * lovrVertex;
-        }
-      ]])
-
-      -- Bind the block to the shader
-      shader:sendBlock('ModelBlock', block)
-      model = lovr.graphics.newModel('monkey.obj')
-    end
-
-    -- Draw the model 1000 times, using positions from the shader block
-    function lovr.draw()
-      lovr.graphics.setShader(shader)
-      model:draw(lovr.math.mat4(), 1000)
-      lovr.graphics.setShader()
-    end
-  ]=]
-}

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

@@ -1,30 +0,0 @@
-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'
-  }
-}

+ 0 - 58
api/lovr/graphics/ShaderBlock/send.lua

@@ -1,58 +0,0 @@
-return {
-  summary = 'Update a variable in the ShaderBlock.',
-  description = 'Updates a variable in the ShaderBlock.',
-  arguments = {
-    variable = {
-      type = 'string',
-      description = 'The name of the variable to update.'
-    },
-    value = {
-      type = '*',
-      description = 'The new value of the uniform.'
-    },
-    blob = {
-      type = 'Blob',
-      description = 'A Blob to replace the block data with.'
-    },
-    offset = {
-      type = 'number',
-      default = '0',
-      description = 'A byte offset into the Blob to start writing from.'
-    },
-    extent = {
-      type = 'number',
-      default = 'nil',
-      description = 'The number of bytes to write.  If `nil`, writes as many bytes as possible.'
-    }
-  },
-  returns = {
-    bytes = {
-      type = 'number',
-      description = 'How many bytes were copied to the block.'
-    }
-  },
-  variants = {
-    {
-      arguments = { 'variable', 'value' },
-      returns = {}
-    },
-    {
-      arguments = { 'blob', 'offset', 'extent' },
-      returns = { 'bytes' }
-    }
-  },
-  notes = [[
-    For scalar or vector types, use tables of numbers or `vec3`s for each vector.
-
-    For matrix types, use tables of numbers or `mat4` objects.
-
-    `Blob`s can also be used to pass arbitrary binary data to individual variables.
-  ]],
-  related = {
-    'Shader:send',
-    'Shader:sendBlock',
-    'ShaderBlock:getShaderCode',
-    'ShaderBlock:getOffset',
-    'ShaderBlock:getSize'
-  }
-}

+ 0 - 24
api/lovr/graphics/ShaderType.lua

@@ -1,24 +0,0 @@
-return {
-  summary = 'Different types of shaders.',
-  description = [[
-    Shaders can be used for either rendering operations or generic compute tasks.  Graphics shaders
-    are created with `lovr.graphics.newShader` and compute shaders are created with
-    `lovr.graphics.newComputeShader`.  `Shader:getType` can be used on an existing Shader to figure
-    out what type it is.
-  ]],
-  values = {
-    {
-      name = 'graphics',
-      description = 'A graphics shader.'
-    },
-    {
-      name = 'compute',
-      description = 'A compute shader.'
-    }
-  },
-  related = {
-    'Shader',
-    'lovr.graphics.newShader',
-    'lovr.graphics.newComputeShader'
-  }
-}

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