开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜