diff options
Diffstat (limited to 'src/LambdaCube/GL/Util.hs')
-rw-r--r-- | src/LambdaCube/GL/Util.hs | 8 |
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 | |||
141 | instance Uniformable (V4 V4F) where uniformContexts _ = contexts $ supports TypeM44F | 141 | instance Uniformable (V4 V4F) where uniformContexts _ = contexts $ supports TypeM44F |
142 | 142 | ||
143 | 143 | ||
144 | instance Uniformable TextureData where uniformContexts _ = DMap.empty -- TODO | 144 | instance Uniformable TextureData where uniformContexts _ = DMap.empty |
145 | instance Uniformable TextureCubeData where uniformContexts _ = DMap.empty | ||
145 | 146 | ||
146 | mkU :: GLData a c => TypeTag c -> a -> IO GLUniform | 147 | mkU :: GLData a c => TypeTag c -> a -> IO GLUniform |
147 | mkU ty a = GLTypedUniform ty <$> newIORef (GLUniformValue a) | 148 | mkU 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 | ||
184 | data TypeMismatch c a = TypeMismatch | 186 | data TypeMismatch c a = TypeMismatch |