summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 15:44:28 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2007-02-08 15:44:28 +0000
commit4d6faca615d3d000a0974e8e9ad3755817cd7654 (patch)
tree237c6601d50fc27110b82072d47ab18853c6ce21 /src
parenta72fa970a73c71e1d556f18f333b9db7b920f7f3 (diff)
Add support for glutGetProcAddress() on Mac OS X and other platforms
via dlsym() (STR #1582) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5673 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/glut_compatability.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 7b8832f43..47079905d 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -43,6 +43,9 @@
# define GLX_GLXEXT_LEGACY
# include <GL/glx.h>
# endif // HAVE_GLXGETPROCADDRESSARB
+# ifdef HAVE_DLSYM
+# include <dlfcn.h>
+# endif // HAVE_DLSYM
# define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
@@ -439,8 +442,17 @@ int glutDeviceGet(GLenum type) {
GLUTproc glutGetProcAddress(const char *procName) {
# ifdef WIN32
return (GLUTproc)wglGetProcAddress((LPCSTR)procName);
+
+# elif defined(HAVE_DLSYM)
+ char symbol[1024];
+
+ snprintf(symbol, sizeof(symbol), "_%s", procName);
+
+ return (GLUTproc)dlsym(RTLD_DEFAULT, symbol);
+
# elif defined(HAVE_GLXGETPROCADDRESSARB)
return (GLUTproc)glXGetProcAddressARB((const GLubyte *)procName);
+
# else
return (GLUTproc)0;
# endif // WIN32