开发者

Haskell loadMatrixf

Where is the OpenGL 开发者_StackOverflowfunction for loadMatrixf and what is the type signature?


See the Matrix class. I think you are looking for either newMatrix or the matrix StateVar in those docs.

For example: let mat be a list of 16 floats representing the matrix. Then you would use it something like this:

import qualified Graphics.Rendering.OpenGL.GL as GL

drawThingWithMatrix :: [GL.GLfloat] -> IO ()
drawThingWithMatrix mat = GL.preservingMatrix $ do  -- instead of push/pop
    newmat <- GL.newMatrix GL.RowMajor mat          -- or ColumnMajor
    GL.currentMatrix GL.$= newmat
    -- draw your thing

That's about right I think. It has been a while.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜