OpenGL and GLUT resources

  • Projects
  • Index
  • OpenGL and GLUT Reference

    Official programming/reference guides online

    These are fairly dated, for OpenGL 1.1 and 1.0 respectivly, but will be good enough for this course.

    NeHe GameDev OpenGL Tutorials

    OpenGL articles and a tutorial with 48 lessons

    OpenGL Examples:

    Other OpenGL examples are found under the following link on the SUN:


    OpenGL Programs from the red book:

    aaindex.c aargb.c accanti.c accpersp.c alpha.c
    alpha3D.c bezcurve.c bezmesh.c bezsurf.c bezsurf.c
    blendeqn.c checker.c clip.c colormat.c colormatrix.c
    colortable.c convolution.c cube.c dof.c double.c
    drawf.c feedback.c fog.c fogindex.c font.c
    hello.c histogram.c image.c jitter.h light.c
    lines.c list.c material.c minmax.c mipmap.c
    model.c movelight.c multitex.c pickdepth.c picksquare.c
    planet.c polyoff.c polys.c quadric.c readImage.c
    robot.c scene.c select.c smooth.c stencil.c
    stroke.c surface.c surfpoints.c teapots.c tess.c
    tesswind.c texbind.c texgen.c texprox.c texsub.c
    texture3d.c texturesurf.c torus.c trim.c unproject.c
    varray.c wrap.c
    OpenGL Links:
    GLUT Links:


    Libraries that must be included, in order to compile OpenGL commands, are:
     (-lglut) -lGLU  -lGL (-lXmu -lXext -lX11) -lm


    gcc -o lab1 lab1.c -lglut -lGLU -lGL -lm
    OpenGL include files:
    #include GL/gl.h   /* OpenGL library */
    			#include GL/glu.h  /* OpenGL utility library */
    			#include GL/glut.h /* OpenGL Utility Toolkit */
    (Includes the gl and glu libs, also)
    Other libraries you might need are: math.h, stdio.h and stdlib.h.

    OpenGL provides no commands for opening windows, activating a mouse or a keyboard, or writing text, because it is independent of any window system or operating system. You can use the glut-library, to write text, activate a mouse, keyboard or opening a window.

    Example program: