summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglmisc.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-06-10 16:14:09 -0600
committerBrian Paul <[email protected]>2008-06-10 16:14:09 -0600
commitb9c5b0bc4b0abbe12770824371c173ad1e8d1046 (patch)
tree7676c36db6b8db50513411515878f0e3460dd76d /src/egl/main/eglmisc.c
parent40d1a40f294f1ed2dacfad6f5498322fc08cc2d1 (diff)
egl: some prototype API detection code
Diffstat (limited to 'src/egl/main/eglmisc.c')
-rw-r--r--src/egl/main/eglmisc.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/egl/main/eglmisc.c b/src/egl/main/eglmisc.c
index b5bdc3ea4bf..e79223657dc 100644
--- a/src/egl/main/eglmisc.c
+++ b/src/egl/main/eglmisc.c
@@ -54,6 +54,58 @@ _eglUpdateExtensionsString(_EGLDriver *drv)
}
+#if 0 /* prototype code */
+
+#include <dlfcn.h>
+
+static EGLint
+_eglFindAPIs_by_sym(void)
+{
+ EGLint mask = 0x0;
+
+ if (dlsym(NULL, "glBegin"))
+ mask |= EGL_OPENGL_BIT;
+ if (dlsym(NULL, "glGetFixedv"))
+ mask |= EGL_OPENGL_ES_BIT;
+ if (dlsym(NULL, "vgSetf"))
+ mask |= EGL_OPENVG_BIT;
+
+ return mask;
+}
+
+static EGLint
+_eglFindAPIs_by_lib(void)
+{
+ EGLint mask = 0x0;
+ int flag = RTLD_NOW;
+ void *h;
+
+ if ((h = dlopen("libGLESv1_CM.so", flag))) {
+ dlclose(h);
+ mask |= EGL_OPENGL_ES_BIT;
+ }
+
+ if ((h = dlopen("libGLESv2.so", flag))) {
+ dlclose(h);
+ mask |= EGL_OPENGL_ES2_BIT;
+ }
+
+ if ((h = dlopen("libGL.so", flag))) {
+ dlclose(h);
+ mask |= EGL_OPENGL_BIT;
+ }
+
+ if ((h = dlopen("libOpenVG.so", flag))) {
+ dlclose(h);
+ mask |= EGL_OPENVG_BIT;
+ }
+
+ return mask;
+}
+
+#endif
+
+
static void
_eglUpdateAPIsString(_EGLDriver *drv)
{