[Haskell-cafe] Correct way to record state in OpenGL?

Mark Spezzano mark.spezzano at chariot.net.au
Sun Apr 4 05:03:49 EDT 2010


What is the correct way to record "custom" state when using OpenGL?

By this, I refer to, say, properties of a square--say it's x,y coordinates as it moves across the screen. This requires that the program keep track of the object's state as it moves. These coordinates are _not_ part of the OpenGL state machine, so is the correct way to use the State monad?

If so--or if not so--how would I proceed to keep track of the state of my objects as they move about the screen? Maybe the HOpenGL implementation comes with such state-tracking devices?

Please post code snippets if necessary.

Thanks in advance,

Mark Spezzano

More information about the Haskell-Cafe mailing list