+2008-10-29 Neil Roberts <neil@linux.intel.com>
+
+ Bug 1206 - Picking disabled dithering
+
+ * clutter/clutter-main.c (_clutter_do_pick): After picking is
+ finished, restore the state of glEnable (GL_DITHER). Otherwise it
+ will cause the scene to look different after the first pick on low
+ depth displays. (Thanks to Michael Boccara for the patch)
+
2008-10-28 Thomas Wood <thomas@linux.intel.com>
* clutter/clutter-color.c (param_color_set_default): Set the no copy
GLint viewport[4];
ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
guint32 id;
+ GLboolean dither_was_on;
context = clutter_context_get_default ();
cogl_paint_init (&white);
/* Disable dithering (if any) when doing the painting in pick mode */
+ dither_was_on = glIsEnabled (GL_DITHER);
glDisable (GL_DITHER);
/* Render the entire scence in pick mode - just single colored silhouette's
*/
glFinish();
- /* glEnable (GL_DITHER); we never enabled this originally, so its
- probably not safe to then enable it */
+ /* Restore whether GL_DITHER was enabled */
+ if (dither_was_on)
+ glEnable (GL_DITHER);
/* Read the color of the screen co-ords pixel */
glReadPixels (x, viewport[3] - y -1, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);