lovr.graphics
EditThe graphics module renders graphics and performs computation using the GPU.
Most of the graphics functions are on the Pass object.
Objects
| lovr.graphics.compileShader | Compile shader code to bytecode. |
| lovr.graphics.getDefaultFont | Get the default Font. |
| lovr.graphics.getWindowPass | Get the window pass. |
| lovr.graphics.newBuffer | Create a new Buffer. |
| lovr.graphics.newFont | Create a new Font. |
| lovr.graphics.newMaterial | Create a new Material. |
| lovr.graphics.newMesh | Create a new Mesh. |
| lovr.graphics.newModel | Create a new Model. |
| lovr.graphics.newPass | Create a new Pass. |
| lovr.graphics.newSampler | Create a new Sampler. |
| lovr.graphics.newShader | Create a new Shader. |
| lovr.graphics.newTexture | Create a new Texture. |
| lovr.graphics.newTextureView | Create a texture view. |
Global State
| lovr.graphics.getBackgroundColor | Get the background color. |
| lovr.graphics.isTimingEnabled | Check if timing stats are enabled. |
| lovr.graphics.setBackgroundColor | Set the background color. |
| lovr.graphics.setTimingEnabled | Enable or disable timing stats. |
Work Submission
The only way to get the GPU to do anything is to submit Pass objects to it. LÖVR submits the default pass automatically at the end of lovr.draw, but work can also be submitted manually.
| lovr.graphics.present | Update the desktop window contents. |
| lovr.graphics.submit | Submit recorded graphics work to the GPU. |
| lovr.graphics.wait | Stall the CPU until all submitted GPU work is finished. |
System Info
Information about the GPU hardware and the features it supports.
| lovr.graphics.getDevice | Get information about the graphics device and driver. |
| lovr.graphics.getFeatures | Get the supported GPU features. |
| lovr.graphics.getLimits | Get the limits of the current GPU. |
| lovr.graphics.isFormatSupported | Check if a Texture format is supported. |