How do VBOs/FBOs/DisplayLists work in Haskell's OpenGl bindings?

696 Views Asked by At

Haskell is about computation by calculation of values.

DisplayLists / FBOs / VBOs are very very stateful by nature. I.e. "give me a display list / buffer object".

How do these bindings work in Haskell?

[I do understand monads; so a technical explaination, as opposed to a fluffy one, is preferred].

Thanks!

1

There are 1 best solutions below

3
On BEST ANSWER

HOpenGL does everything in the IO monad. The API it presents is more OpenGL-like than Haskell-like. For example,

do
    -- create a new display list
    dl <- defineNewList $ do
        -- put some
        -- drawing code
        -- in here

    -- call a pre-defined display list
    callList dl

So all the low-level OpenGL interactions do end up being very stateful.