From 7a54887c623c9328470a1ba302fa4b1c8373cb75 Mon Sep 17 00:00:00 2001 From: Joe Crayne Date: Sun, 21 Apr 2019 05:16:17 -0400 Subject: Signatures, comments, dead-code removal. --- src/LambdaCube/GL/Input.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/LambdaCube/GL/Input.hs') diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs index 30125d9..5d2a49e 100644 --- a/src/LambdaCube/GL/Input.hs +++ b/src/LambdaCube/GL/Input.hs @@ -397,6 +397,7 @@ type UniM = Writer [Map GLUniformName InputSetter -> IO ()] class UniformSetter a where (@=) :: GLUniformName -> IO a -> UniM () +setUniM :: (n -> Map GLUniformName InputSetter -> a -> IO ()) -> n -> IO a -> UniM () setUniM setUni n act = tell [\s -> let f = setUni n s in f =<< act] instance UniformSetter Bool where (@=) = setUniM uniformBool @@ -426,10 +427,12 @@ instance UniformSetter M43F where (@=) = setUniM uniformM43F instance UniformSetter M44F where (@=) = setUniM uniformM44F instance UniformSetter TextureData where (@=) = setUniM uniformFTexture2D +updateUniforms :: GLStorage -> UniM a -> IO () updateUniforms storage m = sequence_ l where setters = uniformSetter storage l = map ($ setters) $ execWriter m +updateObjectUniforms :: Object -> UniM a -> IO () updateObjectUniforms object m = sequence_ l where setters = objectUniformSetter object l = map ($ setters) $ execWriter m -- cgit v1.2.3