This adds cogl_matrix api for multiplying matrices either by a perspective
or ortho projective transform. The internal matrix stack and current-matrix
APIs also have corresponding support added.
New public API:
cogl_matrix_perspective
cogl_matrix_ortho
cogl_ortho
cogl_set_modelview_matrix
cogl_set_projection_matrix
cogl_create_context is dealt with internally when _cogl_get_default context
is called, and cogl_destroy_context is currently never called.
It might be nicer later to get an object back when creating a context so
Cogl can support multiple contexts, so these functions are being removed
from the API until we get a chance to address context management properly.
For now cogl_destroy_context is still exported as _cogl_destroy_context so
Clutter could at least install a library deinit handler to call it.
Originally cogl_vertex_buffer_add_indices let the user pass in their own unique
ID for the indices; now the Id is generated internally and returned to the
caller.
It's now possible to add arrays of indices to a Cogl vertex buffer and
they will be put into an OpenGL vertex buffer object. Since it's quite
common for index arrays to be static it saves the OpenGL driver from
having to validate them repeatedly.
This changes the cogl_vertex_buffer_draw_elements API: It's no longer
possible to provide a pointer to an index array at draw time. So
cogl_vertex_buffer_draw_elements now takes an indices identifier that
should correspond to an idendifier returned when calling
cogl_vertex_buffer_add_indices ()
There were a number of functions intended to support creating of new
primitives using materials, but at this point they aren't used outside of
Cogl so until someone has a usecase and we can get feedback on this
API, it's being removed before we release Clutter 1.0.
This removes the following API:
cogl_material_set_blend_factors
cogl_material_set_layer_combine_function
cogl_material_set_layer_combine_arg_src
cogl_material_set_layer_combine_arg_op
These were rather awkward to use, so since it's expected very few people are
using them at this point and it should be straight forward to switch over
to blend strings, the API is being removed before we release Clutter 1.0.
Setting up layer combine functions and blend modes is very awkward to do
programatically. This adds a parser for string based descriptions which are
more consise and readable.
E.g. a material layer combine function could now be given as:
"RGBA = ADD (TEXTURE[A], PREVIOUS[RGB])"
or
"RGB = REPLACE (PREVIOUS)"
"A = MODULATE (PREVIOUS, TEXTURE)"
The simple syntax and grammar are only designed to expose standard fixed
function hardware, more advanced combining must be done with shaders.
This includes standalone documentation of blend strings covering the aspects
that are common to blending and texture combining, and adds documentation
with examples specific to the new cogl_material_set_blend() and
cogl_material_layer_set_combine() functions.
Note: The hope is to remove the now redundant bits of the material API
before 1.0
ClutterTexture has many properties that can only be accessed using
the GObject API. This is fairly inefficient and makes binding the
class overly complicated.
The Texture class should have accessor methods for all its properties,
properly documented.
Add a method for deleting the current selection inside a Text actor.
This is useful for subclasses.
See bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1521
Based on a patch by: Raymond Liu <raymond.liu@intel.com>
COGLenum, COGLint and COGLuint which were simply typedefs for GL{enum,int,uint}
have been removed from the API and replaced with specialised enum typedefs, int
and unsigned int. These were causing problems for generating bindings and also
considered poor style.
The cogl texture filter defines CGL_NEAREST and CGL_LINEAR etc are now replaced
by a namespaced typedef 'CoglTextureFilter' so they should be replaced with
COGL_TEXTURE_FILTER_NEAREST and COGL_TEXTURE_FILTER_LINEAR etc.
The shader type defines CGL_VERTEX_SHADER and CGL_FRAGMENT_SHADER are handled by
a CoglShaderType typedef and should be replaced with COGL_SHADER_TYPE_VERTEX and
COGL_SHADER_TYPE_FRAGMENT.
cogl_shader_get_parameteriv has been replaced by cogl_shader_get_type and
cogl_shader_is_compiled. More getters can be added later if desired.
Add a method for deleting the current selection inside a Text actor.
This is useful for subclasses.
See bug:
http://bugzilla.openedhand.com/show_bug.cgi?id=1521
Based on a patch by: Raymond Liu <raymond.liu@intel.com>
There were several functions I believe no one is currently using that were
only implemented in the GL backend (cogl_offscreen_blit_region and
cogl_offscreen_blit) that have simply been removed so we have a chance to
think about design later with a real use case.
There was one nonsense function (cogl_offscreen_new_multisample) that
sounded exciting but in all cases it just returned COGL_INVALID_HANDLE
(though at least for GL it checked for multisampling support first!?)
it has also been removed.
The MASK draw buffer type has been removed. If we want to expose color
masking later then I think it at least would be nicer to have the mask be a
property that can be set on any draw buffer.
The cogl_draw_buffer and cogl_{push,pop}_draw_buffer function prototypes
have been moved up into cogl.h since they are for managing global Cogl state
and not for modifying or creating the actual offscreen buffers.
This also documents the API so for example desiphering the semantics of
cogl_offscreen_new_to_texture() should be a bit easier now.
Bug 1513 - Allow passing in ClutterPickMode to
clutter_stage_get_actor_at_pos()
At the moment, clutter_stage_get_actor_at_pos() uses CLUTTER_PICK_ALL
internally to find an actor. It would be useful to allow passing in
ClutterPickMode to clutter_stage_get_actor_at_pos(), so that the caller
can specify CLUTTER_PICK_REACTIVE as a criteria.
Adds a new property so that the selection color can be different from
the cursor color. If no selection color is specified it will use the
cursor color as before. If no cursor color is specified either it will
use the text color.
ClutterGroup still ships with API deprecated since 0.4. We did
promise to keep it around for a minor release cycle -- not for 3.
Since we plan on shipping 1.0 without the extra baggage of the
deprecated entry points, here's the chance to remove the accumulated
cruft.
All the removed methods and signals have a ClutterContainer
counterpart.
Since we're planning to release 1.0 without any of the deprecated
API baggage, we can simply remove the set_uniform_1f() method from
ClutterShader public API and add it to the deprecated header.
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.