Skip to content

HTTPS clone URL

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
Haskell
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Tut_01_Hello_Triangle/hs
Tut_02_Playing_with_Colors/hs changed all version ranges to exact versions; tested with build.sh on…
Tut_03_OpenGLs_Moving_Triangle/hs
Tut_04_Objects_at_Rest/hs
Tut_05_Objects_in_Depth/hs
Tut_06_Objects_in_Motion/hs
Tut_07_World_in_Motion/hs
framework/hs
.gitignore
LICENSE.md
README.md
build.sh

README.md

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.

Usage

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.

Installation

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-1.18.0.4 # 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 build.sh or do:

wget https://raw.githubusercontent.com/plredmond/gltut_haskell-gpipe/master/build.sh
sh -x build.sh

Run executables like:

$ gltut/pkg/bin/tut1

There are multiple demos in most of the tutorials.

Status

  • 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 [http://creativecommons.org/licenses/by/3.0/us/].
Original work by Jason L. McKesson. Adaptation by Patrick Redmond.

Something went wrong with that request. Please try again.