graphics.releaseTextures()

Type Function
Library graphics.*
Return value TextureResource
Revision Release 2024.3703
Keywords textures, performance optimization, texture memory, images
See also texture:releaseSelf()
graphics.newTexture()
Texture Loading/Management (guide)
TextureResource

Overview

This convenience function disposes/releases all TextureResource objects of a specific type.

Syntax

graphics.releaseTextures( params )
params (optional)

Table. Table containing the parameters for the TextureResource object(s) to be released — see the next section for details.

Parameter Reference

type (optional)

String. The type of the texture object(s) to dispose/release. If this parameter is omitted, all texture resource objects will be released.

Example

-- Create "TextureResource" object of type "TextureResourceBitmap"
local backgroundTexture = graphics.newTexture( { type="image", filename="background.png" } )

-- Sometime later, release all texture objects of a specific type
graphics.releaseTextures( { type="image" } )