Cogl.Texture.prototype.set_components
function set_components(components: Cogl.TextureComponents): void {
// Gjs wrapper for cogl_texture_set_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.TextureComponents.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.TextureComponents.rg format is not available on all drivers. The availability can be determined by checking for the Cogl.FeatureID.ogl_feature_id_texture_rg feature. If this format is used on a driver where it is not available then Cogl.TextureError.format will be raised when the texture is allocated. Even if the feature is not available then Cogl.PixelFormat.rg_88 can still be used as an image format as long as Cogl.TextureComponents.rg isn't used as the texture's components.
Since 1.18
- components