aboutsummaryrefslogtreecommitdiff
path: root/Graphics/Glyph/Mat4.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Graphics/Glyph/Mat4.hs')
-rw-r--r--Graphics/Glyph/Mat4.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/Graphics/Glyph/Mat4.hs b/Graphics/Glyph/Mat4.hs
index c1ae485..7d54b05 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,8 +9,9 @@ import Foreign.Ptr
import Foreign.Storable
import Graphics.Rendering.OpenGL (Uniform(..),uniform,UniformLocation(..),makeStateVar)
-import Graphics.Rendering.OpenGL.Raw.Core31
+import Graphics.GL.Core43
+{- ORMOLU_DISABLE -};
data Mat4 a = Matrix4 (a,a,a,a,
a,a,a,a,
a,a,a,a,
@@ -19,6 +20,7 @@ data Mat4 a = Matrix4 (a,a,a,a,
data Mat3 a = Matrix3 ( a,a,a,
a,a,a,
a,a,a ) | IdentityMatrix3
+{- ORMOLU_ENABLE -};
class StorableMatrix t a where
fromList :: [t] -> a t
@@ -85,7 +87,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
@@ -97,7 +99,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
@@ -107,7 +109,7 @@ instance Uniform (Mat3 GLfloat) where
uniformv _ = undefined
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 =