Skip to content

Commit eff1e94

Browse files
bfree-githubwchristian
authored andcommitted
improve (free)glut version identification
1 parent 63907f8 commit eff1e94

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

Makefile.PL

+8-4
Original file line numberDiff line numberDiff line change
@@ -902,19 +902,23 @@ sub get_extensions
902902
print GLEXC "// OpenGL v".$gldata->{VERSION}.", using ";
903903

904904
# Fix GLUT flags based on results
905-
if ($gldata->{GLUT} > 0)
905+
if ($gldata->{FREEGLUT})
906906
{
907-
print 'Found FreeGLUT v'.$gldata->{GLUT}."\n";
908-
print GLEXC 'FreeGLUT v'.$gldata->{GLUT}."\n";
907+
print 'Found FreeGLUT v'.$gldata->{FREEGLUT}."\n";
908+
print GLEXC 'FreeGLUT v'.$gldata->{FREEGLUT}."\n";
909909

910910
if (!$found->{FREEGLUT} && !$found->{FREEGLUT32})
911911
{
912912
$found->{FREEGLUT} = $lib;
913913
}
914914
}
915+
elsif ($gldata->{GLUT})
916+
{
917+
print "Found GLUT - Version: $gldata->{GLUT}\n";
918+
}
915919
else
916920
{
917-
print "Found GLUT - unknown version\n";
921+
print "Found no GLUT\n"
918922
}
919923

920924
my $GL_VERSION;

Release_Notes

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Highlights:
3030

3131
* Improved FREEGLUT searching/linking for Linux and Mac OS X.
3232

33+
* Fixed/improved GLUT version reporting in util/glversion.c.
34+
3335
* Enhanced test.pl for OpenGL::Shader and VBOs
3436

3537
* suppress osx 10.9 deprecation warnings

utils/glversion.c

+8-4
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,26 @@ int main(int argc, char **argv)
3131
char *renderer = NULL;
3232
char *extensions = NULL;
3333
GLuint idWindow = 0;
34-
int glutVersion;
34+
int freeglutVersion;
3535

3636
glutInit(&argc, argv);
3737
glutInitWindowSize(1,1);
3838
glutInitDisplayMode(GLUT_RGBA);
3939
idWindow = glutCreateWindow(PROGRAM);
4040
glutHideWindow();
4141

42-
glutVersion = glutGet(0x01FC);
4342
version = (char*)glGetString(GL_VERSION);
4443
vendor = (char*)glGetString(GL_VENDOR);
4544
renderer = (char*)glGetString(GL_RENDERER);
4645
extensions = (char*)glGetString(GL_EXTENSIONS);
4746

48-
printf("GLUT=%d\nVERSION=%s\nVENDOR=%s\nRENDERER=%s\nEXTENSIONS=%s\n",
49-
glutVersion,version,vendor,renderer,extensions);
47+
freeglutVersion = glutGet(0x01FC);
48+
if(freeglutVersion != -1) {
49+
printf("FREEGLUT=%d\n", freeglutVersion);
50+
}
51+
printf("GLUT=%d\n", GLUT_API_VERSION);
52+
53+
printf("VERSION=%s\nVENDOR=%s\nRENDERER=%s\nEXTENSIONS=%s\n", version, vendor, renderer, extensions);
5054

5155
glutDestroyWindow(idWindow);
5256
return(0);

0 commit comments

Comments
 (0)