Fortunately, the OpenGL function parameters are all simple types (boolean, integer, floating point, constants, arrays) so the API translates easily from C to other languages.
The OpenGL Architecture Review Board (ARB) controls the C, C++, Fortran, Pascal and Ada binding specifications at this time.
The OpenGL constants are not supposed to be prefixed with F
(i.e. GL_POLYGON, not FGL_POLYGON) but SGI's IRIX 5.3 Fortran
header file for OpenGL does use the F prefix.
The GLUT toolkit includes an fgl.h header file with correctly
named constants.
Finally, the maximum length of identifiers varies among Fortran
compilers.
Since OpenGL has several long (+32 character) identifiers they
may be truncated in the header file.
Bill Mitchell of the NIST has written
fortran 77 and fortran 90
bindings for OpenGL and Mesa. (http://math.nist.gov/f90gl/)
In the mean time, there are several possible solutions to using
OpenGL with Java:
In some cases, such as Tcl/Tk, a special interface layer written in C may
encapsulate the details of the OpenGL window system interface. Another
example is GLUT. GLUT hides the details of OpenGL window system integration,
providing a simple, window system-independent interface with C, Fortran and
Ada bindings.
2. Bindings
pack [OGLwin .gl]
.gl main -clear colorbuffer \
-begin triangle \
-vertex 0 1 0 \
-vertex -1 -1 0 \
-vertex 1 -1 0 \
-end
3. Notes
While OpenGL's API is easily adapted to many languages the same can't be
said of most window system interfaces. For example, a Fortran-based OpenGL
application may still need some C code to interface OpenGL with Xlib since
there's no Fortran interface to Xlib.
Last edited on July 17, 1997 by Brian Paul.