Browse Source

DrawMode -> DrawStyle; MeshDrawMode -> DrawMode;

bjorn 6 years ago
parent
commit
5dc4326d7a

+ 56 - 56
api/init.lua

@@ -5560,9 +5560,46 @@ return {
         },
         },
         {
         {
           name = "DrawMode",
           name = "DrawMode",
+          summary = "Different ways Mesh objects can be drawn.",
+          description = "Meshes are lists of arbitrary vertices.  These vertices can be drawn in a few different ways, leading to different results.",
+          key = "DrawMode",
+          module = "lovr.graphics",
+          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."
+            }
+          }
+        },
+        {
+          name = "DrawStyle",
           summary = "Different ways graphics primitives can be drawn.",
           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.",
           description = "Most graphics primitives can be drawn in one of two modes: a filled mode and a wireframe mode.",
-          key = "DrawMode",
+          key = "DrawStyle",
           module = "lovr.graphics",
           module = "lovr.graphics",
           values = {
           values = {
             {
             {
@@ -5717,43 +5754,6 @@ return {
             "Material"
             "Material"
           }
           }
         },
         },
-        {
-          name = "MeshDrawMode",
-          summary = "Different ways Mesh objects can be drawn.",
-          description = "Meshes are lists of arbitrary vertices.  These vertices can be drawn in a few different ways, leading to different results.",
-          key = "MeshDrawMode",
-          module = "lovr.graphics",
-          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."
-            }
-          }
-        },
         {
         {
           name = "MeshUsage",
           name = "MeshUsage",
           summary = "How a Mesh is going to be updated.",
           summary = "How a Mesh is going to be updated.",
@@ -6006,7 +6006,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the arc is filled or outlined."
                   description = "Whether the arc is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6158,7 +6158,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the arc is filled or outlined."
                   description = "Whether the arc is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6224,7 +6224,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the arc is filled or outlined."
                   description = "Whether the arc is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6388,7 +6388,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the arc is filled or outlined."
                   description = "Whether the arc is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6479,7 +6479,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the box."
                   description = "How to draw the box."
                 },
                 },
                 {
                 {
@@ -6619,7 +6619,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the box."
                   description = "How to draw the box."
                 },
                 },
                 {
                 {
@@ -6660,7 +6660,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the circle is filled or outlined."
                   description = "Whether the circle is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6776,7 +6776,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "Whether the circle is filled or outlined."
                   description = "Whether the circle is filled or outlined."
                 },
                 },
                 {
                 {
@@ -6991,7 +6991,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the cube."
                   description = "How to draw the cube."
                 },
                 },
                 {
                 {
@@ -7107,7 +7107,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the cube."
                   description = "How to draw the cube."
                 },
                 },
                 {
                 {
@@ -8358,7 +8358,7 @@ return {
                 },
                 },
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "MeshDrawMode",
+                  type = "DrawMode",
                   description = "How the Mesh will connect its vertices into triangles.",
                   description = "How the Mesh will connect its vertices into triangles.",
                   default = "'fan'"
                   default = "'fan'"
                 },
                 },
@@ -8386,7 +8386,7 @@ return {
                 },
                 },
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "MeshDrawMode",
+                  type = "DrawMode",
                   description = "How the Mesh will connect its vertices into triangles.",
                   description = "How the Mesh will connect its vertices into triangles.",
                   default = "'fan'"
                   default = "'fan'"
                 },
                 },
@@ -8420,7 +8420,7 @@ return {
                 },
                 },
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "MeshDrawMode",
+                  type = "DrawMode",
                   description = "How the Mesh will connect its vertices into triangles.",
                   description = "How the Mesh will connect its vertices into triangles.",
                   default = "'fan'"
                   default = "'fan'"
                 },
                 },
@@ -8453,7 +8453,7 @@ return {
                 },
                 },
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "MeshDrawMode",
+                  type = "DrawMode",
                   description = "How the Mesh will connect its vertices into triangles.",
                   description = "How the Mesh will connect its vertices into triangles.",
                   default = "'fan'"
                   default = "'fan'"
                 },
                 },
@@ -8927,7 +8927,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the plane."
                   description = "How to draw the plane."
                 },
                 },
                 {
                 {
@@ -10180,7 +10180,7 @@ return {
               arguments = {
               arguments = {
                 {
                 {
                   name = "mode",
                   name = "mode",
-                  type = "DrawMode",
+                  type = "DrawStyle",
                   description = "How to draw the triangle."
                   description = "How to draw the triangle."
                 },
                 },
                 {
                 {
@@ -12018,7 +12018,7 @@ return {
                   returns = {
                   returns = {
                     {
                     {
                       name = "mode",
                       name = "mode",
-                      type = "MeshDrawMode",
+                      type = "DrawMode",
                       description = "The draw mode of the Mesh."
                       description = "The draw mode of the Mesh."
                     }
                     }
                   }
                   }
@@ -12256,7 +12256,7 @@ return {
                   arguments = {
                   arguments = {
                     {
                     {
                       name = "mode",
                       name = "mode",
-                      type = "MeshDrawMode",
+                      type = "DrawMode",
                       description = "The new draw mode for the Mesh."
                       description = "The new draw mode for the Mesh."
                     }
                     }
                   },
                   },

+ 39 - 6
api/lovr/graphics/DrawMode.lua

@@ -1,16 +1,49 @@
 return {
 return {
-  summary = 'Different ways graphics primitives can be drawn.',
+  summary = 'Different ways Mesh objects can be drawn.',
   description = [[
   description = [[
-    Most graphics primitives can be drawn in one of two modes: a filled mode and a wireframe mode.
+    Meshes are lists of arbitrary vertices.  These vertices can be drawn in a few different ways,
+    leading to different results.
   ]],
   ]],
   values = {
   values = {
     {
     {
-      name = 'fill',
-      description = 'The shape is drawn as a filled object.'
+      name = 'points',
+      description = 'Draw each vertex as a single point.'
     },
     },
     {
     {
-      name = 'line',
-      description = 'The shape is drawn as a wireframe object.'
+      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.
+      ]]
     }
     }
   }
   }
 }
 }

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

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

+ 1 - 1
api/lovr/graphics/Mesh/getDrawMode.lua

@@ -7,7 +7,7 @@ return {
   returns = {
   returns = {
     {
     {
       name = 'mode',
       name = 'mode',
-      type = 'MeshDrawMode',
+      type = 'DrawMode',
       description = 'The draw mode of the Mesh.'
       description = 'The draw mode of the Mesh.'
     }
     }
   }
   }

+ 1 - 1
api/lovr/graphics/Mesh/setDrawMode.lua

@@ -4,7 +4,7 @@ return {
   arguments = {
   arguments = {
     {
     {
       name = 'mode',
       name = 'mode',
-      type = 'MeshDrawMode',
+      type = 'DrawMode',
       description = 'The new draw mode for the Mesh.'
       description = 'The new draw mode for the Mesh.'
     }
     }
   },
   },

+ 0 - 49
api/lovr/graphics/MeshDrawMode.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 drawn in a few different ways,
-    leading to different results.
-  ]],
-  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.
-      ]]
-    }
-  }
-}

+ 1 - 1
api/lovr/graphics/arc.lua

@@ -4,7 +4,7 @@ return {
   description = 'Draws an arc.',
   description = 'Draws an arc.',
   arguments = {
   arguments = {
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'Whether the arc is filled or outlined.'
       description = 'Whether the arc is filled or outlined.'
     },
     },
     arcmode = {
     arcmode = {

+ 1 - 1
api/lovr/graphics/box.lua

@@ -11,7 +11,7 @@ return {
       description = 'The Material to apply to the box.'
       description = 'The Material to apply to the box.'
     },
     },
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'How to draw the box.'
       description = 'How to draw the box.'
     },
     },
     transform = {
     transform = {

+ 1 - 1
api/lovr/graphics/circle.lua

@@ -4,7 +4,7 @@ return {
   description = 'Draws a 2D circle.',
   description = 'Draws a 2D circle.',
   arguments = {
   arguments = {
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'Whether the circle is filled or outlined.'
       description = 'Whether the circle is filled or outlined.'
     },
     },
     material = {
     material = {

+ 1 - 1
api/lovr/graphics/cube.lua

@@ -8,7 +8,7 @@ return {
       description = 'The Material to apply to the cube faces.'
       description = 'The Material to apply to the cube faces.'
     },
     },
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'How to draw the cube.'
       description = 'How to draw the cube.'
     },
     },
     transform = {
     transform = {

+ 1 - 1
api/lovr/graphics/newMesh.lua

@@ -13,7 +13,7 @@ return {
       description = 'The maximum number of vertices the Mesh can store.'
       description = 'The maximum number of vertices the Mesh can store.'
     },
     },
     mode = {
     mode = {
-      type = 'MeshDrawMode',
+      type = 'DrawMode',
       default = [['fan']],
       default = [['fan']],
       description = 'How the Mesh will connect its vertices into triangles.'
       description = 'How the Mesh will connect its vertices into triangles.'
     },
     },

+ 1 - 1
api/lovr/graphics/plane.lua

@@ -8,7 +8,7 @@ return {
       description = 'The material to apply to the plane.'
       description = 'The material to apply to the plane.'
     },
     },
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'How to draw the plane.'
       description = 'How to draw the plane.'
     },
     },
     x = {
     x = {

+ 1 - 1
api/lovr/graphics/triangle.lua

@@ -4,7 +4,7 @@ return {
   description = 'Draws a triangle from three points.',
   description = 'Draws a triangle from three points.',
   arguments = {
   arguments = {
     mode = {
     mode = {
-      type = 'DrawMode',
+      type = 'DrawStyle',
       description = 'How to draw the triangle.'
       description = 'How to draw the triangle.'
     },
     },
     material = {
     material = {