lovr
Editlovr
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
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.audio | Plays sound. |
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.graphics | Renders graphics using the GPU. |
lovr.headset | Connects to VR hardware. |
lovr.math | Contains useful math helpers. |
lovr.physics | Simulates 3D physics. |
lovr.system | Provides information about the current operating system and platform. |
lovr.thread | Allows the creation of background threads. |
lovr.timer | Exposes a high resolution timer. |
Callbacks
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.focus
is called when the VR application gains or loses input focus.
lovr.conf | Called to read configuration settings at startup. |
lovr.draw | Called continuously to render frames to the display. |
lovr.errhand | Called when an error occurs. |
lovr.filechanged | Called when a file is changed. |
lovr.focus | Called when the application gains or loses input focus. |
lovr.keypressed | Called when a key is pressed. |
lovr.keyreleased | Called when a key is released. |
lovr.load | Called once at startup. |
lovr.log | Called when a message is logged. |
lovr.mirror | Called to render content to the desktop window. |
lovr.mount | Called when the headset is put on or taken off. |
lovr.mousemoved | Called when the mouse is moved. |
lovr.mousepressed | Called when a mouse button is pressed. |
lovr.mousereleased | Called when a mouse button is released. |
lovr.permission | Called when a permission request is answered. |
lovr.quit | Called before quitting. |
lovr.recenter | Called when the user recenters the coordinate space. |
lovr.resize | Called when the window is resized. |
lovr.restart | Called when restarting. |
lovr.run | The main entry point. |
lovr.textinput | Called when text has been entered. |
lovr.threaderror | Called when an error occurs in a thread. |
lovr.update | Called every frame to update the application logic. |
lovr.visible | Called when the application gains or loses visibility. |
lovr.wheelmoved | Called when a mouse wheel is moved. |
Version
This function can be used to get the current version of LÖVR.
lovr.getVersion | Get the current version. |
Libraries
LÖVR bundles a few third-party modules by default.
enet | UDP networking library. |
http | HTTP(S) requests. |
utf8 | UTF-8 string processing. |