lovr.graphics

Edit

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

Most of the graphics functions are on the Pass object.

Objects

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.newMeshCreate a new Mesh.
lovr.graphics.newModelCreate a new Model.
lovr.graphics.newPassCreate a new Pass.
lovr.graphics.newSamplerCreate a new Sampler.
lovr.graphics.newShaderCreate a new Shader.
lovr.graphics.newTextureCreate a new Texture.
lovr.graphics.newTextureViewCreate a texture view.

Global State

lovr.graphics.getBackgroundColorGet the background color.
lovr.graphics.isTimingEnabledCheck if timing stats are enabled.
lovr.graphics.setBackgroundColorSet the background color.
lovr.graphics.setTimingEnabledEnable 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.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.