Commit Graph

4 Commits

Author SHA1 Message Date
Robert Bragg
24ca92951f [cogl] Adds cogl_read_pixels to replace direct use of glReadPixels
To allow for flushing of batched geometry within Cogl we can't support users
directly calling glReadPixels.  glReadPixels is also awkward, not least
because it returns upside down image data.

All the unit tests have been swithed over and clutter_stage_read_pixels now
sits on top of this too.
2009-06-29 23:49:06 +01:00
Robert Bragg
80aceda9bb [test-blend-strings] Explicitly request RGBA_888 tex format for test textures
This test assumes that the textures will be stored internally with exactly
the color given so that specific texture combining arithmetic can be
tested. Using COGL_PIXEL_FORMAT_ANY allows Cogl to internally premultiply
the textures, so we have to explicitly request an unmultiplied format.
2009-06-11 14:17:53 +01:00
Robert Bragg
a87f6f32a6 [test-blend-strings] Fix a silly off by one that meant the test couldn't fail
The test was quiting after the 2nd frame but it should be the third frame because
the test doesn't actually check results until the third frame due to the workaround
for drivers with broken glReadPixels.

(When first written the test would have been verified with the
clutter_main_quit() commented out which gives visual feedback of what the
test does, so the off by one would have snuck in just before uncommenting
and pushing.)
2009-06-07 21:01:45 +01:00
Robert Bragg
33994caa71 [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
2009-05-28 02:43:28 +01:00