summaryrefslogtreecommitdiff
path: root/src/LambdaCube/GL/Util.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/LambdaCube/GL/Util.hs')
-rw-r--r--src/LambdaCube/GL/Util.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/LambdaCube/GL/Util.hs b/src/LambdaCube/GL/Util.hs
index 071e86b..1320f7d 100644
--- a/src/LambdaCube/GL/Util.hs
+++ b/src/LambdaCube/GL/Util.hs
@@ -141,7 +141,8 @@ instance Uniformable (V3 V4F) where uniformContexts _ = contexts $ supports Type
141instance Uniformable (V4 V4F) where uniformContexts _ = contexts $ supports TypeM44F 141instance Uniformable (V4 V4F) where uniformContexts _ = contexts $ supports TypeM44F
142 142
143 143
144instance Uniformable TextureData where uniformContexts _ = DMap.empty -- TODO 144instance Uniformable TextureData where uniformContexts _ = DMap.empty
145instance Uniformable TextureCubeData where uniformContexts _ = DMap.empty
145 146
146mkU :: GLData a c => TypeTag c -> a -> IO GLUniform 147mkU :: GLData a c => TypeTag c -> a -> IO GLUniform
147mkU ty a = GLTypedUniform ty <$> newIORef (GLUniformValue a) 148mkU ty a = GLTypedUniform ty <$> newIORef (GLUniformValue a)
@@ -177,8 +178,9 @@ initializeUniform t = case witnessType t of
177 TypeM44F -> mkU ty (V4 z4 z4 z4 z4) 178 TypeM44F -> mkU ty (V4 z4 z4 z4 z4)
178 179
179 Nothing -> case t of 180 Nothing -> case t of
180 FTexture2D -> GLUniform t <$> newIORef (TextureData 0) 181 FTexture2D -> GLUniform <$> newIORef (Texture2DName 0)
181 _ -> fail $ "initializeUniform: " ++ show t 182 FTextureCube -> GLUniform <$> newIORef (TextureCubeName 0)
183 _ -> fail $ "initializeUniform: " ++ show t
182 184
183 185
184data TypeMismatch c a = TypeMismatch 186data TypeMismatch c a = TypeMismatch