This is a simple binary that reads a stream of OpenGL commands as text, renders them to an X11 window, and then writes any user input from the window to standard out. It enables any language capable of reading and writing text to then be able to build interactive graphical applications.
This is an old project I wrote in college. It was my 6th entry in a series of "Abuse of Technology" projects where I would do something absurd that was also sort of cool or intriguing or surprising that it could even work. In this case, I was writing animated OpenGL demos in Bash, though it can be used in conjunction with any language.
The source code is hosted on GitHub. While I'm not planning to actively maintain the code, I'm perfectly willing to review and accept pull requests for new features or which make it compatible with more systems.
First, you will need a system that has SDL, OpenGL, Glut, and FTGL. If you're compiling from source, you'll also need the headers for all of those, and likely autoconf and Perl. The relevant libraries for Debian-based systems are:
sudo apt-get install \ libsdl1.2-dev libsdl-image1.2-dev \ libgl1-mesa-dev libftgl-dev
sudo yum install \ SDL-devel SDL_image-devel mesa-libGL-devel \ mesa-libGLU-devel ftgl-devel
You can build it like normal:
$ ./configure $ make $ make install
You can stream to CmdlineGL directly:
$ echo "glClearColor 0 1 0 > glClear GL_COLOR_BUFFER_BIT > cglSwapBuffers > " | CmdlineGL >/dev/null
Or you can import every CmdlineGL command into your shell!
$ source CmdlineGL.lib $ glClearColor '#00FF00' $ glClear GL_COLOR_BUFFER_BIT $ cglSwapBuffers