File tree 3 files changed +18
-13
lines changed
3 files changed +18
-13
lines changed Original file line number Diff line number Diff line change
1
+ 2.0.0.3
2
+ -------
3
+ * Fixed dynamic loading of GLU library for recent GHC versions.
4
+
1
5
2.0.0.2
2
6
-------
3
7
* Relaxed upper version bound for ` OpenGLRaw ` .
Original file line number Diff line number Diff line change 1
1
name : GLURaw
2
- version : 2.0.0.2
2
+ version : 2.0.0.3
3
3
synopsis : A raw binding for the OpenGL graphics system
4
4
description :
5
5
GLURaw is a raw Haskell binding for the GLU 1.3 OpenGL utility library . It is
Original file line number Diff line number Diff line change @@ -69,10 +69,16 @@ hs_GLU_getProcAddress(const char *name)
69
69
#include <stdlib.h>
70
70
#include <dlfcn.h>
71
71
72
- #ifndef __APPLE__
73
- #include <stdio.h>
74
- #include <GL/glu.h>
72
+ static const char * libNames [] = {
73
+ #ifdef __APPLE__
74
+ /* Try public framework path first. */
75
+ "/Library/Frameworks/OpenGL.framework/OpenGL" ,
76
+ /* If the public path failed, try the system framework path. */
77
+ "/System/Library/Frameworks/OpenGL.framework/OpenGL"
78
+ #else
79
+ "libGLU.so" , "libGLU.so.1"
75
80
#endif
81
+ };
76
82
77
83
void *
78
84
hs_GLU_getProcAddress (const char * name )
@@ -81,18 +87,13 @@ hs_GLU_getProcAddress(const char *name)
81
87
static void * handle = NULL ;
82
88
83
89
if (firstTime ) {
90
+ int i , numNames = (int )(sizeof (libNames ) / sizeof (libNames [0 ]));
84
91
firstTime = 0 ;
85
- /* Get a handle for our executable. */
86
- handle = dlopen (NULL , RTLD_LAZY );
92
+ for (i = 0 ; (!handle ) && (i < numNames ); ++ i ) {
93
+ handle = dlopen (libNames [i ], RTLD_LAZY | RTLD_GLOBAL );
94
+ }
87
95
}
88
96
89
- #ifndef __APPLE__
90
- /* Hack to force linking of GLU on Linux */
91
- FILE * bitbucket = fopen ("/dev/null" , "w" );
92
- fprintf (bitbucket , "%p\n" , gluBeginCurve );
93
- fclose (bitbucket );
94
- #endif
95
-
96
97
return handle ? dlsym (handle , name ) : NULL ;
97
98
}
98
99
You can’t perform that action at this time.
0 commit comments