4
* An object oriented GL/GLES Abstraction/Utility Layer
6
* Copyright (C) 2007,2008,2009 Intel Corporation.
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2 of the License, or (at your option) any later version.
13
* This library is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
30
#ifdef HAVE_CLUTTER_GLX
34
typedef CoglFuncPtr (*GLXGetProcAddressProc) (const GLubyte *procName);
39
_cogl_winsys_get_proc_address (const char *name)
41
static GLXGetProcAddressProc get_proc_func = NULL;
42
static void *dlhand = NULL;
44
if (get_proc_func == NULL && dlhand == NULL)
46
dlhand = dlopen (NULL, RTLD_LAZY);
50
g_warning ("Failed to dlopen (NULL, RTDL_LAZY): %s", dlerror ());
57
(GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
59
if (dlerror () != NULL)
62
(GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddressARB");
65
if (dlerror () != NULL)
68
g_warning ("failed to bind GLXGetProcAddress "
69
"or GLXGetProcAddressARB");
74
return get_proc_func ((GLubyte *) name);