lovr is the single global table that is exposed to every LÖVR app. It contains a set of modules and a set of callbacks.
Modules are the what of your app; you can use the functions in modules to tell LÖVR to do things. For example, you can draw things on the screen, figure out what buttons on a controller are pressed, or load a 3D model from a file. Each module does what it says on the tin, so the
lovr.graphics module deals with rendering graphics and
lovr.headset allows you to interact with VR hardware.
|lovr.data||Exposes low level functions for working with data.|
|lovr.event||Handles events from the operating system.|
|lovr.filesystem||Provides access to the filesystem.|
|lovr.headset||Connects to VR hardware.|
|lovr.math||Contains useful math helpers.|
|lovr.physics||Simulates 3D physics.|
|lovr.thread||Allows you to work with background threads.|
|lovr.timer||Exposes a high resolution timer.|
Callbacks are the when of the application; you write code inside callbacks which LÖVR then calls at certain points in time. For example, the
lovr.load callback is called once at startup and
lovr.controlleradded is called when controllers are connected.
|lovr.conf||Called to read configuration settings at startup.|
|lovr.controlleradded||Called when a Controller is connected.|
|lovr.controllerpressed||Called when a Controller button is pressed.|
|lovr.controllerreleased||Called when a Controller button is released.|
|lovr.controllerremoved||Called when a Controller is disconnected.|
|lovr.draw||Called continuously to render frames to the display.|
|lovr.errhand||Called when an error occurs.|
|lovr.focus||Called when the application gets or loses focus.|
|lovr.load||Called once at startup.|
|lovr.mount||Called when the headset is put on or taken off.|
|lovr.quit||Called before quitting.|
|lovr.run||The main entry point.|
|lovr.threaderror||Called when an error occurs in a thread.|
|lovr.update||Called every frame to update the application logic.|
The lovr module also exposes some functions for retrieving information about the system.
|lovr.getOS||Get the current operating system.|
|lovr.getVersion||Get the current version.|
A few helpful third-party libraries are included with LÖVR for convenience.
|json||Encodes and decodes JSON.|