Compilation produces two binary files, tom and libtom.so. Tom is equivalent to wish with OpenGL procs auto-linked, but you can do the same thing with the libtom.so shared library :

OpenGL procs and variables are defined in the ::GL namespace. As you can see when comparing simple.tcl and more_simple.tcl files, it can be boring to type ::GL:: before every call to OpenGL procs. The first thing to do to avoid that is to import ::GL namespace :

When starting, there's no current context, and a call to an OpenGL proc will produce an error :

By default, OpenGL widget creation initializes the current context to this widget :

It is possible to control context initialisation with -current option :

There are other options when creating a new widget : -width (0), -height (0), -doublebuffer (0), -alpha (0), -direct (1), -depth (0) and -share (NULL).

When there is a current context, OpenGL procs are accessible and apply to it. To clear .gl1 with black and .gl2 with white :

Then, display result on screen :