Help end child hunger
May 162011
 

Very Simple Font Library – Text rendering is very useful to display information on top of a 3D world. VSFL aims at providing users with the ability to render bitmapped text in an OpenGL application using the core profile.

With immediate mode gone in core OpenGL versions, so are the vast majority of font libs that worked with OpenGL. Immediate mode was terribly slow, and code wise very extensive. Vertex Buffers are clearly the way to go. This lib uses VAOs and vertex buffers to render text.

May 112011
 

One of the features that was not selected to be part of the core functionality was matrix handling. Previously we had OpenGL and GLU functions that provided the means for easily setting the camera, defining projections, and performing geometric transformations on graphical objects.

The Very Simple Matrix Library (VSML) aims at providing users with a functionality similar to the one available up to OpenGL 3.2. I’ve been using OpenGL for a long time and those matrix handling functions served most of my purposes when programming graphics, hence I grew fond of them. I missed them in the new OpenGL versions so I decided to write a simple lib to perform the same tasks in a very similar way.

Apr 202011
 

ShaderGen is an old tool from 3D labs, but its usefulness is not gone. The tool creates shaders that mimic the results of a set of fixed function state. There is a large set of options to define a state as available in OpenGL compatibility mode. Lighting, Fog, and all the other features that are gone in core profiles. Select the options you desire, check the result with fixed functionality, and then press “generate”. The tool creates the shaders that emulate those fixed function features. It only produces GLSL 1.2 code, but conversion shouldn’t be an issue.

Apr 152011
 

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.

Apr 142011
 

When we call a function from the OpenGL API we may be calling it incorrectly, and this is what glGetError is good for. “Incorrectly” can mean several things, for instance, the parameters are not in a valid range, or a function is being called without a proper context.

Every time an error is detected a flag is set and a numeric code is recorded. Any errors afterwards won’t be recorded so we need to make sure we check for errors at the most significant points in your application.

This page describes in detail the behaviour of glGetError.

 

Apr 112011
 

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.