Description [src]

final class Cogl.Texture2DSliced : Cogl.Texture
  /* No available fields */

Functions for creating and manipulating 2D meta textures that may internally be comprised of multiple 2D textures with power-of-two sizes.

These functions allow high-level meta textures (See the CoglMetaTexture interface) to be allocated that may internally be comprised of multiple 2D texture “slices” with power-of-two sizes.

This API can be useful when working with GPUs that don’t have native support for non-power-of-two textures or if you want to load a texture that is larger than the GPUs maximum texture size limits.

The algorithm for slicing works by first trying to map a virtual size to the next larger power-of-two size and then seeing how many wasted pixels that would result in. For example if you have a virtual texture that’s 259 texels wide, the next pot size = 512 and the amount of waste would be 253 texels. If the amount of waste is above a max-waste threshold then we would next slice that texture into one that’s 256 texels and then looking at how many more texels remain unallocated after that we choose the next power-of-two size. For the example of a 259 texel image that would mean having a 256 texel wide texture, leaving 3 texels unallocated so we’d then create a 4 texel wide texture - now there is only one texel of waste. The algorithm continues to slice the right most textures until the amount of waste is less than or equal to a specified max-waste threshold. The same logic for slicing from left to right is also applied from top to bottom.


hierarchy this CoglTexture2DSliced ancestor_0 CoglTexture ancestor_0--this ancestor_1 GObject ancestor_1--ancestor_0




Creates a new CoglTexture2DSliced texture based on data residing in a bitmap.


Creates a CoglTexture2DSliced that may internally be comprised of 1 or more CoglTexture2D textures depending on GPU limitations. For example if the GPU only supports power-of-two sized textures then a sliced texture will turn a non-power-of-two size into a combination of smaller power-of-two sized textures. If the requested texture size is larger than is supported by the hardware then the texture will be sliced into smaller textures that can be accessed by the hardware.

Instance methods

Methods inherited from CoglTexture (15)

Explicitly allocates the storage for the given texture which allows you to be sure that there is enough memory for the texture and if not then the error can be handled gracefully.


Queries what components the given texture stores internally as set via cogl_texture_set_components().


Copies the pixel data from a cogl texture to system memory.


Queries the GL handles for a GPU side texture through its CoglTexture.


Queries the height of a cogl texture.


Queries the pre-multiplied alpha status for internally stored red, green and blue components for the given texture as set by cogl_texture_set_premultiplied().


Queries the width of a cogl texture.

No description available.


Queries if a texture is sliced (stored as multiple GPU side tecture objects).


Sets whether the texture will automatically update the smaller mipmap levels after any part of level 0 is updated. The update will only occur whenever the texture is used for drawing with a texture filter that requires the lower mipmap levels. An application should disable this if it wants to upload its own data for the other levels. By default auto mipmapping is enabled.


Affects the internal storage format for this texture by specifying what components will be required for sampling later.


texture a CoglTexture. Sets all the pixels for a given mipmap level by copying the pixel data pointed to by the data argument into the given texture.


Affects the internal storage format for this texture by specifying whether red, green and blue color components should be stored as pre-multiplied alpha values.


Sets the pixels in a rectangular subregion of texture from an in-memory buffer containing pixel data.


Copies a specified source region from bitmap to the position (src_x, src_y) of the given destination texture handle.

Methods inherited from GObject (43)

Please see GObject for a full list of methods.


Properties inherited from CoglTexture (5)
No description available.

No description available.

No description available.

No description available.

No description available.


Signals inherited from GObject (1)

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

Class structure

struct CoglTexture2DSlicedClass {
  /* no available fields */

No description available.