Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Port of Jason L. McKesson's "Learning Modern 3D Graphics Programming" to Haskell using Tobias Bexelius' GPipe framework
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Tut_02_Playing_with_Colors/hs changed all version ranges to exact versions; tested with on…

Haskell/GPipe examples for

Learning Modern 3D Graphics Programming

These are ports of the examples from Jason L. McKesson's wonderful online book Learning Modern 3D Graphics Programming from C++ and GLSL into Haskell. The ports use Tobias Bexelius' OpenGL framework GPipe [1] [2] to express OpenGL buffers, uniforms, vertex shaders, and fragment shaders in normal Haskell code.


It is recommended to use a diff tool to compare each code example with the next. The ports have been written to minimize changes between tutorials, therefore diffing them will highlight many of the essential changes required by each lesson.


The tutorials are set up to build with cabal. A few of the tutorials need to read data files at runtime, which requires that you cabal install install them.

1. Prep your haskell environment

Install the haskell-platform 2013.2.0.0 from

cabal install cabal-install- # because the 1.2x.x.x versions don't work

# set your $PATH to use ~/.cabal/bin or ~/Library/Haskell/bin
# according to where cabal 1.16 installed cabal 1.18

If you're using Mac OSX 10.9 or see anything clang-related when you do gcc --version then you'll need to tell GHC to use the real gcc or OpenGLRaw won't install. It's a one-line change in a configuration file detailed in this issue comment.

2. Build all the tutorials

Read or do:

sh -x

Run executables like:

$ gltut/pkg/bin/tut1

There are multiple demos in most of the tutorials.


  • Tutorials 1-6 are complete and resemble Jason's examples.
  • Tutorials 7-17 are forthcoming.

-- PLR

Written using GHC 7.6.3, haskell-platform 2013.2.0.0, and GPipe 1.4.3

Licensed under [].
Original work by Jason L. McKesson. Adaptation by Patrick Redmond.

Something went wrong with that request. Please try again.