Преглед на файлове

Mark all objects as extending Object;

bjorn преди 3 седмици
родител
ревизия
83cd5341be

+ 25 - 0
api/init.lua

@@ -2310,6 +2310,7 @@ return {
             "lovr.audio.newSource",
             "Source:clone"
           },
+          extends = "Object",
           methods = {
             {
               name = "clone",
@@ -4807,6 +4808,7 @@ return {
           constructors = {
             "lovr.data.newImage"
           },
+          extends = "Object",
           methods = {
             {
               name = "encode",
@@ -5229,6 +5231,7 @@ return {
           constructors = {
             "lovr.data.newModelData"
           },
+          extends = "Object",
           methods = {
             {
               name = "getAnimationChannelCount",
@@ -7533,6 +7536,7 @@ return {
           constructors = {
             "lovr.data.newRasterizer"
           },
+          extends = "Object",
           methods = {
             {
               name = "getAdvance",
@@ -8271,6 +8275,7 @@ return {
           constructors = {
             "lovr.data.newSound"
           },
+          extends = "Object",
           methods = {
             {
               name = "getBlob",
@@ -10324,6 +10329,7 @@ return {
           constructors = {
             "lovr.filesystem.newFile"
           },
+          extends = "Object",
           methods = {
             {
               name = "getMode",
@@ -13641,6 +13647,7 @@ return {
           constructors = {
             "lovr.graphics.newBuffer"
           },
+          extends = "Object",
           methods = {
             {
               name = "clear",
@@ -14067,6 +14074,7 @@ return {
             "lovr.graphics.newFont",
             "lovr.graphics.getDefaultFont"
           },
+          extends = "Object",
           methods = {
             {
               name = "getAscent",
@@ -14560,6 +14568,7 @@ return {
           constructors = {
             "lovr.graphics.newMaterial"
           },
+          extends = "Object",
           methods = {
             {
               name = "getProperties",
@@ -14591,6 +14600,7 @@ return {
           constructors = {
             "lovr.graphics.newMesh"
           },
+          extends = "Object",
           methods = {
             {
               name = "computeBoundingBox",
@@ -15257,6 +15267,7 @@ return {
             "lovr.graphics.newModel",
             "lovr.headset.newModel"
           },
+          extends = "Object",
           methods = {
             {
               name = "animate",
@@ -17796,6 +17807,7 @@ return {
             "lovr.graphics.getWindowPass",
             "lovr.headset.getPass"
           },
+          extends = "Object",
           methods = {
             {
               name = "barrier",
@@ -22743,6 +22755,7 @@ return {
             "Buffer:newReadback",
             "Texture:newReadback"
           },
+          extends = "Object",
           methods = {
             {
               name = "getBlob",
@@ -22866,6 +22879,7 @@ return {
           constructors = {
             "lovr.graphics.newSampler"
           },
+          extends = "Object",
           methods = {
             {
               name = "getAnisotropy",
@@ -23030,6 +23044,7 @@ return {
             "lovr.graphics.newShader",
             "Shader:clone"
           },
+          extends = "Object",
           methods = {
             {
               name = "clone",
@@ -23302,6 +23317,7 @@ return {
             "lovr.graphics.newTexture",
             "lovr.graphics.newTextureView"
           },
+          extends = "Object",
           methods = {
             {
               name = "clear",
@@ -26589,6 +26605,7 @@ return {
           constructors = {
             "lovr.headset.newLayer"
           },
+          extends = "Object",
           methods = {
             {
               name = "getColor",
@@ -28797,6 +28814,7 @@ return {
             "lovr.math.newCurve",
             "Curve:slice"
           },
+          extends = "Object",
           methods = {
             {
               name = "addPoint",
@@ -30684,6 +30702,7 @@ return {
           constructors = {
             "lovr.math.newRandomGenerator"
           },
+          extends = "Object",
           methods = {
             {
               name = "getSeed",
@@ -34765,6 +34784,7 @@ return {
             "World:newMeshCollider",
             "World:newTerrainCollider"
           },
+          extends = "Object",
           methods = {
             {
               name = "addShape",
@@ -38766,6 +38786,7 @@ return {
             "lovr.physics.newHingeJoint",
             "lovr.physics.newSliderJoint"
           },
+          extends = "Object",
           methods = {
             {
               name = "destroy",
@@ -39157,6 +39178,7 @@ return {
             "World:newMeshCollider",
             "World:newTerrainCollider"
           },
+          extends = "Object",
           methods = {
             {
               name = "containsPoint",
@@ -40594,6 +40616,7 @@ return {
           constructors = {
             "lovr.physics.newWorld"
           },
+          extends = "Object",
           methods = {
             {
               name = "destroy",
@@ -44710,6 +44733,7 @@ return {
             "lovr.thread.newChannel",
             "lovr.thread.getChannel"
           },
+          extends = "Object",
           methods = {
             {
               name = "clear",
@@ -44882,6 +44906,7 @@ return {
           constructors = {
             "lovr.thread.newThread"
           },
+          extends = "Object",
           methods = {
             {
               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 can be set to loop when it reaches the end using `Source:setLooping`.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.audio.newSource',
     '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
     the raw image data.
   ]],
+  extends = 'Object',
   constructors = {
     '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
     to load models in a thread or access more low-level information about the Model.
   ]],
+  extends = 'Object',
   constructor = 'lovr.data.newModelData'
 }

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

@@ -5,5 +5,6 @@ return {
 
     Usually you can just use `Font` objects.
   ]],
+  extends = 'Object',
   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
     import and will automatically get converted to AmbiX.  See `lovr.data.newSound` for more info.
   ]],
+  extends = 'Object',
   constructor = 'lovr.data.newSound'
 }

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

@@ -3,6 +3,7 @@ return {
   description = [[
     A File is an object that provides read or write access to a file on the filesystem.
   ]],
+  extends = 'Object',
   constructors = {
     '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
     buffer with offsets (or multiple buffers).
   ]],
+  extends = 'Object',
   constructors = {
     '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"
     (MSDF), which makes the font rendering remain crisp when text is viewed up close.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.newFont',
     '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
     material textures can be accessed as `<Type>Texture`, e.g. `RoughnessTexture`.
   ]],
+  extends = 'Object',
   constructors = {
     '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.
   ]],
+  extends = 'Object',
   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
     surface is affected by lighting.  Each mesh in the model can use a single material.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.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
     headset or the window.  The Pass will automatically get submitted afterwards.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.newPass',
     '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
     finish using `Readback:wait`.
   ]],
+  extends = 'Object',
   constructors = {
     'Buffer: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.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.newSampler'
   }

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

@@ -3,6 +3,7 @@ return {
   description = [[
     Shaders are small GPU programs.  See the `Shaders` guide for a full introduction to Shaders.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.newShader',
     '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
     textures loaded from images provide surface data to `Material` objects.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.graphics.newTexture',
     '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.
   ]],
+  extends = 'Object',
   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
     to store the path as several Curve objects.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.math.newCurve',
     '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
     needing to create a random generator.
   ]],
+  extends = 'Object',
   constructor = 'lovr.math.newRandomGenerator'
 }

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

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

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

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

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

@@ -3,6 +3,7 @@ return {
   description = [[
     A Shape is a physics object that can be attached to colliders to define their shape.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.physics.newBoxShape',
     '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.
   ]],
+  extends = 'Object',
   constructor = 'lovr.physics.newWorld',
   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,
     string, lightuserdata, table, vector, and any LÖVR object.
   ]],
+  extends = 'Object',
   constructors = {
     'lovr.thread.newChannel',
     '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.
   ]],
+  extends = 'Object',
   constructor = 'lovr.thread.newThread',
   related = {
     'lovr.threaderror',