Cogl.AtlasTexture.new_with_size

function new_with_size(ctx: Cogl.Context, width: Number(gint), height: Number(gint)): Cogl.AtlasTexture {
    // Gjs wrapper for cogl_atlas_texture_new_with_size()
}
  

Creates a Cogl.AtlasTexture with a given width and height. 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

A Cogl.Context

width

The width of your atlased texture.

height

The height of your atlased texture.

Returns

A new Cogl.AtlasTexture object.