tclgl2ps is a package that produces hard-copy (postscript, pdf, latex)
from opengl. It is intended to be used in conjunction with Paul
Obermeier's tcl3d (formerly tclogl), see http://www.tcl3d.org/index.html. 

This package is a tcl extension based on Christophe Geuzaine's gl2ps
package, http://geuz.org/gl2ps/. This has been wrapped with SWIG to 
produce loadable binary extensions. The present archive contains 
extensions for 32-bit windows, and 32- and 64-bit linux.

Since this is a re-packaging of Christophe's work, his original license
restrictions apply. These are explained briefly in README.cg, and the
complete information is in COPYING.GL2PS and COPYING.LGPL.

The contents of the archive are as follows:

linux32     Binary extension for 32-bit linux

linux64     Binary extension for 64-bit linux

win32       Binary extension for 32-bit windows

source.cg   Christophe Geuzaine's original source.

source.idg  My modified source, comprising a slightly modified gl2ps.c,
            which fixes a bug in pdf production under 64-bit compilers,
            and also the SWIG input file used for wrapping.

README.cg   Extract from Christophe Geuzaine's pdf documentation. This
            and the two files COPYING.GL2PS and COPYING.LGPL explain the
            license conditions.

gl2ps.pdf   Christophe Geuzaine's pdf documentation for the gl2ps
            package.
            
            

USAGE

   You require the tcl3d package, as well as the present one. Copy the 
appropriate gl2ps binary extension, together with its pkgIndex.tcl file 
to a suitable sub-directory in your tcl library directory. You must also
have the opengl shared libraries on your system.

   A typical usage will look something like this ... (Note that gl2ps
requires an open C file handle as an argument to the principal
routine, gl2psBeginPage. To accomodate this, I have wrapped the C
fopen() and fclose() functions as part of the package.)
   
   
   package require tcl3d
   package require gl2ps

   togl .t   ........
# establish drawing window. See tcl3d documentation



   ..... opengl/tcl3d drawing routines ......
   
   
   
proc pdf {filename} {

   set fp [fopen $filename wb]
# must open in binary mode for pdf output

   set opt [expr {$::GL2PS_OCCLUSION_CULL | $::GL2PS_USE_CURRENT_VIEWPORT}]
   gl2psBeginPage "Test" "id" NULL $::GL2PS_PDF $::GL2PS_SIMPLE_SORT\
               $opt $::GL_RGBA 0 NULL 0 0 0 500000 $fp "AppleBlossom"
# see gl2ps documentation for a more sensible way of setting buffersize

   .t render
# gl2ps works via the opengl feedback buffer, so you have to draw the picture
# once between gl2psBeginPage and gl2psEndPage.

   gl2psEndPage
   fclose $fp
}
