File tree Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Expand file tree Collapse file tree 2 files changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ extra-source-files:
43
43
examples/RedBook8/Chapter01/triangles.frag
44
44
examples/RedBook8/Chapter01/triangles.vert
45
45
46
- flag freeglut
47
- description :
48
- When compiling under Windows, use the freeglut library .
49
- default : False
50
- manual : True
51
-
52
46
flag UseNativeWindowsLibraries
53
47
description :
54
48
When compiling under Windows, use the native libraries instead of e.g. the
@@ -100,17 +94,12 @@ library
100
94
ghc-options : -Wall
101
95
if impl(ghc > 8 )
102
96
ghc-options : -Wcompat
103
- if os(windows) && ( flag(freeglut) || flag( UseNativeWindowsLibraries) )
97
+ if os(windows) && flag(UseNativeWindowsLibraries)
104
98
if arch(i386)
105
99
cpp-options : "-DCALLCONV=stdcall"
106
100
else
107
101
cpp-options : "-DCALLCONV=ccall"
108
102
cc-options : "-DUSE_GETPROCADDRESS"
109
- if flag(freeglut)
110
- cc-options : "-DUSE_FREEGLUT"
111
- extra-libraries : freeglut
112
- else
113
- extra-libraries : glut32
114
103
else
115
104
cpp-options : "-DCALLCONV=ccall"
116
105
cc-options : "-DUSE_DLSYM"
Original file line number Diff line number Diff line change @@ -85,16 +85,17 @@ hs_GLUT_getProcAddress(const char *name)
85
85
86
86
if (firstTime ) {
87
87
firstTime = 0 ;
88
- #if defined(USE_FREEGLUT )
89
- handle = LoadLibrary (TEXT ("freeglut" ));
88
+ handle = LoadLibrary (TEXT ("glut32" ));
89
+
90
+ // If glut32 isn't present, try freeglut instead
91
+ if (!handle ) {
92
+ handle = LoadLibrary (TEXT ("freeglut" ));
93
+ }
90
94
91
95
// The MinGW-w64 version of freeglut prefixes "lib" onto the DLL name
92
96
if (!handle ) {
93
97
handle = LoadLibrary (TEXT ("libfreeglut" ));
94
98
}
95
- #else
96
- handle = LoadLibrary (TEXT ("glut32" ));
97
- #endif
98
99
}
99
100
100
101
return handle ? GetProcAddress (handle , name ) : NULL ;
You can’t perform that action at this time.
0 commit comments