lovr.graphics.newTextureView

Edit

Creates a new Texture view. A texture view does not store any pixels on its own, but instead uses the pixel data of a "parent" Texture object. The width, height, format, sample count, and usage flags all match the parent. The view may have a different TextureType, and it may reference a subset of the parent texture's layers and mipmap levels.

Texture views are used for:

view = lovr.graphics.newTextureView(parent, options)

Arguments

NameTypeDefaultDescription
parentTexture The parent Texture to create a view of.
optionstable Options for the texture view.
.typeTextureType The texture type of the view. Defaults to the type of the parent.
.layernumber1 The index of the first layer referenced by the view.
.layercountnumbernil The number of layers in the view. Defaults to 1 if a layer index is provided, otherwise the view will reference all layers.
.mipmapnumber1 The index of the first mipmap referenced by the view.
.mipmapcountnumbernil The number of mipmap levels in the view. Defaults to 1 if a mipmap index is provided, otherwise the view will reference all mipmaps.
.labelstring An optional label for the view that will show up in debugging tools.

Returns

NameTypeDescription
viewTexture The new texture view.

See also