The graphics module renders graphics and performs computation using the GPU.

Most of the graphics functions are on the Pass object.


lovr.graphics.compileShaderCompile shader code to bytecode.
lovr.graphics.getBufferGet a temporary Buffer.
lovr.graphics.getDefaultFontGet the default Font.
lovr.graphics.getPassGet a temporary Pass.
lovr.graphics.getWindowPassGet the window pass.
lovr.graphics.newBufferCreate a new Buffer.
lovr.graphics.newFontCreate a new Font.
lovr.graphics.newMaterialCreate a new Material.
lovr.graphics.newModelCreate a new Model.
lovr.graphics.newSamplerCreate a new Sampler.
lovr.graphics.newShaderCreate a new Shader.
lovr.graphics.newTallyCreate a new Tally.
lovr.graphics.newTextureCreate a new Texture.

Global State

lovr.graphics.getBackgroundColorGet the background color.
lovr.graphics.setBackgroundColorSet the background color.

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.presentUpdate the desktop window contents.
lovr.graphics.submitSubmit recorded graphics work to the GPU.
lovr.graphics.waitStall the CPU until all submitted GPU work is finished.

System Info

Information about the GPU hardware and the features it supports.

lovr.graphics.getDeviceGet information about the graphics device and driver.
lovr.graphics.getFeaturesGet the supported GPU features.
lovr.graphics.getLimitsGet the limits of the current GPU.
lovr.graphics.isFormatSupportedCheck if a Texture format is supported.