Cogl.SubTexture

g Cogl.Object Cogl.Object Cogl.SubTexture Cogl.SubTexture Cogl.Object->Cogl.SubTexture

Subclasses:

None

Methods

Inherited:

Cogl.Object (2)

class

new (ctx, parent_texture, sub_x, sub_y, sub_width, sub_height)

get_parent ()

Virtual Methods

None

Fields

None

Class Details

class Cogl.SubTexture
Bases:

Cogl.Object

Abstract:

No

classmethod new(ctx, parent_texture, sub_x, sub_y, sub_width, sub_height)
Parameters:
  • ctx (Cogl.Context) – A Cogl.Context pointer

  • parent_texture (Cogl.Texture) – The full texture containing a sub-region you want to make a Cogl.SubTexture from.

  • sub_x (int) – The top-left x coordinate of the parent region to make a texture from.

  • sub_y (int) – The top-left y coordinate of the parent region to make a texture from.

  • sub_width (int) – The width of the parent region to make a texture from.

  • sub_height (int) – The height of the parent region to make a texture from.

Returns:

A newly allocated Cogl.SubTexture representing a sub-region of parent_texture.

Return type:

Cogl.SubTexture

Creates a high-level Cogl.SubTexture representing a sub-region of any other Cogl.Texture. The sub-region must strictly lye within the bounds of the parent_texture. The returned texture implements the #CoglMetaTexture interface because it’s not a low level texture that hardware can understand natively.

Remember: Unless you are using high level drawing APIs such as cogl_rectangle() or other APIs documented to understand the #CoglMetaTexture interface then you need to use the #CoglMetaTexture interface to resolve a Cogl.SubTexture into a low-level texture before drawing.

New in version 1.10.

get_parent()
Returns:

The parent texture that self derives its content from.

Return type:

Cogl.Texture

Retrieves the parent texture that self derives its content from. This is the texture that was passed to Cogl.SubTexture.new() as the parent_texture argument.

New in version 1.10.