How do VBOs/FBOs/DisplayLists work in Haskell's OpenGl bindings?
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!
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.
精彩评论