From 71c2f16bef3525505ccb3c20a71b1552c7e2e050 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Mon, 28 May 2007 19:14:40 +0000 Subject: [PATCH] 2007-05-28 Matthew Allum * 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 | 7 +++++++ clutter/clutter-stage.c | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index eaeea71..3493503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-05-28 Matthew Allum + * 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 + * clutter/clutter-backend.c: * clutter/clutter-backend.h: * clutter/glx/clutter-stage-glx.c: diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 87c3b83..0adaf98 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -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]); */ -- 2.7.4