Author: David Robillard Original GLX inspiration, portability fixes: Ben Loftis