[cogl-material] Support string based blending and layer combine descriptions
authorRobert Bragg <robert@linux.intel.com>
Sun, 10 May 2009 23:40:41 +0000 (00:40 +0100)
committerRobert Bragg <robert@linux.intel.com>
Thu, 28 May 2009 01:43:28 +0000 (02:43 +0100)
commit33994caa71fea904a80971a15216e6d7fa48712c
treec4b6bc77c2c8ac9cf1501f5d2a47e6ce64c54de3
parentef1a771fde77e29b8bf327905674da59ea3d0bf0
[cogl-material] Support string based blending and layer combine descriptions

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
22 files changed:
clutter/cogl/cogl-debug.h
clutter/cogl/cogl-material.h
clutter/cogl/common/Makefile.am
clutter/cogl/common/cogl-blend-string.c [new file with mode: 0644]
clutter/cogl/common/cogl-blend-string.h [new file with mode: 0644]
clutter/cogl/common/cogl-debug.c
clutter/cogl/common/cogl-material-private.h
clutter/cogl/common/cogl-material.c
clutter/cogl/gl/cogl-context.c
clutter/cogl/gl/cogl-context.h
clutter/cogl/gl/cogl-defines.h.in
clutter/cogl/gl/cogl.c
clutter/cogl/gles/cogl-gles2-wrapper.c
clutter/cogl/gles/cogl-gles2-wrapper.h
clutter/cogl/gles/cogl-texture.c
doc/reference/cogl/Makefile.am
doc/reference/cogl/blend-strings.xml [new file with mode: 0644]
doc/reference/cogl/cogl-docs.xml
doc/reference/cogl/cogl-sections.txt
tests/conform/Makefile.am
tests/conform/test-blend-strings.c [new file with mode: 0644]
tests/conform/test-conform-main.c