Skip to content

Commit 97b8cc4

Browse files
committed
update submodules
1 parent c3f6547 commit 97b8cc4

File tree

8 files changed

+328
-176
lines changed

8 files changed

+328
-176
lines changed

3rd/lovr-api

Submodule lovr-api updated 71 files

meta/3rd/lovr/library/callback.lua

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@
2727
lovr.conf = nil
2828

2929
---
30-
---This callback is called every frame.
30+
---This callback is called every frame, and receives a `Pass` object as an argument which can be used to render graphics to the display.
3131
---
32-
---Use it to render the scene.
32+
---If a VR headset is connected, this function renders to the headset display, otherwise it will render to the desktop window.
3333
---
34-
---If a VR headset is connected, anything rendered by this function will appear in the headset display.
3534
---
36-
---The display is cleared to the background color before this function is called.
35+
---### NOTE:
36+
---To render to the desktop window when a VR headset is connected, use the `lovr.mirror` callback.
37+
---
38+
---The display is cleared to the global background color before this callback is called, which can be changed using `lovr.graphics.setBackgroundColor`.
39+
---
40+
---Since the `lovr.graphics.submit` function always returns true, the following idiom can be used to submit graphics work manually and override the default submission:
41+
---
42+
--- function lovr.draw(pass)
43+
--- local passes = getPasses()
44+
--- return lovr.graphics.submit(passes)
45+
--- end
3746
---
3847
---@type fun(pass: lovr.Pass):boolean
3948
lovr.draw = nil
@@ -79,15 +88,15 @@ lovr.keyreleased = nil
7988
---
8089
---
8190
---### NOTE:
82-
---If the project was loaded from a restart using `lovr.event.restart`, the return value from the previously-run `lovr.restart` callback will be made available to this callback as the `restart` key in the `args` table.
91+
---If the project was loaded from a restart using `lovr.event.restart`, the return value from the previously-run `lovr.restart` callback will be made available to this callback as the `restart` key in the `arg` table.
8392
---
84-
---The `args` table follows the [Lua standard](https://en.wikibooks.org/wiki/Lua_Programming/command_line_parameter).
93+
---The `arg` table follows the [Lua standard](https://en.wikibooks.org/wiki/Lua_Programming/command_line_parameter).
8594
---
8695
---The arguments passed in from the shell are put into a global table named `arg` and passed to `lovr.load`, but with indices offset such that the "script" (the project path) is at index 0.
8796
---
8897
---So all arguments (if any) intended for the project are at successive indices starting with 1, and the executable and its "internal" arguments are in normal order but stored in negative indices.
8998
---
90-
---@type fun(args: table)
99+
---@type fun(arg: table)
91100
lovr.load = nil
92101

93102
---
@@ -97,9 +106,9 @@ lovr.load = nil
97106
---
98107
---The message can have a "tag" that is a short string representing the sender, and a "level" indicating how severe the message is.
99108
---
100-
---The `t.graphics.debug` flag in `lovr.conf` can be used to get log messages from the GPU driver (tagged as `GL`).
109+
---The `t.graphics.debug` flag in `lovr.conf` can be used to get log messages from the GPU driver (tagged as `GPU`).
101110
---
102-
---It is also possible to emit your own log messages using `lovr.event.push`.
111+
---It is also possible to emit customlog messages using `lovr.event.push`, or by calling the callback.
103112
---
104113
---@type fun(message: string, level: string, tag: string)
105114
lovr.log = nil
@@ -161,7 +170,22 @@ lovr.restart = nil
161170
---
162171
---This callback is the main entry point for a LÖVR program.
163172
---
164-
---It is responsible for calling `lovr.load` and returning the main loop function.
173+
---It calls `lovr.load` and returns a function that will be called every frame.
174+
---
175+
---
176+
---### NOTE:
177+
---The main loop function can return one of the following values:
178+
---
179+
---- Returning `nil` will keep the main loop running.
180+
---- Returning the string 'restart' plus an optional value will restart LÖVR.
181+
---
182+
---The value can be
183+
--- accessed in the `restart` key of the `arg` global.
184+
---- Returning a number will exit LÖVR using the number as the exit code (0 means success).
185+
---
186+
---Care should be taken when overriding this callback.
187+
---
188+
---For example, if the main loop does not call `lovr.event.pump` then the OS will think LÖVR is unresponsive, and if the quit event is not handled then closing the window won't work.
165189
---
166190
---@type fun():function
167191
lovr.run = nil

meta/3rd/lovr/library/lovr.lua

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ lovr = {}
1515
function lovr.getVersion() end
1616

1717
---
18-
---This is not a real object, but describes the behavior shared by all objects.
19-
---
20-
---Think of it as the superclass of all LÖVR objects.
18+
---The superclass of all LÖVR objects.
2119
---
2220
---In addition to the methods here, all objects have a `__tostring` metamethod that returns the name of the object's type.
2321
---
24-
---So to check if a LÖVR object is an instance of "Blob", you can do `tostring(object) == 'Blob'`.
22+
---So `tostring(object) == 'Blob'` will check if a LÖVR object is a Blob.
2523
---
2624
---
2725
---### NOTE:

meta/3rd/lovr/library/lovr/audio.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ function Source:tell(unit) end
741741
---
742742
---Instead, it will be silently ignored.
743743
---
744-
---TODO: expose a table of supported effects for spatializers in docs or from Lua.
744+
---See `lovr.audio.getSpatializer` for a table of the supported effects for each spatializer.
745745
---
746746
---@alias lovr.Effect
747747
---

meta/3rd/lovr/library/lovr/data.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -668,6 +668,10 @@ function ModelData:getNodeSkin(index) end
668668
---
669669
---Returns local transform (position, orientation, and scale) of a node, relative to its parent.
670670
---
671+
---
672+
---### NOTE:
673+
---For best results when animating, it's recommended to keep the 3 components of the scale the same.
674+
---
671675
---@overload fun(self: lovr.ModelData, name: string):number, number, number, number, number, number, number, number, number, number
672676
---@param index number # The index of the node.
673677
---@return number x # The x coordinate.

0 commit comments

Comments
 (0)