Well, I have started going through the "glut.h" header files.  Here is what I have so far.

(1) GLUT defines "GLUT_NORMAL" and "GLUT_OVERLAY" in two places.  Since they are defined to the same thing it doesn't make a difference.

(2) GLUT starts its "extern "C" {" block after all of its include files.  Freeglut does it earlier.  I don't think this will make a difference but I am noting it.

(3) GLUT under Windows has two pragmas that suppress a flood of meaningless compiler warnings about constants being changed from "double" to "float".  I suggest that we put these pragmas into freeglut's version.

(4) GLUT defines a minor version variable "GLUT_XLIB_IMPLEMENTATION" with a value of 13.  Freeglut does not have such a variable.  Also freeglut sets "GLUT_API_VERSION" to 4 while GLUT sets it to 3.

(5) GLUT prefaces each of its function prototypes with an "extern".  Freeglut prefaces them with a defined constant "FGAPI" which is blank or Unix/Linux, blank for Windows static library, and "__declspec(dllimport)" or "__declspec(dllexport)" for Windows DLL's (depending on whether you are using the header file to build the application or to build the DLL).  I think we should set "FGAPI" to be "extern" for Linux/Unix and for Windows static library.

(6) The GLUT "glutInitDisplayMode" function takes an unsigned integer argument; the freeglut function takes a signed integer.  Obviously we should change.

(7) The GLUT "glutInitDisplayString", "glutSetWindowTitle", and "glutSetIconTitle" functions take a constant character pointer; the freeglut functions skip the constant.  Obviously we should add it.

(8) Under Windows the GLUT header file defines "wchar_t" to be unsigned short and defines a constant "_WCHAR_T_DEFINED".  It doesn't use it anywhere else in the header file.

(9) The GLUT header file undefines its "APIENTRY" and "WINGDIAPI" constants at its end.  (Interestingly, "WINGDIAPI" is never actually used.  Freeglut does not undefine the corresponding "FGAPI" and "FGAPIENTRY" constants.  The GLUT constants are actually Windows constants so if GLUT didn't undefine them there could be a collision.

(10) GLUT defines a "CALLBACK" constant (which it never uses) and freeglut does not.  It does not undefine it.

(11) Under Windows, freeglut includes "windows.h" while GLUT specifically avoids doing this.  Freeglut also includes "windowsx.h" and "mmsystem.h" while GLUT does not.

(12) The GLUT and freeglut "comment ( lib" pragmas give different library names for the GLUT/freeglut libraries.  This is to be expected.

I think that's pretty much the lot of them.  Some are obvious that we should change "freeglut.h"; others I'm not so sure about.  What do other people think?

John F. Fay
john.fay@eglin.af.mil