## ClutterDeformEffect ClutterDeformEffect — A base class for effects deforming the geometry of an actor |

## Functions

void | clutter_deform_effect_set_back_material ()
CoglHandle | clutter_deform_effect_get_back_material ()
void | clutter_deform_effect_set_n_tiles ()
void | clutter_deform_effect_get_n_tiles ()
void | clutter_deform_effect_invalidate ()

## Properties

CoglHandle * | back-material | Read / Write
guint | x-tiles | Read / Write
guint | y-tiles | Read / Write

## Types and Values

struct | ClutterDeformEffect
struct | ClutterDeformEffectClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── ClutterActorMeta
                ╰── ClutterEffect
                    ╰── ClutterOffscreenEffect
                        ╰── ClutterDeformEffect
                            ╰── ClutterPageTurnEffect

## Description

ClutterDeformEffect is an abstract class providing all the plumbing for creating effects that result in the deformation of an actor's geometry.

ClutterDeformEffect uses offscreen buffers to render the contents of a ClutterActor and then the Cogl vertex buffers API to submit the geometry to the GPU.

ClutterDeformEffect is available since Clutter 1.4

#### Implementing ClutterDeformEffect

Sub-classes of ClutterDeformEffect should override the `ClutterDeformEffectClass.deform_vertex()` virtual function; this function is called on every vertex that needs to be deformed by the effect. Each passed vertex is an in-out parameter that initially contains the position of the vertex and should be modified according to a specific deformation algorithm.

## Functions

### clutter_deform_effect_set_back_material ()

    void
    clutter_deform_effect_set_back_material
                                   (ClutterDeformEffect *effect,
                                    CoglHandle material);

Sets the material that should be used when drawing the back face of the actor during a deformation

The ClutterDeformEffect will take a reference on the material's handle

#### Parameters

effect | a ClutterDeformEffect |
material | a handle to a Cogl material. | [allow-none]

Since: 1.4

### clutter_deform_effect_get_back_material ()

    CoglHandle
    clutter_deform_effect_get_back_material
                                   (ClutterDeformEffect *effect);

Retrieves the handle to the back face material used by `effect`

#### Parameters

effect | a ClutterDeformEffect |

#### Returns

a handle for the material, or `NULL`. The returned material is owned by the ClutterDeformEffect and it should not be freed directly.

[transfer none]

Since: 1.4

### clutter_deform_effect_set_n_tiles ()

    void
    clutter_deform_effect_set_n_tiles (ClutterDeformEffect *effect,
                                       guint x_tiles,
                                       guint y_tiles);

Sets the number of horizontal and vertical tiles to be used when applying the effect

More tiles allow a finer grained deformation at the expenses of computation

#### Parameters

effect | a ClutterDeformEffect |
x_tiles | number of horizontal tiles |
y_tiles | number of vertical tiles |

Since: 1.4

### clutter_deform_effect_get_n_tiles ()

    void
    clutter_deform_effect_get_n_tiles (ClutterDeformEffect *effect,
                                       guint *x_tiles,
                                       guint *y_tiles);

Retrieves the number of horizontal and vertical tiles used to sub-divide the actor's geometry during the effect

#### Parameters

effect | a ClutterDeformEffect |
x_tiles | return location for the number of horizontal tiles, or `NULL`. | [out]
y_tiles | return location for the number of vertical tiles, or `NULL`. | [out]

Since: 1.4

### clutter_deform_effect_invalidate ()

    void
    clutter_deform_effect_invalidate (ClutterDeformEffect *effect);

Invalidates the `effect` 's vertices and, if it is associated to an actor, it will queue a redraw

#### Parameters

effect | a ClutterDeformEffect |

Since: 1.4

## Types and Values

### struct ClutterDeformEffect

    struct ClutterDeformEffect;

The ClutterDeformEffect structure contains only private data and should be accessed using the provided API

Since: 1.4

### struct ClutterDeformEffectClass

    struct ClutterDeformEffectClass {
      void (* deform_vertex) (ClutterDeformEffect *effect,
                              gfloat               width,
                              gfloat               height,
                              CoglTextureVertex   *vertex);
    };

The ClutterDeformEffectClass structure contains only private data

#### Members

`deform_vertex` () | virtual function; sub-classes should override this function to compute the deformation of each vertex |

Since: 1.4

## Property Details

### The `“back-material”` property

      “back-material”            CoglHandle *

A material to be used when painting the back of the actor to which this effect has been applied

By default, no material will be used

Flags: Read / Write

Since: 1.4

### The `“x-tiles”` property

      “x-tiles”                  guint

The number of horizontal tiles. The bigger the number, the smaller the tiles

Flags: Read / Write

Allowed values: >= 1

Default value: 32

Since: 1.4

### The `“y-tiles”` property

      “y-tiles”                  guint

The number of vertical tiles. The bigger the number, the smaller the tiles

Flags: Read / Write

Allowed values: >= 1

Default value: 32

Since: 1.4