Material Internals
3
COGL Library

# Material Internals

## Synopsis

    const GList *       cogl_material_get_layers            (CoglHandle material);
    enum                CoglMaterialLayerType;
    CoglMaterialLayerType  cogl_material_layer_get_type     (CoglHandle layer_handle);
    CoglHandle          cogl_material_layer_get_texture     (CoglHandle layer_handle);

## Description

## Details

### cogl_material_get_layers ()

    const GList *       cogl_material_get_layers            (CoglHandle material);

This function lets you access a materials internal list of layers for iteration.

`material` :

Returns :

### enum CoglMaterialLayerType

    typedef enum { /*< prefix=COGL_MATERIAL_LAYER_TYPE >*/
      COGL_MATERIAL_LAYER_TYPE_TEXTURE
    } CoglMaterialLayerType;

Available types of layers for a CoglMaterial. This enumeration might be expanded in later versions.

`COGL_MATERIAL_LAYER_TYPE_TEXTURE`

  The layer represents a Cogl texture

Since 1.0

### cogl_material_layer_get_type ()

    CoglMaterialLayerType  cogl_material_layer_get_type     (CoglHandle layer_handle);

Retrieves the type of the layer

Currently there is only one type of layer defined: `COGL_MATERIAL_LAYER_TYPE_TEXTURE`, but considering we may add purely GLSL based layers in the future, you should write code that checks the type first.

`layer_handle` :

Returns :

### cogl_material_layer_get_texture ()

    CoglHandle          cogl_material_layer_get_texture     (CoglHandle layer_handle);

This lets you extract a CoglTexture handle for a specific layer.

In the future, we may support purely GLSL based layers which will likely return `COGL_INVALID_HANDLE` if you try to get the texture. Considering this, you can call cogl_material_layer_get_type first, to check it is of type `COGL_MATERIAL_LAYER_TYPE_TEXTURE`.

`layer_handle` :

Returns :