|  |  |  | Cogl 2.0 Reference Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
CoglSubTexture; CoglSubTexture * cogl_sub_texture_new (CoglContext *ctx,CoglTexture *parent_texture,int sub_x,int sub_y,int sub_width,int sub_height); CoglBool cogl_is_sub_texture (void *object);
These functions allow high-level textures to be created that represent a sub-region of another texture. For example these can be used to implement custom texture atlasing schemes.
CoglSubTexture * cogl_sub_texture_new (CoglContext *ctx,CoglTexture *parent_texture,int sub_x,int sub_y,int sub_width,int sub_height);
Creates a high-level CoglSubTexture representing a sub-region of
any other CoglTexture. 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.
cogl_rectangle() or other APIs documented to understand the
CoglMetaTexture interface then you need to use the
CoglMetaTexture interface to resolve a CoglSubTexture into a
low-level texture before drawing.
| 
 | A CoglContext pointer | 
| 
 | The full texture containing a sub-region you want to make a CoglSubTexture from. | 
| 
 | The top-left x coordinate of the parent region to make a texture from. | 
| 
 | The top-left y coordinate of the parent region to make a texture from. | 
| 
 | The width of the parent region to make a texture from. | 
| 
 | The height of the parent region to make a texture from. | 
| Returns : | A newly allocated CoglSubTexture
representing a sub-region of parent_texture. [transfer full] | 
Since 1.10
Stability Level: Unstable
CoglBool            cogl_is_sub_texture                 (void *object);
Checks whether object is a CoglSubTexture.
| 
 | a CoglObject | 
| Returns : | TRUEif the passedobjectrepresents a
CoglSubTexture andFALSEotherwise. | 
Since 1.10
Stability Level: Unstable