lovr

Edit

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

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.audioPlays sound.
lovr.dataExposes low level functions for working with data.
lovr.eventHandles events from the operating system.
lovr.filesystemProvides access to the filesystem.
lovr.graphicsRenders graphics using the GPU.
lovr.headsetConnects to VR hardware.
lovr.mathContains useful math helpers.
lovr.physicsSimulates 3D physics.
lovr.systemProvides information about the current operating system and platform.
lovr.threadAllows the creation of background threads.
lovr.timerExposes 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.confCalled to read configuration settings at startup.
lovr.drawCalled continuously to render frames to the display.
lovr.errhandCalled when an error occurs.
lovr.filechangedCalled when a file is changed.
lovr.focusCalled when the application gains or loses input focus.
lovr.keypressedCalled when a key is pressed.
lovr.keyreleasedCalled when a key is released.
lovr.loadCalled once at startup.
lovr.logCalled when a message is logged.
lovr.mirrorCalled to render content to the desktop window.
lovr.mountCalled when the headset is put on or taken off.
lovr.mousemovedCalled when the mouse is moved.
lovr.mousepressedCalled when a mouse button is pressed.
lovr.mousereleasedCalled when a mouse button is released.
lovr.permissionCalled when a permission request is answered.
lovr.quitCalled before quitting.
lovr.recenterCalled when the user recenters the coordinate space.
lovr.resizeCalled when the window is resized.
lovr.restartCalled when restarting.
lovr.runThe main entry point.
lovr.textinputCalled when text has been entered.
lovr.threaderrorCalled when an error occurs in a thread.
lovr.updateCalled every frame to update the application logic.
lovr.visibleCalled when the application gains or loses visibility.
lovr.wheelmovedCalled when a mouse wheel is moved.

Version

This function can be used to get the current version of LÖVR.

lovr.getVersionGet the current version.

Libraries

LÖVR bundles a few third-party modules by default.

enetUDP networking library.
httpHTTP(S) requests.
utf8UTF-8 string processing.