diff options
Diffstat (limited to 'src/LambdaCube/GL/Type.hs')
-rw-r--r-- | src/LambdaCube/GL/Type.hs | 34 |
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 | |||
6 | import Data.Int | 6 | import Data.Int |
7 | import Data.IntMap (IntMap) | 7 | import Data.IntMap (IntMap) |
8 | import Data.Set (Set) | 8 | import Data.Set (Set) |
9 | import Data.Trie (Trie) | 9 | import Data.Map (Map) |
10 | import Data.Vector (Vector) | 10 | import Data.Vector (Vector) |
11 | import Data.Word | 11 | import Data.Word |
12 | import Foreign.Ptr | 12 | import 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 | ||
68 | data SlotSchema | 68 | data 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 | ||
75 | data PipelineSchema | 75 | data 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 | |||
99 | data GLStorage | 99 | data 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 | ||
139 | data GLTexture | 139 | data 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 | ||