Hello,

Experimenting at a REPL is a great way to learn a new library. Doing
this with OpenGL can be tricky, but there are ways.

But what about other techniques for interactive library experimentation? Here's a kludgy but fun little hack:

    http://proteus.freeshell.org/_gl-console-a.scm

You invoke it like this:

    ikarus /scratch/gl-console.scm -- /tmp/xyz.scm

The OpenGL "console" will open up.

It's fine for the input file to start out empty. The program will monitor the file for changes. When you save the file, the console will be updated.

This way, trying out OpenGL commands is easy and commiting tweaks
is as simple as saving the file. A tool like this is handy for gentle
introductions to OpenGL.

Your file can be as simple as:

    (gl-begin GL_LINES
              (glVertex2d 10.0 10.0)
              (glVertex2d 90.0 90.0))

and you'll get something on the screen.

Perhaps I should call it a SEPL: save eval print loop. ;-)

Basic exception handling is in place; for conditions while reading the file and also while executing the contents.

Ed

Reply via email to