From fe4fb91fa335e2be999fc2c86ce65af51dc9f82a Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Mon, 13 Aug 2007 20:48:01 +0000 Subject: [PATCH] 2007-08-13 Matthew Allum * clutter/clutter-actor.c: * clutter/clutter-actor.h: * clutter/clutter-event.c: * clutter/clutter-event.h: * clutter/clutter-main.c: * clutter/clutter-main.h: * clutter/clutter-private.h: * clutter/clutter-stage.c: * clutter/clutter-stage.h: * clutter/clutter-types.h: Initial implementation of actors emmitting event signals (423); - Actors set_reactive() to receive mouse events. (call clutter_enable_motion_events() for per action motion events) - clutter_stage_set_key_focus () to direct key events. - Events bubble up to parents (ending at stage) (original source identified by clutter_event_get_source()) TODO: - enter/leave notifys for actors. - stage specific events - fullscreen - grabs * tests/test-events.c: Extend a little to use new API * clutter/cogl/gl/cogl.c: * clutter/glx/clutter-backend-glx.c: Move get_proc_address into cogl and out of backend. (shaders will need it) * clutter/clutter-group.c: (clutter_group_real_lower): Fix a minor compile warning. * TODO: Sync up. --- gl/cogl.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/gl/cogl.c b/gl/cogl.c index eeae57514..72d557256 100644 --- a/gl/cogl.c +++ b/gl/cogl.c @@ -29,6 +29,13 @@ #include #include +#ifdef HAVE_CLUTTER_GLX +#include +#include + +typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName); +#endif + static gulong __enable_flags = 0; #if COGL_DEBUG @@ -81,7 +88,43 @@ error_string(GLenum errorCode) CoglFuncPtr cogl_get_proc_address (const gchar* name) { - /* FIXME: This very likely needs to be handled in the backend */ + /* Sucks to ifdef here but not other option..? would be nice to + * split the code up for more reuse (once more backends use this + */ +#ifdef HAVE_CLUTTER_GLX + static GLXGetProcAddressProc get_proc_func = NULL; + static void *dlhand = NULL; + + if (get_proc_func == NULL && dlhand == NULL) + { + dlhand = dlopen (NULL, RTLD_LAZY); + + if (dlhand) + { + dlerror (); + + get_proc_func = + (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress"); + + if (dlerror () != NULL) + { + get_proc_func = + (GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddressARB"); + } + + if (dlerror () != NULL) + { + get_proc_func = NULL; + g_warning ("failed to bind GLXGetProcAddress " + "or GLXGetProcAddressARB"); + } + } + } + + if (get_proc_func) + return get_proc_func ((unsigned char*) name); +#endif + return NULL; }