Click to See Complete Forum and Search --> : Difference between openGL and GLUT


rbha311
December 30th, 2008, 12:41 AM
Hi,

I was wondering what the difference between openGL and GLUT is, I have got the GLUT libraries installed and I have added the glut.h in the include directory but I was wondering how different is using glut.h from actually using the real openGL. I know that openGL basically contains the rendering commands and glut is needed for it to read events from the keyboard or the mouse etc. But I am not sure whether just using glut itself will give me the total functionality of openGL.

Thanks,

zerver
December 30th, 2008, 09:59 AM
Glut is a software-level toolkit that can make some things simpler.

This means the glu*** functions are not real hardware/driver OpenGL function calls, but when you call them they in turn invoke lots of real GL calls.

So, it is not a replacement for real GL. It is very limited in what it can do.

Although it has some keyboard/mouse helper functions, there are many other ways to handle user input.
For instance, try the SDL library: http://www.libsdl.org/

cj-wijtmans
January 5th, 2009, 05:42 AM
glut is a openGL extension

Lindley
January 5th, 2009, 11:59 AM
^No, OpenGL extensions are something else. GLUT is simply a layer on top of OpenGL. You could replace it with a different windowing system easily if you wanted.

The typical layers are thus:
0) OpenGL + OpenGL extensions - Low-level routines for specifying geometry and texture data, and rendering modes.
1) GLEW / GLee - Libraries making it easier to use OpenGL extensions. They mostly work "behind the scenes" and you don't interact with them directly except by adding a header file.
2) GLU - Some convenience routines for calling OpenGL in more intuitive ways.
3) GLUT / SDL / GLX / WGL / AGL / GTKGLEXT / etc - The IO layer controlling both mouse and keyboard input, and visual output (windows).

OpenGL is slightly counter-intuitive in that it doesn't provide a way to make a context or drawing area directly; it requires one of the layer-3 tools to provide that for it.

rbha311
January 12th, 2009, 09:08 PM
Thanks a lot for the replies guys but there is still one thing that i dont understand. I was trying to integrate my visualC++ with openGL libraries but instead I ended up following the instructions for adding the GLUT libraries but it still lets me do things like draw basic shapes and animate them. All I wanted to know is if installing GLUT libraries is enough to give me all of the openGL functionality since someone told me that openGL comes installed on all windows and all you need is GLUT to initialize openGL or do I have to do something else to install openGL on visual C++ because the instructions for doing so vary greatly from source to source and most of them do not work.

Lindley
January 13th, 2009, 12:39 AM
Windows comes with OpenGL 1.1. That's enough for basic drawing. The limitation is in the form of how many OpenGL extensions you'll be able to use (glGetString(GL_EXTENSIONS), I believe). The best way to get yourself up to OpenGL 2.1 or even the 3.0 beta drivers (unless they're past beta now? not sure) is to go to your graphics card vendor's website (NVIDIA or AMD, usually, unless you've got a lameo Intel Integrated card) and look for an OpenGL SDK there and grab the latest drivers for your card while you're at it.