GLUT - what's special?

I haven’t used GLUT before. I would like to know whats so special about it. I kind of see that it makes things easier but it is slower than raw opengl? or is it really the same and much more productive to use?


GLUT is special because it’s easy and fast to create simple applications. About speed, it’s all about how you code.

Well GLUT is not so much an ecapsulation of OpenGL as it is of the calls to initializing things in the OS. Like if you used GLUT in a windows environment it creates a window and everythign is set up. Here comes the cool part: If you used the exact same code and compiled in another OS, GLUT would open a windows specific to that OS. It basically wraps the annoying initialization code for OpenGL (setting up pixel format, setting up the rendering context, the OS specific procedures to create windows with openGL support, etc.).

However, i’m not saying it doesn’t support ANY OpenGL at all. It does let you do a few things like create a sphere, or a torrus, or a few other shapes. But you could do that using quadrics and the glaux library. I personally don’t use GLUT because i like to make my own windows and my programs stay on Windows. But it is definetely worth checking out!

  • Halcyon

glut is used in the red book and is also cross-platform. Many folks learn OpenGL using the red book.

thanks guys… but what about speed though?

I mean is it any sower or the same?

P.S. cross platform sounds really cool!

As I said in my post above, it’s all about how you code. You can make both slow and fast programs in GLUT, but it’s you that makes them fast or slow, not GLUT.

ok cool… thanks

I just had another question… if you use glut for example for the window creation…can youy still pass to it normal or raw open gl commands? such as glvertex(); etc


Yep, well thats the whole point really to create a window for using ‘raw’ opengl in.

thanks a lot guys.

I appreciate the help =)


I have found that my code running with glut is about 1/2 the speed versus when I set up the win32 window myself. For when you are just starting out GLUT is defeinitly the way to go, its easy to set up a program, it cuts your code size down by about 500 lines of code. Or if you want to write something that is cross platform, although if you want to run your program on a unix machine you will likely have to change it around abit, but nothing like if you used win32 api. For this reason glut is vary popular for writting how to demos