set_components


Description:

public void set_components (TextureComponents components)

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

This api affects how data is uploaded to the GPU since unused components can potentially be discarded from source data.

For textures created by the ‘_with_size’ constructors the default is cogl_texture_components_rgba. The other constructors which take a coglbitmap or a data pointer default to the same components as the pixel format of the data.

Note that the cogl_texture_components_rg format is not available on all drivers. The availability can be determined by checking for the cogl_feature_id_texture_rg feature. If this format is used on a driver where it is not available then cogl_texture_error_format will be raised when the texture is allocated. Even if the feature is not available then cogl_pixel_format_rg_88 can still be used as an image format as long as cogl_texture_components_rg isn't used as the texture's components.

Parameters:

this

a Texture pointer.