offscreen-effect: Rename create_target to create_buffer

*** This is an API change ***

The create_target() virtual function should return a CoglHandle to a
texture; clutter_offscreen_effect_get_target(), instead, returns a
CoglMaterial to be painted in the implementation of the paint_target()
virtual function.

Instead of equating textures with materials, and confusing the user of
the API, we should mark the difference more prominently.

First of all, we should return a CoglMaterial* (now that we have that
as a public type) in get_target(); having handles all over the place
does not make it easier to distinguish the semantics of the virtual
functions.

Then we should rename create_target() to create_texture(), to make it
clear that what should be returned is a texture that is used as the
backing for the offscreen framebuffer.
This commit is contained in:
Emmanuele Bassi
2010-09-01 17:56:15 +01:00
parent 6c40b10083
commit 12a5bf2e06
3 changed files with 32 additions and 29 deletions

View File

@ -62,7 +62,7 @@ struct _ClutterOffscreenEffect
/**
* ClutterOffscreenEffectClass:
* @create_target: virtual function
* @create_texture: virtual function
* @paint_target: virtual function
*
* The #ClutterOffscreenEffectClass structure contains only private data
@ -75,7 +75,7 @@ struct _ClutterOffscreenEffectClass
ClutterEffectClass parent_class;
/*< public >*/
CoglHandle (* create_target) (ClutterOffscreenEffect *effect,
CoglHandle (* create_texture) (ClutterOffscreenEffect *effect,
gfloat min_width,
gfloat min_height);
void (* paint_target) (ClutterOffscreenEffect *effect);
@ -92,12 +92,12 @@ struct _ClutterOffscreenEffectClass
GType clutter_offscreen_effect_get_type (void) G_GNUC_CONST;
CoglHandle clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect);
CoglMaterial *clutter_offscreen_effect_get_target (ClutterOffscreenEffect *effect);
void clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect);
CoglHandle clutter_offscreen_effect_create_target (ClutterOffscreenEffect *effect,
gfloat width,
gfloat height);
void clutter_offscreen_effect_paint_target (ClutterOffscreenEffect *effect);
CoglHandle clutter_offscreen_effect_create_texture (ClutterOffscreenEffect *effect,
gfloat width,
gfloat height);
G_END_DECLS