开发者

Haskell loadMatrixf

开发者 https://www.devze.com 2023-03-08 10:13 出处:网络
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.

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

精彩评论

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