using freeglut instead of GLUT
Asked Answered
R

1

8

I am learning OpenGL with the help of tutorials found online. Many of them use GLUT library, even though it is generally recommended to use freeglut instead. How will replacing GLUT header file with freeglut header affect the compilation ? Is such a simple replacement possible ? Are there many differences in terms of syntax, function names and usage ?

Remonstrance answered 18/4, 2014 at 22:14 Comment(1)
No, replacing the header will do next to nothing. FreeGLUT is an implementation of GLUT, with a few things added over the years. The core of the API is the same between both, and to use FreeGLUT what you really need is a different library.Lapham
B
7

As mentioned by Andon, replacing the header will do next to nothing. The FreeGLUT about page has a good description of the what and why (http://freeglut.sourceforge.net/index.php).

Why not to use GLUT, from the above link:

The original GLUT library seems to have been abandoned with the most recent version (3.7) dating back to August 1998. Its license does not allow anyone to distribute modified library code. This would be OK, if not for the fact that GLUT is getting old and really needs improvement. Also, GLUT's license is incompatible with some software distributions (e.g., XFree86).

As for the syntax and function names, if your code currently compiles fine with GLUT, it should compile fine with FreeGLUT. You may need to tell the compiler to use/link against FreeGLUT instead of GLUT (and where to find it).

A quick Google search produced this result (using FreeGLUT), might be useful... http://peon-developments.blogspot.com.au/2011/04/creating-opengl-window-with-freeglut-in.html

Baziotes answered 21/4, 2014 at 12:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.