Cogl.AtlasTexture.new_from_file
function new_from_file(ctx: Cogl.Context, filename: String): Cogl.AtlasTexture { // Gjs wrapper for cogl_atlas_texture_new_from_file() }
Creates a Cogl.AtlasTexture from an image file. A Cogl.AtlasTexture represents a sub-region within one of Cogl's shared texture atlases.
The storage for the texture is not allocated before this function returns. You can call Cogl.Texture.prototype.allocate to explicitly allocate the underlying storage or let Cogl automatically allocate storage lazily.
The texture is still configurable until it has been allocated so for example you can influence the internal format of the texture using Cogl.Texture.prototype.set_components and Cogl.Texture.prototype.set_premultiplied.
<note>Allocate call can fail if Cogl considers the internal format to be incompatible with the format of its internal atlases.</note>
<note>The returned Cogl.AtlasTexture is a high-level meta-texture with some limitations. See the documentation for Cogl.MetaTexture for more details.</note>
Since 1.16
- ctx
- filename
the file to load
- Returns
A new Cogl.AtlasTexture object or null on failure and @error will be updated.