2007-05-28 Matthew Allum <mallum@openedhand.com>
authorMatthew Allum <mallum@openedhand.com>
Mon, 28 May 2007 19:14:40 +0000 (19:14 +0000)
committerMatthew Allum <mallum@openedhand.com>
Mon, 28 May 2007 19:14:40 +0000 (19:14 +0000)
        * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos):
        Fix for GL/ES. Barring texture reads this means all clutter
        functionality now works on GL/ES! (no doubt with a few yet to
        be discovered bugs)

ChangeLog
clutter/clutter-stage.c

index eaeea71..3493503 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2007-05-28  Matthew Allum  <mallum@openedhand.com>
 
+       * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos):
+       Fix for GL/ES. Barring texture reads this means all clutter 
+        functionality now works on GL/ES! (no doubt with a few yet to
+       be discovered bugs)
+
+2007-05-28  Matthew Allum  <mallum@openedhand.com>
+
        * clutter/clutter-backend.c:
        * clutter/clutter-backend.h:
        * clutter/glx/clutter-stage-glx.c:
index 87c3b83..0adaf98 100644 (file)
@@ -764,7 +764,7 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage,
                                 gint          y)
 {
   ClutterMainContext *context;
-  guchar              pixel[3];
+  guchar              pixel[4];
   GLint               viewport[4];
   ClutterColor        white = { 0xff, 0xff, 0xff, 0xff };
   guint32             id;
@@ -781,13 +781,13 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage,
   clutter_actor_paint (CLUTTER_ACTOR (stage));
   context->pick_mode = FALSE;
 
-  /* Calls should work under both GL and GLES 
+  /* Calls should work under both GL and GLES, note GLES needs RGBA
    *
    * FIXME: of course we need to handle the case where the frame buffer isn't
-   * 24bpp, i.e 16bpp which could be the case with GLES.
+   * 24bpp, i.e 16bpp which could be the case with GLES ?.
   */
   glGetIntegerv(GL_VIEWPORT, viewport);
-  glReadPixels(x, viewport[3] - y, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel);
+  glReadPixels(x, viewport[3] - y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixel);
 
   /* printf("x: %i , y: %i %x:%x:%x\n", x, y, pixel[0], pixel[1], pixel[2]); */