SubTexture


Description:

public SubTexture (Context ctx, Texture parent_texture, int sub_x, int sub_y, int sub_width, int sub_height)

Creates a high-level SubTexture representing a sub-region of any other Texture.

The sub-region must strictly lye within the bounds of the parent_texture. The returned texture implements the MetaTexture interface because it's not a low level texture that hardware can understand natively.

<note>Remember: Unless you are using high level drawing APIs such as cogl_rectangle or other APIs documented to understand the MetaTexture interface then you need to use the MetaTexture interface to resolve a SubTexture into a low-level texture before drawing.</note>

Parameters:

ctx

A Context pointer

parent_texture

The full texture containing a sub-region you want to make a SubTexture from.

sub_x

The top-left x coordinate of the parent region to make a texture from.

sub_y

The top-left y coordinate of the parent region to make a texture from.

sub_width

The width of the parent region to make a texture from.

sub_height

The height of the parent region to make a texture from.

Returns:

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