summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Type.hs
diff options
context:
space:
mode:
authorCsaba Hruska <csaba.hruska@gmail.com>2016-01-08 14:53:25 +0100
committerCsaba Hruska <csaba.hruska@gmail.com>2016-01-08 14:53:25 +0100
commit2cc82723838be8f9fc084c7582bbc87f26e1a794 (patch)
tree154ecec9f0a82f0d6aeb3c5a9f2cd7b489cfa8cb /src/LambdaCube/GL/Type.hs
parent64e13239772dae2a73e30bd0aa8ca2c70154987c (diff)
use Map instead of Trie
Diffstat (limited to 'src/LambdaCube/GL/Type.hs')
-rw-r--r--src/LambdaCube/GL/Type.hs34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/LambdaCube/GL/Type.hs b/src/LambdaCube/GL/Type.hs
index c82a8f0..c06032f 100644
--- a/src/LambdaCube/GL/Type.hs
+++ b/src/LambdaCube/GL/Type.hs
@@ -6,7 +6,7 @@ import Data.IORef
6import Data.Int 6import Data.Int
7import Data.IntMap (IntMap) 7import Data.IntMap (IntMap)
8import Data.Set (Set) 8import Data.Set (Set)
9import Data.Trie (Trie) 9import Data.Map (Map)
10import Data.Vector (Vector) 10import Data.Vector (Vector)
11import Data.Word 11import Data.Word
12import Foreign.Ptr 12import Foreign.Ptr
@@ -65,17 +65,17 @@ data ArrayDesc
65 - per object features: enable/disable visibility, set render ordering 65 - per object features: enable/disable visibility, set render ordering
66-} 66-}
67 67
68data SlotSchema 68data ObjectArraySchema
69 = SlotSchema 69 = ObjectArraySchema
70 { primitive :: FetchPrimitive 70 { primitive :: FetchPrimitive
71 , attributes :: Trie StreamType 71 , attributes :: Map ByteString StreamType
72 } 72 }
73 deriving Show 73 deriving Show
74 74
75data PipelineSchema 75data PipelineSchema
76 = PipelineSchema 76 = PipelineSchema
77 { slots :: Trie SlotSchema 77 { objectArrays :: Map ByteString ObjectArraySchema
78 , uniforms :: Trie InputType 78 , uniforms :: Map ByteString InputType
79 } 79 }
80 deriving Show 80 deriving Show
81 81
@@ -99,11 +99,11 @@ data GLSlot
99data GLStorage 99data GLStorage
100 = GLStorage 100 = GLStorage
101 { schema :: PipelineSchema 101 { schema :: PipelineSchema
102 , slotMap :: Trie SlotName 102 , slotMap :: Map ByteString SlotName
103 , slotVector :: Vector (IORef GLSlot) 103 , slotVector :: Vector (IORef GLSlot)
104 , objSeed :: IORef Int 104 , objSeed :: IORef Int
105 , uniformSetter :: Trie InputSetter 105 , uniformSetter :: Map ByteString InputSetter
106 , uniformSetup :: Trie GLUniform 106 , uniformSetup :: Map ByteString GLUniform
107 , screenSize :: IORef (Word,Word) 107 , screenSize :: IORef (Word,Word)
108 , pipelines :: IORef (Vector (Maybe GLRenderer)) -- attached pipelines 108 , pipelines :: IORef (Vector (Maybe GLRenderer)) -- attached pipelines
109 } 109 }
@@ -113,9 +113,9 @@ data Object -- internal type
113 { objSlot :: SlotName 113 { objSlot :: SlotName
114 , objPrimitive :: Primitive 114 , objPrimitive :: Primitive
115 , objIndices :: Maybe (IndexStream Buffer) 115 , objIndices :: Maybe (IndexStream Buffer)
116 , objAttributes :: Trie (Stream Buffer) 116 , objAttributes :: Map ByteString (Stream Buffer)
117 , objUniSetter :: Trie InputSetter 117 , objUniSetter :: Map ByteString InputSetter
118 , objUniSetup :: Trie GLUniform 118 , objUniSetup :: Map ByteString GLUniform
119 , objOrder :: IORef Int 119 , objOrder :: IORef Int
120 , objEnabled :: IORef Bool 120 , objEnabled :: IORef Bool
121 , objId :: Int 121 , objId :: Int
@@ -130,10 +130,10 @@ data GLProgram
130 = GLProgram 130 = GLProgram
131 { shaderObjects :: [GLuint] 131 { shaderObjects :: [GLuint]
132 , programObject :: GLuint 132 , programObject :: GLuint
133 , inputUniforms :: Trie GLint 133 , inputUniforms :: Map ByteString GLint
134 , inputTextures :: Trie GLint -- all input textures (render texture + uniform texture) 134 , inputTextures :: Map ByteString GLint -- all input textures (render texture + uniform texture)
135 , inputTextureUniforms :: Set ByteString 135 , inputTextureUniforms :: Set ByteString
136 , inputStreams :: Trie (GLuint,ByteString) 136 , inputStreams :: Map ByteString (GLuint,ByteString)
137 } 137 }
138 138
139data GLTexture 139data GLTexture
@@ -154,7 +154,7 @@ data GLStream
154 = GLStream 154 = GLStream
155 { glStreamCommands :: IORef [GLObjectCommand] 155 { glStreamCommands :: IORef [GLObjectCommand]
156 , glStreamPrimitive :: Primitive 156 , glStreamPrimitive :: Primitive
157 , glStreamAttributes :: Trie (Stream Buffer) 157 , glStreamAttributes :: Map ByteString (Stream Buffer)
158 , glStreamProgram :: ProgramName 158 , glStreamProgram :: ProgramName
159 } 159 }
160 160
@@ -169,7 +169,7 @@ data GLRenderer
169 , glInput :: IORef (Maybe InputConnection) 169 , glInput :: IORef (Maybe InputConnection)
170 , glSlotNames :: Vector ByteString 170 , glSlotNames :: Vector ByteString
171 , glVAO :: GLuint 171 , glVAO :: GLuint
172 , glTexUnitMapping :: Trie (IORef GLint) -- maps texture uniforms to texture units 172 , glTexUnitMapping :: Map ByteString (IORef GLint) -- maps texture uniforms to texture units
173 , glStreams :: Vector GLStream 173 , glStreams :: Vector GLStream
174 } 174 }
175 175