Browse Source

Mark all objects as extending Object;

bjorn 3 weeks ago
parent
commit
83cd5341be

+ 25 - 0
api/init.lua

@@ -2310,6 +2310,7 @@ return {
             "lovr.audio.newSource",
             "lovr.audio.newSource",
             "Source:clone"
             "Source:clone"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "clone",
               name = "clone",
@@ -4807,6 +4808,7 @@ return {
           constructors = {
           constructors = {
             "lovr.data.newImage"
             "lovr.data.newImage"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "encode",
               name = "encode",
@@ -5229,6 +5231,7 @@ return {
           constructors = {
           constructors = {
             "lovr.data.newModelData"
             "lovr.data.newModelData"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getAnimationChannelCount",
               name = "getAnimationChannelCount",
@@ -7533,6 +7536,7 @@ return {
           constructors = {
           constructors = {
             "lovr.data.newRasterizer"
             "lovr.data.newRasterizer"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getAdvance",
               name = "getAdvance",
@@ -8271,6 +8275,7 @@ return {
           constructors = {
           constructors = {
             "lovr.data.newSound"
             "lovr.data.newSound"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getBlob",
               name = "getBlob",
@@ -10324,6 +10329,7 @@ return {
           constructors = {
           constructors = {
             "lovr.filesystem.newFile"
             "lovr.filesystem.newFile"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getMode",
               name = "getMode",
@@ -13641,6 +13647,7 @@ return {
           constructors = {
           constructors = {
             "lovr.graphics.newBuffer"
             "lovr.graphics.newBuffer"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "clear",
               name = "clear",
@@ -14067,6 +14074,7 @@ return {
             "lovr.graphics.newFont",
             "lovr.graphics.newFont",
             "lovr.graphics.getDefaultFont"
             "lovr.graphics.getDefaultFont"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getAscent",
               name = "getAscent",
@@ -14560,6 +14568,7 @@ return {
           constructors = {
           constructors = {
             "lovr.graphics.newMaterial"
             "lovr.graphics.newMaterial"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getProperties",
               name = "getProperties",
@@ -14591,6 +14600,7 @@ return {
           constructors = {
           constructors = {
             "lovr.graphics.newMesh"
             "lovr.graphics.newMesh"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "computeBoundingBox",
               name = "computeBoundingBox",
@@ -15257,6 +15267,7 @@ return {
             "lovr.graphics.newModel",
             "lovr.graphics.newModel",
             "lovr.headset.newModel"
             "lovr.headset.newModel"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "animate",
               name = "animate",
@@ -17796,6 +17807,7 @@ return {
             "lovr.graphics.getWindowPass",
             "lovr.graphics.getWindowPass",
             "lovr.headset.getPass"
             "lovr.headset.getPass"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "barrier",
               name = "barrier",
@@ -22743,6 +22755,7 @@ return {
             "Buffer:newReadback",
             "Buffer:newReadback",
             "Texture:newReadback"
             "Texture:newReadback"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getBlob",
               name = "getBlob",
@@ -22866,6 +22879,7 @@ return {
           constructors = {
           constructors = {
             "lovr.graphics.newSampler"
             "lovr.graphics.newSampler"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getAnisotropy",
               name = "getAnisotropy",
@@ -23030,6 +23044,7 @@ return {
             "lovr.graphics.newShader",
             "lovr.graphics.newShader",
             "Shader:clone"
             "Shader:clone"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "clone",
               name = "clone",
@@ -23302,6 +23317,7 @@ return {
             "lovr.graphics.newTexture",
             "lovr.graphics.newTexture",
             "lovr.graphics.newTextureView"
             "lovr.graphics.newTextureView"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "clear",
               name = "clear",
@@ -26589,6 +26605,7 @@ return {
           constructors = {
           constructors = {
             "lovr.headset.newLayer"
             "lovr.headset.newLayer"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getColor",
               name = "getColor",
@@ -28797,6 +28814,7 @@ return {
             "lovr.math.newCurve",
             "lovr.math.newCurve",
             "Curve:slice"
             "Curve:slice"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "addPoint",
               name = "addPoint",
@@ -30684,6 +30702,7 @@ return {
           constructors = {
           constructors = {
             "lovr.math.newRandomGenerator"
             "lovr.math.newRandomGenerator"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getSeed",
               name = "getSeed",
@@ -34765,6 +34784,7 @@ return {
             "World:newMeshCollider",
             "World:newMeshCollider",
             "World:newTerrainCollider"
             "World:newTerrainCollider"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "addShape",
               name = "addShape",
@@ -38766,6 +38786,7 @@ return {
             "lovr.physics.newHingeJoint",
             "lovr.physics.newHingeJoint",
             "lovr.physics.newSliderJoint"
             "lovr.physics.newSliderJoint"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "destroy",
               name = "destroy",
@@ -39157,6 +39178,7 @@ return {
             "World:newMeshCollider",
             "World:newMeshCollider",
             "World:newTerrainCollider"
             "World:newTerrainCollider"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "containsPoint",
               name = "containsPoint",
@@ -40594,6 +40616,7 @@ return {
           constructors = {
           constructors = {
             "lovr.physics.newWorld"
             "lovr.physics.newWorld"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "destroy",
               name = "destroy",
@@ -44710,6 +44733,7 @@ return {
             "lovr.thread.newChannel",
             "lovr.thread.newChannel",
             "lovr.thread.getChannel"
             "lovr.thread.getChannel"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "clear",
               name = "clear",
@@ -44882,6 +44906,7 @@ return {
           constructors = {
           constructors = {
             "lovr.thread.newThread"
             "lovr.thread.newThread"
           },
           },
+          extends = "Object",
           methods = {
           methods = {
             {
             {
               name = "getError",
               name = "getError",

+ 1 - 0
api/lovr/audio/Source/init.lua

@@ -11,6 +11,7 @@ return {
     `Source:seek` and `Source:tell` can be used to control the playback position of the Source.  A
     `Source:seek` and `Source:tell` can be used to control the playback position of the Source.  A
     Source can be set to loop when it reaches the end using `Source:setLooping`.
     Source can be set to loop when it reaches the end using `Source:setLooping`.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.audio.newSource',
     'lovr.audio.newSource',
     'Source:clone'
     'Source:clone'

+ 1 - 0
api/lovr/data/Image/init.lua

@@ -10,6 +10,7 @@ return {
     individual pixels, load Textures in a background thread, or use the FFI to efficiently access
     individual pixels, load Textures in a background thread, or use the FFI to efficiently access
     the raw image data.
     the raw image data.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.data.newImage'
     'lovr.data.newImage'
   }
   }

+ 1 - 0
api/lovr/data/ModelData/init.lua

@@ -10,5 +10,6 @@ return {
     Usually you can just load a `Model` directly, but using a `ModelData` can be helpful if you want
     Usually you can just load a `Model` directly, but using a `ModelData` can be helpful if you want
     to load models in a thread or access more low-level information about the Model.
     to load models in a thread or access more low-level information about the Model.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.data.newModelData'
   constructor = 'lovr.data.newModelData'
 }
 }

+ 1 - 0
api/lovr/data/Rasterizer/init.lua

@@ -5,5 +5,6 @@ return {
 
 
     Usually you can just use `Font` objects.
     Usually you can just use `Font` objects.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.data.newRasterizer'
   constructor = 'lovr.data.newRasterizer'
 }
 }

+ 1 - 0
api/lovr/data/Sound/init.lua

@@ -52,5 +52,6 @@ return {
     format (ACN channel ordering and SN3D channel normalization).  The AMB format is supported for
     format (ACN channel ordering and SN3D channel normalization).  The AMB format is supported for
     import and will automatically get converted to AmbiX.  See `lovr.data.newSound` for more info.
     import and will automatically get converted to AmbiX.  See `lovr.data.newSound` for more info.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.data.newSound'
   constructor = 'lovr.data.newSound'
 }
 }

+ 1 - 0
api/lovr/filesystem/File/init.lua

@@ -3,6 +3,7 @@ return {
   description = [[
   description = [[
     A File is an object that provides read or write access to a file on the filesystem.
     A File is an object that provides read or write access to a file on the filesystem.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.filesystem.newFile'
     'lovr.filesystem.newFile'
   }
   }

+ 1 - 0
api/lovr/graphics/Buffer/init.lua

@@ -45,6 +45,7 @@ return {
     can't be 2 things at once!  If you need multiple versions of data, it's best to use a bigger
     can't be 2 things at once!  If you need multiple versions of data, it's best to use a bigger
     buffer with offsets (or multiple buffers).
     buffer with offsets (or multiple buffers).
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newBuffer'
     'lovr.graphics.newBuffer'
   },
   },

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

@@ -13,6 +13,7 @@ return {
     For TTF fonts, LÖVR uses a text rendering technique called "multichannel signed distance fields"
     For TTF fonts, LÖVR uses a text rendering technique called "multichannel signed distance fields"
     (MSDF), which makes the font rendering remain crisp when text is viewed up close.
     (MSDF), which makes the font rendering remain crisp when text is viewed up close.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newFont',
     'lovr.graphics.newFont',
     'lovr.graphics.getDefaultFont'
     'lovr.graphics.getDefaultFont'

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

@@ -21,6 +21,7 @@ return {
     In shader code, non-texture material properties can be accessed as `Material.<property>`, and
     In shader code, non-texture material properties can be accessed as `Material.<property>`, and
     material textures can be accessed as `<Type>Texture`, e.g. `RoughnessTexture`.
     material textures can be accessed as `<Type>Texture`, e.g. `RoughnessTexture`.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newMaterial'
     'lovr.graphics.newMaterial'
   }
   }

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

@@ -24,5 +24,6 @@ return {
 
 
     The **bounding box** of the Mesh allows LÖVR to skip rendering it when it's out of view.
     The **bounding box** of the Mesh allows LÖVR to skip rendering it when it's out of view.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.graphics.newMesh'
   constructor = 'lovr.graphics.newMesh'
 }
 }

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

@@ -19,6 +19,7 @@ return {
     Models can have materials, which are collections of properties and textures that define how its
     Models can have materials, which are collections of properties and textures that define how its
     surface is affected by lighting.  Each mesh in the model can use a single material.
     surface is affected by lighting.  Each mesh in the model can use a single material.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newModel',
     'lovr.graphics.newModel',
     'lovr.headset.newModel'
     'lovr.headset.newModel'

+ 1 - 0
api/lovr/graphics/Pass/init.lua

@@ -19,6 +19,7 @@ return {
     `lovr.draw` is called every frame with a `Pass` that is configured to render to either the
     `lovr.draw` is called every frame with a `Pass` that is configured to render to either the
     headset or the window.  The Pass will automatically get submitted afterwards.
     headset or the window.  The Pass will automatically get submitted afterwards.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newPass',
     'lovr.graphics.newPass',
     'lovr.graphics.getWindowPass',
     'lovr.graphics.getWindowPass',

+ 1 - 0
api/lovr/graphics/Readback/init.lua

@@ -5,6 +5,7 @@ return {
     can be polled for completion or the CPU with `Readback:isComplete`, or you can wait for it to
     can be polled for completion or the CPU with `Readback:isComplete`, or you can wait for it to
     finish using `Readback:wait`.
     finish using `Readback:wait`.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'Buffer:newReadback',
     'Buffer:newReadback',
     'Texture:newReadback'
     'Texture:newReadback'

+ 1 - 0
api/lovr/graphics/Sampler/init.lua

@@ -13,6 +13,7 @@ return {
 
 
     The properties of a Sampler are immutable, and can't be changed after it's created.
     The properties of a Sampler are immutable, and can't be changed after it's created.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newSampler'
     'lovr.graphics.newSampler'
   }
   }

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

@@ -3,6 +3,7 @@ return {
   description = [[
   description = [[
     Shaders are small GPU programs.  See the `Shaders` guide for a full introduction to Shaders.
     Shaders are small GPU programs.  See the `Shaders` guide for a full introduction to Shaders.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newShader',
     'lovr.graphics.newShader',
     'Shader:clone'
     'Shader:clone'

+ 1 - 0
api/lovr/graphics/Texture/init.lua

@@ -5,6 +5,7 @@ return {
     which are one-dimensional.  Textures are used as the destination for rendering operations, and
     which are one-dimensional.  Textures are used as the destination for rendering operations, and
     textures loaded from images provide surface data to `Material` objects.
     textures loaded from images provide surface data to `Material` objects.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.graphics.newTexture',
     'lovr.graphics.newTexture',
     'lovr.graphics.newTextureView'
     'lovr.graphics.newTextureView'

+ 1 - 0
api/lovr/headset/Layer/init.lua

@@ -20,5 +20,6 @@ return {
 
 
     Note that currently the VR simulator does not support layers.
     Note that currently the VR simulator does not support layers.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.headset.newLayer'
   constructor = 'lovr.headset.newLayer'
 }
 }

+ 1 - 0
api/lovr/math/Curve/init.lua

@@ -12,6 +12,7 @@ return {
     Note that for longer or more complicated curves (like in a drawing application) it can be easier
     Note that for longer or more complicated curves (like in a drawing application) it can be easier
     to store the path as several Curve objects.
     to store the path as several Curve objects.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.math.newCurve',
     'lovr.math.newCurve',
     'Curve:slice'
     'Curve:slice'

+ 1 - 0
api/lovr/math/RandomGenerator/init.lua

@@ -5,5 +5,6 @@ return {
     pseudo-random numbers. If you just need basic randomness, you can use `lovr.math.random` without
     pseudo-random numbers. If you just need basic randomness, you can use `lovr.math.random` without
     needing to create a random generator.
     needing to create a random generator.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.math.newRandomGenerator'
   constructor = 'lovr.math.newRandomGenerator'
 }
 }

+ 1 - 0
api/lovr/physics/Collider/init.lua

@@ -1,6 +1,7 @@
 return {
 return {
   summary = 'A single object in a physics simulation.',
   summary = 'A single object in a physics simulation.',
   description = 'Colliders represent a single rigid body in the physics simulation.',
   description = 'Colliders represent a single rigid body in the physics simulation.',
+  extends = 'Object',
   constructors = {
   constructors = {
     'World:newCollider',
     'World:newCollider',
     'World:newBoxCollider',
     'World:newBoxCollider',

+ 1 - 0
api/lovr/physics/Joint/init.lua

@@ -1,6 +1,7 @@
 return {
 return {
   summary = 'Joins two Colliders together.',
   summary = 'Joins two Colliders together.',
   description = 'A Joint is a physics object that constrains the movement of two Colliders.',
   description = 'A Joint is a physics object that constrains the movement of two Colliders.',
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.physics.newWeldJoint',
     'lovr.physics.newWeldJoint',
     'lovr.physics.newBallJoint',
     'lovr.physics.newBallJoint',

+ 1 - 0
api/lovr/physics/Shape/init.lua

@@ -3,6 +3,7 @@ return {
   description = [[
   description = [[
     A Shape is a physics object that can be attached to colliders to define their shape.
     A Shape is a physics object that can be attached to colliders to define their shape.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.physics.newBoxShape',
     'lovr.physics.newBoxShape',
     'lovr.physics.newSphereShape',
     'lovr.physics.newSphereShape',

+ 1 - 0
api/lovr/physics/World/init.lua

@@ -5,6 +5,7 @@ return {
 
 
     Be sure to call `World:update` on the World every frame to advance the simulation.
     Be sure to call `World:update` on the World every frame to advance the simulation.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.physics.newWorld',
   constructor = 'lovr.physics.newWorld',
   sections = {
   sections = {
     {
     {

+ 1 - 0
api/lovr/thread/Channel/init.lua

@@ -7,6 +7,7 @@ return {
     fashion. The following types of data can be passed through Channels: nil, boolean, number,
     fashion. The following types of data can be passed through Channels: nil, boolean, number,
     string, lightuserdata, table, vector, and any LÖVR object.
     string, lightuserdata, table, vector, and any LÖVR object.
   ]],
   ]],
+  extends = 'Object',
   constructors = {
   constructors = {
     'lovr.thread.newChannel',
     'lovr.thread.newChannel',
     'lovr.thread.getChannel'
     'lovr.thread.getChannel'

+ 1 - 0
api/lovr/thread/Thread/init.lua

@@ -8,6 +8,7 @@ return {
 
 
     To get `require` to work properly, add `require 'lovr.filesystem'` to the thread code.
     To get `require` to work properly, add `require 'lovr.filesystem'` to the thread code.
   ]],
   ]],
+  extends = 'Object',
   constructor = 'lovr.thread.newThread',
   constructor = 'lovr.thread.newThread',
   related = {
   related = {
     'lovr.threaderror',
     'lovr.threaderror',