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

2010-04-08 Thread Mark Spezzano
I sort of understand what people are getting at. My basic question is now, given that I have a bunch of parameters that represent state should I bundle up ALL of these parameters in one data type (DemoState, say) and have ONE IORef variable that references the lot, or have an IORef for each

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

2010-04-08 Thread Mark Spezzano
Maybe I should ask: If I have many state variables encapsulated in one IO (StateVar DemoState) how do I go about referencing and updating _one_ without having to enumerate all of them? What is the syntax? Mark On 09/04/2010, at 12:13 AM, Mark Spezzano wrote: I sort of understand what people

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

2010-04-04 Thread Mark Spezzano
Hi 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

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

2010-04-04 Thread Christopher Lane Hinson
A state monad is really just a convenience (of the sanity-sustaining variety), so that you don't have to name a variable for each new modification of your state. It won't help you here with this specific problem. Create an IORef or MVar early in your main function, and pass it into your

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

2010-04-04 Thread Casey McCann
On Sun, Apr 4, 2010 at 5:03 AM, Mark Spezzano mark.spezz...@chariot.net.au wrote: 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