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   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 https://www.haskell.org/platform/prior.html.
cabal install cabal-install-220.127.116.11 # 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
build.sh or do:
wget https://raw.githubusercontent.com/plredmond/gltut_haskell-gpipe/master/build.sh sh -x build.sh
Run executables like:
There are multiple demos in most of the tutorials.
- Tutorials 1-6 are complete and resemble Jason's examples.
- Tutorials 7-17 are forthcoming.
Written using GHC 7.6.3, haskell-platform 2013.2.0.0, and GPipe 1.4.3
Licensed under [http://creativecommons.org/licenses/by/3.0/us/].
Original work by Jason L. McKesson. Adaptation by Patrick Redmond.