diff options
author | Joe Crayne <joe@jerkface.net> | 2019-05-30 04:38:01 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-05-30 04:38:01 -0400 |
commit | b13702e457d79f79831f8e852edd89a6abf28d81 (patch) | |
tree | d0af10b2e785ca6c0a54422044dcb68bfe94d8ae /src/LambdaCube | |
parent | cba699022b784bb63cc783071b48bfc9d7958599 (diff) |
More TypeTag machinery.submit
Diffstat (limited to 'src/LambdaCube')
-rw-r--r-- | src/LambdaCube/GL/Input/Type.hs | 22 | ||||
-rw-r--r-- | src/LambdaCube/GL/Type.hs | 6 |
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 | |||
525 | withTypes :: p (a::k) -> q (b::k) -> f a b -> f a b | 525 | withTypes :: p (a::k) -> q (b::k) -> f a b -> f a b |
526 | withTypes _ _ x = x | 526 | withTypes _ _ x = x |
527 | 527 | ||
528 | class TypeTaggable c where typeTag :: t c -> TypeTag c | ||
529 | instance TypeTaggable (GLVector 1 Word32) where typeTag _ = TypeWord | ||
530 | instance TypeTaggable (GLVector 2 Word32) where typeTag _ = TypeV2U | ||
531 | instance TypeTaggable (GLVector 3 Word32) where typeTag _ = TypeV3U | ||
532 | instance TypeTaggable (GLVector 4 Word32) where typeTag _ = TypeV4U | ||
533 | instance TypeTaggable (GLVector 1 Int32) where typeTag _ = TypeInt | ||
534 | instance TypeTaggable (GLVector 2 Int32) where typeTag _ = TypeV2I | ||
535 | instance TypeTaggable (GLVector 3 Int32) where typeTag _ = TypeV3I | ||
536 | instance TypeTaggable (GLVector 4 Int32) where typeTag _ = TypeV4I | ||
537 | instance TypeTaggable (GLVector 1 Float) where typeTag _ = TypeFloat | ||
538 | instance TypeTaggable (GLVector 2 Float) where typeTag _ = TypeV2F | ||
539 | instance TypeTaggable (GLVector 3 Float) where typeTag _ = TypeV3F | ||
540 | instance TypeTaggable (GLVector 4 Float) where typeTag _ = TypeV4F | ||
541 | instance TypeTaggable (GLMatrix 2 2 Float) where typeTag _ = TypeM22F | ||
542 | instance TypeTaggable (GLMatrix 3 2 Float) where typeTag _ = TypeM23F | ||
543 | instance TypeTaggable (GLMatrix 4 2 Float) where typeTag _ = TypeM24F | ||
544 | instance TypeTaggable (GLMatrix 2 3 Float) where typeTag _ = TypeM32F | ||
545 | instance TypeTaggable (GLMatrix 3 3 Float) where typeTag _ = TypeM33F | ||
546 | instance TypeTaggable (GLMatrix 4 3 Float) where typeTag _ = TypeM34F | ||
547 | instance TypeTaggable (GLMatrix 2 4 Float) where typeTag _ = TypeM42F | ||
548 | instance TypeTaggable (GLMatrix 3 4 Float) where typeTag _ = TypeM43F | ||
549 | instance 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 | ||
149 | data GLTexture | 149 | data GLTexture |