Help end child hunger

GLUT Tutorial

GLUT stands for OpenGL Utility Toolkit. Mark J. Kilgard implemented it to enable the construction of OpenGL applications that are truly window system independent. Thanks to GLUT, we can write applications without having to learn about X windows or Microsoft’s own window system. Kilgard implemented the version for X windows, and later Nate Robins ported it to Microsoft Windows. Thanks to both, you did a great job.

With GLUT you can open a window for OpenGL rendering with 5 lines of code! Another 3 or 4 lines and you can a keyboard and mouse with your application. GLUT really makes things simple, hence it is very usefull to learn and to build small applications. Although GLUT is not being maintained anymore it still serves its purpose.

The GLUT distribution comes with lots and lots of examples so after you read through the basics in here you’ll have plenty of material to go on. Check out the GLUTs page.

In this tutorial I’ll introduce you to the basics of building an application using GLUT. This tutorial won’t introduce fancy visual effects in order to keep the code as simple as possible. I’ll use OpenGL 2.0 since it is much simpler and avoids complicating the core subject of the tutorial: GLUT.

There are open source versions of GLUT, such as freeGLUT and OpenGLUT. They all kept the API so 99.9% of what will be presented in this tutorial is still valid. Nonetheless these new versions do have some extensions that make it worth a try. Check out the extensions in freeGLUT  here.

Please do comment if something is not completely clear. Your feedback is important.

Index

Basics

Input

Pop-up Menus

Fonts

Extras

Subwindows

Avoiding the Idle Func

Source Code and Projects

16 Responses to “GLUT Tutorial”

  1. plz give glut plane description of all function

  2. Can you do a tutorial on texturing?

  3. lighthouse3d is terrific. There’s often all the appropriate info at the suggestions of my fingers. Thank you and maintain up the superior work!

  4. Hello there, The second sentence in the second paragraph is not clear. . . “Another 3 or 4 lines and you can a keyboard and mouse with your application.”

  5. I want to create buttons in a OpenGL window, i,e, in a window some buttons will appear like START GAME, SCORE, EXIT etc.
    And whenever we click on that button respective event should be triggered. But the program should be written using GLUT library only..
    please anybody help me…

  6. Hi there, Thank you very much for taking the time to write this. Cheers, it’s big help. thanks again.

  7. YEAH VERY HELPFULL!

  8. Wonderful write-up.

  9. it’s really help

  10. You will get a lot of views if you show how to setup OPENGL/GLUT WITH CODEBLOCKS.
    I am also searching for this. Thanks.

  11. Nice site . :)

  12. Nice tutorial.. Very easy to understand :) hope you can add chapters like converting this to a game XD like shooting the snowmen

  13. Great style. I would love to write that way.

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

© 2014 Lighthouse3d.com Suffusion theme by Sayontan Sinha