![]() |
![]() |
![]() |
Clutter Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
ClutterOffscreenEffect; ClutterOffscreenEffectClass; CoglHandle clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect
); CoglHandle clutter_offscreen_effect_create_target (ClutterOffscreenEffect *effect
,gfloat width
,gfloat height
); void clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect
);
GObject +----GInitiallyUnowned +----ClutterActorMeta +----ClutterEffect +----ClutterOffscreenEffect +----ClutterShaderEffect
ClutterOffscreenEffect is an abstract class that can be used by ClutterEffect sub-classes requiring access to an offscreen buffer.
Some effects, like the fragment shader based effects, can only use GL textures, and in order to apply those effects to any kind of actor they require that all drawing operations are applied to an offscreen framebuffer that gets redirected to a texture.
ClutterOffscreenEffect provides all the heavy-lifting for creating the offscreen framebuffer, the redirection and the final paint of the texture on the desired stage.
Creating a sub-class of ClutterOffscreenEffect requires, in case of overriding the ClutterEffect virtual functions, to chain up to the ClutterOffscreenEffect's implementation.
On top of the ClutterEffect's virtual functions,
ClutterOffscreenEffect also provides a
function, which encapsulates the effective painting of the texture that
contains the result of the offscreen redirection.paint_target()
The size of the target material is defined to be as big as the
transformed size of the ClutterActor using the offscreen effect.
Sub-classes of ClutterOffscreenEffect can change the texture creation
code to provide bigger textures by overriding the
virtual function; no chain up
to the ClutterOffscreenEffect implementation is required in this
case.create_target()
ClutterOffscreenEffect is available since Clutter 1.4
typedef struct _ClutterOffscreenEffect ClutterOffscreenEffect;
The ClutterOffscreenEffect structure contains only private data and should be accessed using the provided API
Since 1.4
typedef struct { CoglHandle (* create_target) (ClutterOffscreenEffect *effect, gfloat min_width, gfloat min_height); void (* paint_target) (ClutterOffscreenEffect *effect); } ClutterOffscreenEffectClass;
The ClutterOffscreenEffectClass structure contains only private data
Since 1.4
CoglHandle clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect
);
Retrieves the material used as a render target for the offscreen
buffer created by effect
|
a ClutterOffscreenEffect |
Returns : |
a handle for a CoglMaterial, or
COGL_INVALID_HANDLE . The returned handle is owned by Clutter
and it should not be modified or freed. [transfer none]
|
Since 1.4
CoglHandle clutter_offscreen_effect_create_target (ClutterOffscreenEffect *effect
,gfloat width
,gfloat height
);
Calls the create_target()
virtual function of the effect
|
a ClutterOffscreenEffect |
|
the minimum width of the target texture |
|
the minimum height of the target texture |
Returns : |
a handle to the target texture |
Since 1.4
void clutter_offscreen_effect_paint_target
(ClutterOffscreenEffect *effect
);
Calls the paint_target()
virtual function of the effect
|
a ClutterOffscreenEffect |
Since 1.4