diff options
Diffstat (limited to 'Graphics/Glyph/Mat4.hs')
-rw-r--r-- | Graphics/Glyph/Mat4.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Graphics/Glyph/Mat4.hs b/Graphics/Glyph/Mat4.hs index 546baa2..6581126 100644 --- a/Graphics/Glyph/Mat4.hs +++ b/Graphics/Glyph/Mat4.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE MultiParamTypeClasses, FlexibleContexts #-} module Graphics.Glyph.Mat4 where import Control.Monad @@ -9,7 +9,8 @@ import Foreign.Ptr import Foreign.Storable import Graphics.Rendering.OpenGL -import Graphics.Rendering.OpenGL.Raw.Core31 +import Graphics.GL.Compatibility30 +-- import Graphics.Rendering.OpenGL.Raw.Core31 data Mat4 a = Matrix (a,a,a,a, a,a,a,a, @@ -50,7 +51,7 @@ instance (Storable t) => StorableMatrix t Mat3 where instance Uniform (Mat4 GLfloat) where uniform (UniformLocation loc) = makeStateVar getter setter where setter mat = toPtr mat $ \ptr -> - glUniformMatrix4fv loc 1 (fromIntegral gl_FALSE) ptr + glUniformMatrix4fv loc 1 (fromIntegral GL_FALSE) ptr getter :: IO (Mat4 GLfloat) getter = do pid <- liftM fromIntegral getCurrentProgram @@ -61,7 +62,7 @@ instance Uniform (Mat4 GLfloat) where instance Uniform (Mat3 GLfloat) where uniform (UniformLocation loc) = makeStateVar getter setter where setter mat = toPtr mat $ \ptr -> - glUniformMatrix3fv loc 1 (fromIntegral gl_FALSE) ptr + glUniformMatrix3fv loc 1 (fromIntegral GL_FALSE) ptr getter :: IO (Mat3 GLfloat) getter = do pid <- liftM fromIntegral getCurrentProgram @@ -70,7 +71,7 @@ instance Uniform (Mat3 GLfloat) where fromPtr buf return ) getCurrentProgram :: IO GLint -getCurrentProgram = alloca $ glGetIntegerv gl_CURRENT_PROGRAM >> peek +getCurrentProgram = alloca $ \ptr -> glGetIntegerv GL_CURRENT_PROGRAM ptr >> peek ptr instance (Show a) => Show (Mat4 a) where show IdentityMatrix = |