ClutterDeformEffect

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

Synopsis

struct              ClutterDeformEffect;
struct              ClutterDeformEffectClass;
void                clutter_deform_effect_set_back_material
                                                        (ClutterDeformEffect *effect,
                                                         CoglHandle material);
CoglHandle          clutter_deform_effect_get_back_material
                                                        (ClutterDeformEffect *effect);
void                clutter_deform_effect_set_n_tiles   (ClutterDeformEffect *effect,
                                                         guint x_tiles,
                                                         guint y_tiles);
void                clutter_deform_effect_get_n_tiles   (ClutterDeformEffect *effect,
                                                         guint *x_tiles,
                                                         guint *y_tiles);

void                clutter_deform_effect_invalidate    (ClutterDeformEffect *effect);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActorMeta
               +----ClutterEffect
                     +----ClutterOffscreenEffect
                           +----ClutterDeformEffect
                                 +----ClutterPageTurnEffect

Properties

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

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.

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.

ClutterDeformEffect is available since Clutter 1.4

Details

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

deform_vertex ()

virtual function; sub-classes should override this function to compute the deformation of each vertex

Since 1.4


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

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

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

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

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

effect :

a ClutterDeformEffect

Since 1.4

Property Details

The "back-material" property

  "back-material"            CoglHandle*           : Read / Write

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

Since 1.4


The "x-tiles" property

  "x-tiles"                  guint                 : Read / Write

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

Allowed values: >= 1

Default value: 32

Since 1.4


The "y-tiles" property

  "y-tiles"                  guint                 : Read / Write

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

Allowed values: >= 1

Default value: 32

Since 1.4