Personal tools

GLFW

From HaskellWiki

Revision as of 22:00, 20 December 2007 by PaulLiu (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


1 About

This is a Haskell module for GLFW OpenGL framework. It provides an alternative to GLUT for OpenGL based Haskell programs.

2 Status

The library is being used by the Haskell School of Expression (SOE) code to render Graphics in a cross-platform manner. It currently interfaces with GLFW version 2.6, works on Windows, Linux (i386) and Mac OS X (both intel and ppc).

GLFW itself is well documented (see glfw/docs directory), but the Haskell module still isn't. You may see the SOE.hs from the SOE package for sample usage.

Not all functions are fully tested, and there are still a few GLFW C functions missing from the Haskell module, namely the image loading and joystick ones. They'll be added in future releases.

The Haskell module also provides basic text rendering while GLFW doesn't. It comes from a free 8x16 font which is made into a TGA texture, stored as a Haskell string in the file GLFW.hs. Text rendering is only possible with Alpha enabled. Again, see SOE.hs from the SOE package for sample usage.

GLFW doesn't work well with GHC threads, forkIO or threadDelay. So avoid them if you can.