This function was renamed a while ago in the .c file from
cogl_vertex_buffer_draw_range_elements but the corresponding .h and
doc/reference/cogl changes weren't made.
The Animation API should follow this pattern:
- functions with an Interval as part of the arguments should have
"interval" inside their name, e.g.:
clutter_animation_bind_interval
clutter_animation_update_interval
- functions dealing with property names should have "property"
inside their name, e.g.:
clutter_animation_has_property
clutter_animation_unbind_property
- unless -
- functions dealing with a property and its value should not
have any modifier, e.g.:
clutter_animation_bind
The change from update_property() to update_interval() frees up
clutter_animation_update(), to be added at a later date.
Bug 1438 - Implicit Animation API could use animatev variants
The clutter_actor_animate* family of functions use va_lists to
handle the property/value pairs for the final state of the
animation.
Language bindings have problems with variadic arguments functions,
and usually prefer vector-based API which allow a greater level
of control and conversion from native data types.
For each variadic arguments function in the clutter_actor_animate*
family there should be a vector-based version that takes:
- the number of property/value pairs
- a constant array of constant strings
- an array of GValues
Most of the internal implementation can be refactored from the
current one, thus both the var_args and the vector entry points
share a common implementation of the code; then, both versions
of the API are just loops over a list of arguments.
Based on a patch by: Robert Carr <carrr@rpi.edu>
The ClutterColor API has some inconsistencies:
- the string deserialization function does not match the rest of
the conversion function naming policy; the naming should be:
clutter_color_parse() -> clutter_color_from_string()
and the first parameter should be the ClutterColor that will
be set from the string, not the string itself (a GDK-ism).
- the fixed point API should not be exposed, especially in the
form of ClutterFixed values
- the non-fixed point HLS conversion functions do not make any
sense. The values returned should be:
hue := range [ 0, 360 ]
luminance := range [ 0, 1 ]
saturation := range [ 0, 1 ]
like the current fixed point API does. Returning a value in
the [ 0, 255 ] range is completely useless
- the clutter_color_equal() should be converted for its use inside
a GHashTable; a clutter_color_hash() should be added as well
- the second parameter of the clutter_color_shade() function should
be the shading factor, not the result (another GDK-ism). this way
the function call can be translated from this:
color.shade(out result, factor)
to the more natural:
color.shade(factor, out result)
This somewhat large commit fixes all these issues and updates the
internal users of the API.
In the future if we want to annotate matrices with internal flags, and add
caching of the inverse matrix then we need to ensure that all matrix
modifications are done by cogl_matrix API so we'd know when to dirty the
cache or update the flags.
This just adds documentation to that effect, and assuming the most likley
case where someone would try and directly write to matrix members would
probably be to load a constant matrix other than the identity matrix; I
renamed cogl_matrix_init_from_gl_matrix to cogl_matrix_init_from_array to
make it seem more general purpose.
Clutter uses checks on various environment variables and installs
various command line switches. The API reference should list them
and document them both.
The COGL_DEFINE_HANDLE macro generates a cogl_is_<type> function
as well, to check whether a CoglHandle opaque pointer is of type
<type>.
The handle for CoglMaterial does not export cogl_is_material() in
its installed header.
cogl_paint_init was a bit too miscellaneous; it mainly cleared the color, depth
and stencil buffers but arbitrarily it also disabled fogging and lighting.
It no longer disables lighting, since we know Cogl never enables lighting and
disabling of fog is now handled with a seperate function.
Since I noticed cogl_set_fog was taking a density argument documented as
"Ignored" I've also added a mode argument to cogl_set_fog which exposes the
exponential fog modes which can make use of the density.
This hides a number of internal structs and enums from the docs, and moves
some functions to more appropriate sections as well as misc description
updates (mostly for the vertex buffer api)
The :alignment property is prone to generate confusion: developers
will set it thinking that the contents of a ClutterText will
automagically align themselves.
Instead of using the generic term :alignment, and following the
GTK+ convention, we should use a more specific term, conveying the
actual effect of the property: alignment of the lines with respect
to each other, and not to the overall allocated area.
See bug 1428:
http://bugzilla.openedhand.com/show_bug.cgi?id=1428
Final bit of integration between ClutterActor and Pango: a simple
method for creating a PangoLayout, pre-filled with text and ready
to be rendered using cogl_pango_render_layout().
This should make writing new Actors rendering custom text in their
paint() implementation easy and reliable.
The Alpha API and usage has been changed by the recent overhaul
of the ClutterAlpha class; hence, we need to update the relative
documentation in the animation tutorial.
Bug 1349 - Using the anchor point to set the scale center is messy
The branch adds an extra center point for scaling which can be used
for example to set a scale about the center without affecting the
position of the actor.
The scale center can be specified as a unit offset from the origin or
as a gravity. If specified as a gravity it will be stored as a
fraction of the actor's size so that the position will track when the
actor changes size.
The anchor point and rotation centers have been modified so they can
be set with a gravity in the same way. However, only the Z rotation
exposes a property to set using a gravity because the other two
require a Z coordinate which doesn't make sense to interpret as a
fraction of the actor's width or height.
Conflicts:
clutter/clutter-actor.c
* generic-actor-clone:
Remove CloneTexture from the API
[tests] Clean up the Clone interactive test
Rename ActorClone to Clone/2
Rename ActorClone to Clone/1
Improves the unit test to verify more awkward scaling and some corresponding fixes
Implements a generic ClutterActorClone that doesn't need fbos.
Conflicts:
clutter/cogl/gl/cogl-texture.c
clutter/cogl/gles/cogl-primitives.c
* cogl-material:
clutter-{clone-,}texture weren't updating their material opacity.
Updates GLES1 support for CoglMaterial
Normalizes gl vs gles code in preperation for synching material changes
Removes cogl_blend_func and cogl_alpha_func
Fully integrates CoglMaterial throughout the rest of Cogl
[cogl-material] Restore the GL_TEXTURE_ENV_MODE after material_rectangle
[cogl-material] Make the user_tex_coords parameter of _rectangle const
[test-cogl-material] Remove return value from material_rectangle_paint
Add cogl-material.h and cogl-matrix.h to libclutterinclude_HEADERS
[cogl-material] improvements for cogl_material_rectangle
[cogl-material] Adds a cogl_material_set_color function
[cogl-material] Some improvements for how we sync CoglMaterial state with OpenGL
[cogl-material] Converts clutter-texture/clutter-clone-texture to the material API
[doc] Hooks up cogl-material reference documentation
Updates previous GLES multi-texturing code to use CoglMaterial
Adds a CoglMaterial abstraction, which includes support for multi-texturing
[doc] Hooks up cogl-matrix reference documentation
Adds CoglMatrix utility code
[tests] Adds an interactive unit test for multi-texturing
[multi-texturing] This adds a new cogl_multi_texture API for GL,GLES1 + GLES2
ClutterClone supercedes ClutterCloneTexture, since it can clone
every kind of actor -- including composite ones.
This is another "brain surgery with a shotgun" kind of commit: it
removes CloneTexture and updates every test case using CloneTexture
to ClutterClone. The API fallout is minimal, luckily for us.
The hope is that this function makes it easier to extend the font
settings with more flags without having to add a function for every
setting.
A new flag for enabling hinting has been added. If set, this changes
the font options on the global PangoContext and any newly created
PangoContexts. The options are only set if the flag is changed from
the default so it won't override any detailed setting chosen by the
backend.
The documentation has been updated to reflect the fact that the anchor
point will move when the actor changes size if it was specified using
a gravity value. The new functions for setting the scale center and z
rotation gravity are also documented.
The clutter_stage_get_resolution() and fixed-point API are just
shorthands for:
clutter_backend_get_resolution (default_backend);
And as such do not fit at all in the ClutterStage class. The only
reason for their existence was the ClutterUnit conversion macros,
which have now been fixed to use the default backend through a
function call instead.
Thus, we can safely remove the stage entry points.
* float-alpha-value:
[script] Parse easing modes by name
[docs] Update the easing modes documentation
[animation] Implement new easing functions
[animation] Move the alpha value to floating point
An em is a unit of measurement in typography, equal to the point
size of the current font.
It should be possible to convert a value expressed in em to
ClutterUnits by using the current font and the current DPI as
stored by the default backend.
The stage-with/height-percentage converters had been broken by
the multiple-stages support of Clutter 0.8. They are also made
useless by the fact that Units are now floating point values.
The millimeters and typographic points converters also depended
on the default stage, but they can be reworked to use the default
DPI coming from the default Backend instead.
This better reflects the fact that the api manages sets of vertex attributes,
and the attributes really have no implied form. It is only when you use the
attributes to draw that they become mesh like; when you specify how they should
be interpreted, e.g. as triangle lists or fans etc. This rename frees up the
term "mesh", which can later be applied to a concept slightly more fitting.
E.g. at some point it would be nice to have a higher level abstraction that
sits on top of cogl vertex buffers that adds the concept of faces. (Somthing
like Blender's mesh objects.) There have also been some discussions over
particle engines, and these can be defined in terms of emitter faces; so some
other kind of mesh abstraction might be usefull here.
Okey; to summarise the changes...
We have converted Clutter and Cogl over to using floating point internally
instead of 16.16 fixed, but we have maintained the cogl-fixed API as a
utility to applications in case they want to implement their own optimizations.
The Clutter API has not changed (though ClutterFixed and ClutterUnit are now
internally floats) but all Cogl entry points have been changed to accept floats
now instead of CoglFixed.
To summarise the rationale...
There have been a number of issues with using fixed point though out Clutter
and Cogl including: lack of precision, lack of range, excessive format
conversion (GPUs tend to work nativly with IEEE floats) and maintainability.
One of the main arguments for fixed point - performance - hasn't shown
itself to be serious in practice so far since we seem to be more limited
by GPU performance and making improvements regarding how we submit data to
OpenGL[ES]/the GPU has had a more significant impact.
Ref: The recent multiple rectangle queuing changes + the
cogl-texture-agressive-batching branch which show significant performance
gains, and that recent tests on the ipodtouch (ARM + MBX) also showed no
loss of performance running with floats.
So finally; please forgive the inevitable fallout, this is a far reaching
change. There are still a few known issues with the fixed to float
conversion but enough works for all our conformance tests to pass, and the
remaining issues hopefully wont be too tricky to solve. For reference two
tags will be available either side of this change: "cogl-fixed-end" and
"cogl-float-start"
The ClutterAlpha API reference page should also list the
easing modes Clutter provides by default, by showing the
curves used by each entry in the AnimationMode enumeration.
We can also remove the incomplete graph showing the old
alpha functions.
To deal with all the corner cases that couldn't be scripted a number of patches
were written for the remaining 10% of the effort.
Note: again no API changes were made in Clutter, only in Cogl.
In order to unify alpha functions and animation modes in ClutterAlpha
we should be able to register alpha functions and get a logical id
for them; the logical id will then be available to be used by
clutter_alpha_set_mode().
The registration requires API changes in ClutterAlpha constructors
and methods. It also provides the chance to shift ClutterAlpha
towards the use of animations modes only, and to alpha functions
as a convenience API for language bindings alone.
The Effects API and all related symbols have been superceded by
the newly added Animation API and clutter_actor_animate().
This commit removes the Effects implementation, the documentation
and the interactive test/example code.