summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-05-30 04:38:01 -0400
committerJoe Crayne <joe@jerkface.net>2019-05-30 04:38:01 -0400
commitb13702e457d79f79831f8e852edd89a6abf28d81 (patch)
treed0af10b2e785ca6c0a54422044dcb68bfe94d8ae
parentcba699022b784bb63cc783071b48bfc9d7958599 (diff)
More TypeTag machinery.submit
-rw-r--r--src/LambdaCube/GL/Input/Type.hs22
-rw-r--r--src/LambdaCube/GL/Type.hs6
2 files changed, 25 insertions, 3 deletions
diff --git a/src/LambdaCube/GL/Input/Type.hs b/src/LambdaCube/GL/Input/Type.hs
index eaadce5..5afe5af 100644
--- a/src/LambdaCube/GL/Input/Type.hs
+++ b/src/LambdaCube/GL/Input/Type.hs
@@ -525,3 +525,25 @@ glABI TypeM44F = IsGLMatrix GLPrimFloat
525withTypes :: p (a::k) -> q (b::k) -> f a b -> f a b 525withTypes :: p (a::k) -> q (b::k) -> f a b -> f a b
526withTypes _ _ x = x 526withTypes _ _ x = x
527 527
528class TypeTaggable c where typeTag :: t c -> TypeTag c
529instance TypeTaggable (GLVector 1 Word32) where typeTag _ = TypeWord
530instance TypeTaggable (GLVector 2 Word32) where typeTag _ = TypeV2U
531instance TypeTaggable (GLVector 3 Word32) where typeTag _ = TypeV3U
532instance TypeTaggable (GLVector 4 Word32) where typeTag _ = TypeV4U
533instance TypeTaggable (GLVector 1 Int32) where typeTag _ = TypeInt
534instance TypeTaggable (GLVector 2 Int32) where typeTag _ = TypeV2I
535instance TypeTaggable (GLVector 3 Int32) where typeTag _ = TypeV3I
536instance TypeTaggable (GLVector 4 Int32) where typeTag _ = TypeV4I
537instance TypeTaggable (GLVector 1 Float) where typeTag _ = TypeFloat
538instance TypeTaggable (GLVector 2 Float) where typeTag _ = TypeV2F
539instance TypeTaggable (GLVector 3 Float) where typeTag _ = TypeV3F
540instance TypeTaggable (GLVector 4 Float) where typeTag _ = TypeV4F
541instance TypeTaggable (GLMatrix 2 2 Float) where typeTag _ = TypeM22F
542instance TypeTaggable (GLMatrix 3 2 Float) where typeTag _ = TypeM23F
543instance TypeTaggable (GLMatrix 4 2 Float) where typeTag _ = TypeM24F
544instance TypeTaggable (GLMatrix 2 3 Float) where typeTag _ = TypeM32F
545instance TypeTaggable (GLMatrix 3 3 Float) where typeTag _ = TypeM33F
546instance TypeTaggable (GLMatrix 4 3 Float) where typeTag _ = TypeM34F
547instance TypeTaggable (GLMatrix 2 4 Float) where typeTag _ = TypeM42F
548instance TypeTaggable (GLMatrix 3 4 Float) where typeTag _ = TypeM43F
549instance TypeTaggable (GLMatrix 4 4 Float) where typeTag _ = TypeM44F
diff --git a/src/LambdaCube/GL/Type.hs b/src/LambdaCube/GL/Type.hs
index 57f7df0..9069f37 100644
--- a/src/LambdaCube/GL/Type.hs
+++ b/src/LambdaCube/GL/Type.hs
@@ -140,10 +140,10 @@ data GLProgram
140 = GLProgram 140 = GLProgram
141 { shaderObjects :: [GLuint] 141 { shaderObjects :: [GLuint]
142 , programObject :: GLuint 142 , programObject :: GLuint
143 , inputUniforms :: Map String GLint 143 , inputUniforms :: Map String GLint -- foreach: GLSetUniform
144 , inputTextures :: Map String GLint -- all input textures (render texture + uniform texture) 144 , inputTextures :: Map String GLint -- all input textures (render texture + uniform texture)
145 , inputTextureUniforms :: Set String 145 , inputTextureUniforms :: Set String -- foreach: GLBindTexture
146 , inputStreams :: Map String (GLuint,String) 146 , inputStreams :: Map String (GLuint,String) -- foreach: GLSetVertexAttrib*Array
147 } 147 }
148 148
149data GLTexture 149data GLTexture