Gl2ps-Autotools-Fortran

shortly gl2ps-af, is an enhancement to Gl2ps, a library for generating PostScript and other vector graphic formats from OpenGL, which adds GNU automake/autoconf/libtool support and limited Fortran 90/95 bindings.

Gl2ps-af is based on Gl2ps version 1.3.2, the latest at the time of writing.


Download

The gl2ps-af package version 1.3.2 can be downloaded directly from this page.


Build - Autotools support

Gl2ps-af includes GNU automake/autoconf/libtool support, so that it can be built with the usual procedure
./configure
make
make install
or any reasonable variant of it. Try configure --help for more options to the configure script; in order to enable the build of Fortran 90/95 bindings, start configure with the --enable-fortran option. The package also contains a spec file so that you can quickly build a rpm package, on a GNU/Linux system supporting rpm, just issuing the command rpmbuild -ba <package-name>.tar.gz.

Gl2ps-af has been tested on Fedora 8 and Debian lenny i386/x86_64 Linux systems. It has been successfully tested with gfortran and pgf90 Fortran compilers.


Use - Fortran bindings

The Fortran bindings are limited to the gl2psBeginPage and gl2psEndPage functions, with limited capabilities for the former. Of course the Fortran bindings are useful mainly if you have the full f90gl Fortran bindings to OpenGL installed, but, up to now, they can be built independently of f90gl.

Here only the difference with respect to the C version are described, so you should refer to Gl2ps manual gl2ps.pdf for a complete description. The interface for the Fortran language is:

FUNCTION gl2psbeginpage(title, form, sort, buffersize, filename)
CHARACTER(LEN=*), INTENT(in) :: title, filename
INTEGER, INTENT(in) :: form, sort, buffersize
INTEGER :: gl2psbeginpage
FUNCTION gl2psendpage()
INTEGER :: gl2psendpage
Predefined constants for the values of format, sort and ierr are defined in the gl2ps Fortran module with the same names as for the C calls.
For simplicity, options and colormode are fixed to: (GL2PS_DRAW_BACKGROUND | GL2PS_USE_CURRENT_VIEWPORT) and (GL_RGBA) respectively.
Unlike to the C version of gl2psBeginPage, the Fortran version also opens the file filename, so that the file object argument has been eliminated.
The return values are the same as for the corresponding C functions.

A typical use is the following:

USE gl2ps

INTEGER :: ierr, bufsize

!...

bufsize = 1000000
ierr = GL2PS_OVERFLOW
DO WHILE(ierr == GL2PS_OVERFLOW) ! Loop until bufsize is enough
  bufsize=bufsize*2
  ierr = gl2psbeginpage('geomap', GL2PS_PS, GL2PS_BSP_SORT, bufsize, &
   'geomap.ps')
  CALL display ! Call the desired display function here
  ierr = gl2psendpage()
ENDDO

!...

Support

If you have questions, doubts or requests for improvement concerning the Gl2ps autotools support and Fortran bindings, please address them to Davide Cesari (dcesari <at> arpa <dot> emr <dot> it). Other enquiries concerning the Gl2ps library should be addressed to the maintainer of the library, Christophe Geuzaine, as indicated in the Gl2ps web page. See also f90gl web page for complete f90 bindings to OpenGL.

License

The license terms are the same as for the original Gl2ps package

Gl2ps-af
GNU Autotools support and Fortran 90/95 bindings for Gl2ps
Copyright (C) 1999-2006 Christophe Geuzaine, geuz <at> geuz.org
Copyright (C) 2008 Davide Cesari, dcesari <at> arpa.emr.it
The sources are distributed according to the GNU LGPL license.
See COPYING.GL2PS file for the full license terms.


Last Update 03/12/2008
Back to main page.