2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/cogl/gl/cogl.c (cogl_get_proc_address): Implement non-GLX version using GModule and looking up the symbol from the running process. It should work when linked to library providing the requested function. (#696, Tommi Komulainen)
This commit is contained in:
parent
d05783675b
commit
db990ccac8
2 changed files with 26 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
|
* clutter/cogl/gl/cogl.c (cogl_get_proc_address): Implement non-GLX
|
||||||
|
version using GModule and looking up the symbol from the running
|
||||||
|
process. It should work when linked to library providing the
|
||||||
|
requested function. (#696, Tommi Komulainen)
|
||||||
|
|
||||||
2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
|
2008-01-14 Emmanuele Bassi <ebassi@openedhand.com>
|
||||||
|
|
||||||
* configure.ac: Post-release bump to 0.5.3
|
* configure.ac: Post-release bump to 0.5.3
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "cogl.h"
|
#include "cogl.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <gmodule.h>
|
||||||
|
|
||||||
#ifdef HAVE_CLUTTER_GLX
|
#ifdef HAVE_CLUTTER_GLX
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
@ -125,7 +126,24 @@ cogl_get_proc_address (const gchar* name)
|
||||||
|
|
||||||
if (get_proc_func)
|
if (get_proc_func)
|
||||||
return get_proc_func ((unsigned char*) name);
|
return get_proc_func ((unsigned char*) name);
|
||||||
#endif
|
|
||||||
|
#else /* !HAVE_CLUTTER_GLX */
|
||||||
|
|
||||||
|
/* this should find the right function if the program is linked against a
|
||||||
|
* library providing it */
|
||||||
|
static GModule *module = NULL;
|
||||||
|
if (module == NULL)
|
||||||
|
module = g_module_open (NULL, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
|
||||||
|
|
||||||
|
if (module)
|
||||||
|
{
|
||||||
|
gpointer symbol;
|
||||||
|
|
||||||
|
if (g_module_symbol (module, name, &symbol))
|
||||||
|
return symbol;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* HAVE_CLUTTER_GLX */
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue