GLSL Wrapper Library

Overview

The following classes were developed for use in Andy Johnson's Special Topics course GPU programming by Don Olmstead. The objective in these classes is to provide an easy way object oriented way for students to get GLSL programs up and running quickly. All the steps to setup OpenGL to use GLSL are abstracted away so focus can be put on writing the vertex and fragment programs.

All the source code for this library is available under the GNU Lesser General Public License. All other libraries required to use this library are available under their respective licenses.

Installation

The library comes with both a Visual Studio .NET 2003 workspace as well as a makefile for Linux. If you are running Mac OS X for the time being you're on your own, but if someone does get this running on Mac OS X please contact me so I can update the source code with a way to build on a Mac. The library requires additional libraries to get everything up and running.

You can replace DevIL with another image library or roll your own if you desire. It was included since GLSL can access and manipulate textures, and DevIL provides a painless way to load images into OpenGL. To remove it just remove any mention of DevIL (the header files and functions begin with il, ilu, or ilut) and remove the link to the library.

Installing On Windows

Download each of the dependency libraries. Either compile the individual libraries, using their respective instructions, or get the Windows binary. Each library should have instructions on installing the library for Windows. The general rules though for where the files go are as follows.

After all the libraries are installed open up the included Visual Studio Workspace. Compile the Solution, and verify that the OpenGL

Installing on Linux

Download each of the dependency libraries. Either compile the individual libraries, using their respective instructions, or get the binary for your distribution. Each library should have instructions on installing the library for linux. If you have permission to write to /usr/local the libraries should be able to put themselves in there for use. If that is not the case then just create a directory in your home directory mirroring the structure of usr/local and install the libraries manually. If you are having problems finding the .so files look for a hidden directory containing the library files, and copy the contents of the directory.

Next depending on where you put the libraries you may need to modify the makefiles. Within the Application/makelib.lnx file modify the INCPATH to include where you placed the header files for the libraries. Within the Examples/makeapp.lnx modify the LIBPATH to include where you placed the shared object files for the libraries. In the root of the GLSL directory type make and the library and examples will be made. If for whatever reason there are problems including the headers for the libraries you can go ahead and put it in the GLSL/Library directory.

Installing on Mac OS X

At this time no xcode files are available in the download. If anyone creates an xcode project for use with Mac OS X please contact me to get it included in the source files.

Using

The goal of the library was to make it as simple as possible to create a working application with GLSL. The sample application provided in the download is the quickest way to get up and running with the library. An excessive amount of comments were added to aid development. The following are the general steps to get an application, and further on are compiler specific elements.

Using with Visual Studio .NET 2003

Start off by creating a new project within the Solution for the GLSL Library. Make sure that you point the Location of the project to be within the Examples directory within the directory you put the GLSL library. Click the Solution on the right side of the window, right click it and select Properties. Within the properties select Project Dependencies and select the newly created project. Check that the project depends on Application and click OK. Now close Visual Studio.

Rather than going through the properties of the project and setting them all manually, the project file from the sample application can be used. The project files are nothing more than XML files so open up the sample application's project file and the newly created application's project file in a text editor. Copy the area within the Configurations tag from the sample project and replace the Configuration tag from the new project with the samples. Save the project file and reload the solution in Visual Studio.

Using with GCC

Open the makefile.lnx file in the root of the Examples directory. Create a corresponding entry for your application in the build and clean portions of the makefile. The value for APP is the directory where your application is housed. Now run make from the root of the library directory and assuming no compiler errors your application will be built.

Common Gotchas using GLSL

Make sure you haven't fallen prey to one of these gotchas before sending any questions regarding this library

Thank You's

Thank you Andy Johnson for creating this class and using this framework for it. Also thank you Bob Kooima for answering my various OpenGL questions. And finally the author of 3D Game Engine Architecture : Engineering Real-Time Applications with Wild Magic, David H. Eberly for giving me the idea to abstract away the application to make it easy to create new ones.