Help end child hunger

Both FreeGLUT and GLUT allow us to define an OpenGL context with multisampling. However the number of samples is fixed (4) and I’ve not found a way to change it using the API.

In here we’re going to see how to hack FreeGLUT so that we can change the default number of samples. This can be achieved either by changing the default value, or by adding a new function to set this value.

Note: This hack should be used only for testing purposes, not for redistribution, as FreeGLUT has a large base of users which already have the official version installed.

Continue reading »

A page has been added to the GLUT Tutorial with all the source code and Visual Studio 2010 projects available to download. Check it out here.

The code for several demos in the GLUT tutorial was plagued with a int to void * conversion. While this seems to work perfectly in Windows, at least in this case, Linux users found out that it did not even compile.

The code has been updated and hopefully the problem is gone. Please do report any problems you find. I’m sure there must be some bugs still on the loose…

This is an OpenGL 3.3 + GLSL 3.3 sample that loads and displays a 3D model with Assimp. It also uses DevIL in case the model has textures. It was based on Assimps OpenGL demo and it extends it to support OpenGL 3.3

The sample uses Texturing, Vertex Array Objects, and Uniform Blocks. Camera can move around the object using the mouse, and the mousewheel can be used to zoom on the model, courtesy of freeglut.

GLUT was conceived by Mark Kilgard with the goal of providing a simple, yet powerful enough, toolkit to deal with the intricacies of the windowing system when building OpenGL applications. In my opinion GLUT was a very effective solution and completely fits the bill. As far as I know, GLUT is still the simplest toolkit around and yet it does most of what is needed for simple prototypes.

GLUT however is not free of criticism. Complaints about the lack of control on the event loop are abundant on the web and some extra functionality, context creation and multisampling, would be most welcome.

GLUT is not open source hence it could not be modified, so GLUT clones have appeared. These kept the API (all gluts functions are usually implemented exactly with the same name) but improved and extended it to address the above mentioned issues.

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.

There is a new section on the GLUT tutorial. It introduces the glutPostRedisplay function.

This function replaces the idle function, and allows us to save CPU when the application is idle. Full source code is provided as usual.

The GLUT tutorial now resides in the new version of Lighthouse3D. The tutorial has been fully revised, adding different, and more logical, examples. As always, bugs will be present and I count on you to help me to get rid of them.

© 2014 Lighthouse3d.com Suffusion theme by Sayontan Sinha