Next: , Previous: ClutterModel, Up: Top

48 ClutterOffscreenEffect

Base class for effects using offscreen buffers

48.1 Overview

<clutter-offscreen-effect> is an abstract class that can be used by <clutter-effect> 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.

<clutter-offscreen-effect> provides all the heavy-lifting for creating the offscreen framebuffer, the redirection and the final paint of the texture on the desired stage.

48.2 Implementing a ClutterOffscreenEffect

Creating a sub-class of <clutter-offscreen-effect> requires, in case of overriding the <clutter-effect> virtual functions, to chain up to the <clutter-offscreen-effect>'s implementation.

On top of the <clutter-effect>'s virtual functions, <clutter-offscreen-effect> also provides a paint-target function, which encapsulates the effective painting of the texture that contains the result of the offscreen redirection.

The size of the target material is defined to be as big as the transformed size of the <clutter-actor> using the offscreen effect. Sub-classes of <clutter-offscreen-effect> can change the texture creation code to provide bigger textures by overriding the create-texture virtual function; no chain up to the <clutter-offscreen-effect> implementation is required in this case.

<clutter-offscreen-effect> is available since Clutter 1.4

48.3 Usage