Skip to content

Commit f28dd1b

Browse files
committed
Search for freeglut/libfreeglut/glut32 on Windows. Bumped version to 2.7.0.9.
1 parent 7f774f1 commit f28dd1b

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2.7.0.9
2+
--------
3+
* Windows: The GLUT package compiles without any additional GLUT library now.
4+
* Windows: We search for a native freeglut DLL, a MinGW freeglut DLL and a classic GLUT DLL, in that order.
5+
16
2.7.0.8
27
--------
38
* Relaxed upper version bound for `OpenGLRaw`.

GLUT.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: GLUT
2-
version: 2.7.0.8
2+
version: 2.7.0.9
33
synopsis: A binding for the OpenGL Utility Toolkit
44
description:
55
A Haskell binding for the OpenGL Utility Toolkit, a window system independent

cbits/HsGLUT.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* -----------------------------------------------------------------------------
22
*
33
* Module : C support for Graphics.UI.GLUT.Raw
4-
* Copyright : (c) Sven Panne 2002-2013
4+
* Copyright : (c) Sven Panne 2002-2016
55
* License : BSD3
66
*
77
* Maintainer : Sven Panne <[email protected]>
@@ -85,16 +85,19 @@ hs_GLUT_getProcAddress(const char *name)
8585

8686
if (firstTime) {
8787
firstTime = 0;
88-
handle = LoadLibrary(TEXT("glut32"));
8988

90-
// If glut32 isn't present, try freeglut instead
89+
/* Try to load freeglut first, it has a few extra features compared to
90+
classic GLUT. */
91+
handle = LoadLibrary(TEXT("freeglut"));
92+
93+
/* The MinGW-w64 version of freeglut prefixes "lib" onto the DLL name. */
9194
if (!handle) {
92-
handle = LoadLibrary(TEXT("freeglut"));
95+
handle = LoadLibrary(TEXT("libfreeglut"));
9396
}
9497

95-
// The MinGW-w64 version of freeglut prefixes "lib" onto the DLL name
98+
/* If no freeglut version is found, try plain old glut32 instead. */
9699
if (!handle) {
97-
handle = LoadLibrary(TEXT("libfreeglut"));
100+
handle = LoadLibrary(TEXT("glut32"));
98101
}
99102
}
100103

0 commit comments

Comments
 (0)