Lahey/GNU Fortran

OpenGL Graphics Libraries

OpenGL is a software interface for applications to generate interactive 2D and 3D computer graphics independent of operating system and hardware operations. It is essentially a 2D/3D graphics library which was originally developed by Silicon Graphics with the goal of creating an efficient, platform-independent interface for graphical applications (Note: OpenGL is a trademark of Silicon Graphics Inc.). It is available on many Windows and Unix systems, and is strong on 3D visualization and animation.

f90gl is a public domain implementation of the official Fortran 90 bindings for OpenGL, consisting of a set of libraries and modules that define the function interfaces. The f90gl interface was developed by William F. Mitchell of the Mathematical and Computational Sciences Division, National Institute of Standards and Technology, Gaithersburg, in the USA. For information on f90gl, see the f90gl web page The Lahey LGF f90gl interface has the same non copyrighted status as the NIST original.

A full set of examples is available under the f90gl subfolder of the Examples installed with this product.


To use f90gl/OpenGL you will need the following OpenGL DLL's in your Windows System32 or SysWOW64 folder. These are installed with Windows. Many video card manufacturers now also provide accelerated OpenGL support as part of their video drivers. These drivers may replace the functionality of these two DLL's.

One of the following DLLs will also be needed to run your f90gl application, and are installed with the examples. It will need to reside in the same folder as the application. You may redistribute these DLLs with your application.

Building OpenGL programs

Building f90gl programs requires that the path to the f90gl modules and libraries are specified. Specify -win to create a Windows program. A build.bat file is provided to build the examples.


For 32-bit applications:

LGF blender.f90 -win -i <install-dir>\LGF\f90gl\lib32 -libpath <install-dir>\LGF\f90gl\lib32 -lib f90gl -lib f90glu -lib f90glut -lib glut32 -lib glu32 -lib opengl32

For 64-bit applications:

LGF blender.f90 -win -i <install-dir>\LGF\f90gl\lib -libpath <install-dir>\LGF\f90gl\lib -lib f90gl -lib f90glu -lib f90glut -lib glut32 -lib glu32 -lib opengl3