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.
精彩评论