Hogl

The Haskell functional programming language has 2D and 3D graphic capabilities using FRAN, Functional Reactive Animation, which are only supported on Windows operating systems. In order to make Haskell platform independent, it would have to support graphics on all platforms. A lot of programming would be required to expand FRAN platform support to include all the UNIX based platforms and Macintosh operating systems. OpenGL is a graphics library for C and other imperative programming languages, that is an industry standard and is supported on most systems.

Hogl is an OpenGL interface for Haskell. The OpenGL code was converted from C to Haskell using GreenCard. The GL.h library is fully implemented in Hogl. All the other OpenGL libraries have as of yet, not been implemented.

Hogl has a layer of abstraction to make OpenGL imperative functions into more Haskell-like functional functions. Hogl’s development was based on the Graphics library that is included in current distributions of the Hugs interpreter.

Currently, Hogl only runs on Windows operating systems. However, it will only take a little bit of code to expand it to support all other systems, because the basic OpenGL rendering calls remain the same between systems. The only difference is the out-most layer of code that handles window process callbacks and the creation and destruction of the window.

Hogl’s user interface is based upon the Graphics library that is included in the Hugs distribution.

Hogl GreenCard

This link leads to the documentation of the files that use GreenCard. They are the files that implement the OpenGL functions.

Hogl Source Code

This link leads to the documentation of the files that implement the Haskell abstraction over the OpenGL functions.

Hogl Tutorial

This link leads to a short tutorial for getting starting in programming in Hogl.

Useful Links

The Hewlett Packard OpenGL 1.1 Reference Page

The Haskell Home Page

The GreenCard Home Page

The Fran Home Page

The Missing Parts

OpenGL is a very complex graphics library. Because it is so complex there are a lot of things that were not implemented in this version of Hogl. Things like alpha blending, clipping, more light sources, cameras, text drawing, texture mapping, bump mapping, antialiasing, etc. etc. And there are probably many improvements that can be made to the existing code to make it run better or be more functional. Hopefully this project will continue. Thank you.