SDL_glel : OpenGL extension library for SDL
Introduction
SDL_glel is an OpenGL extension library for SDL. Its purpose is to ease the
life of developers like me when it comes to dealing with OpenGL extensions.
The first issue when using OpenGL extensions is detecting them and then
getting the corresponding function pointers. And even sometimes, the extension
seems available, but obtaining the function pointers fails. This library tries
to abstract such issues. For example, it will report a missing extension if
getting one of the function pointers for this extension fails.
Another issue is keeping up-to-date with new OpenGL extensions as they come.
In this purpose, SDL_glel automatically generates the library files from the
OpenGL extension repository (http://oss.sgi.com/projects/ogl-sample/registry/).
This process uses a 2-pass lex/yacc parser, some C code, some
scripts and needs wget installed.
What is more, using an automated parser to generate code also minimizes the
chances of making mistakes in the library code.
Download
SDL_glel library [BSD license]
If you don't plan to rebuild SDL_glel yourself, you can download the SDL_glel library directly (this is the recommended download, since due to the moving nature of the extension repository, I can't assure you that the SDL_glel parser will work all the time). Two flavours of the SDL_glel library are available : one is pure C, and the other is C++ :
Download the SDL_glel library, C version
Download the SDL_glel library, C++ version
SDL_glel parser [GPL license]
If you want to rebuild the SDL_glel library, you can download the SDL_glel parser as a tarball :
Download the SDL_glel parser
You can also get the CVS version of the SDL_glel parser :
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/sdl-glel login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/sdl-glel co SDL_glel
When prompted for a password for anonymous, simply press the Enter key.
Create your own SDL_glel library
Unpacking
tar xzvf SDL_glel-[version].tgz
Directory structure
If you just unpacked this package, you'll find the following directory structure :
- extensions/ this directory is intended to contain the downloaded specification files for the OpenGL extensions. It has two subdirectories :
- static/ that contains the extension specifications that are not available online, and
- dynamic/ that contains the extension specifications downloaded from the web.
- pass1/ contains the source for the parsers's first pass. Its job is to trim all unimportant information from the specification files. Its output is normally piped to the pass2 parser.
- pass2/ contains the source for the parser's second pass. This one is in charge for generating the SDL_glel library source code.
- scripts/ contains some scripts used for the build process
- skel/ contains the skeleton files for the backends
How it works
Quickly put, here is how SDL_glel works :
OpenGL extension repository on the web
local OpenGL extension repository
SDL_glel library
The OpenGL extensions are downloaded from the web, and are then processed using the SDL_glel parser to produce the SDL_glel library.
Compile the SDL_glel parser
As usual :
./configure
make
If you are using a CVS version, you'll need autotools installed and will have to perform an additional step :
./autogen.sh
./configure
make
Download the extensions from the web
Use this command to download the OpenGL extensions to a local repository :
./scripts/download-extensions
Please don't abuse that script, since it downloads 5MB of data from SGI each time.
At this point, you can add your own suplemental extension files in the extensions/dynamic directory if you feel the need to.
Execute the SDL_glel parser to produce the SDL_glel library
Depending on which version of the library you want (C or C++) you can use the following commands to build the library :
./scripts/process --output-c
or
./scripts/process --output-cpp
That process will produce two files named SDL_glel.* . Those files are the SDL_glel library.
How to use the SDL_glel library
Links
The SDL_glel project sourceforge page
The OpenGL extension repository @ sgi.com
Contact
You can contact me at the following address :