gloss 1.7.1.1 → 1.7.2.1
raw patch · 5 files changed
+46/−10 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Graphics.Gloss.Data.Color: makeColor' :: Float -> Float -> Float -> Float -> Color
+ Graphics.Gloss.Interface.IO.Animate: animateFixedIO :: Display -> Color -> (Float -> IO Picture) -> IO ()
Files
- Graphics/Gloss/Data/Color.hs +12/−2
- Graphics/Gloss/Interface/IO/Animate.hs +23/−3
- Graphics/Gloss/Interface/Pure/Animate.hs +3/−1
- Graphics/Gloss/Internals/Interface/Animate.hs +7/−3
- gloss.cabal +1/−1
Graphics/Gloss/Data/Color.hs view
@@ -4,7 +4,9 @@ ( -- ** Color data type Color- , makeColor, makeColor8+ , makeColor+ , makeColor'+ , makeColor8 , rawColor , rgbaOfColor @@ -74,7 +76,15 @@ = clampColor $ RGBA r g b a {-# INLINE makeColor #-}- +++-- | Make a custom color. +-- You promise that all components are clamped to the range [0..1]+makeColor' :: Float -> Float -> Float -> Float -> Color+makeColor' r g b a+ = RGBA r g b a+{-# INLINE makeColor' #-}+ -- | Make a custom color. All components are clamped to the range [0..255]. makeColor8
Graphics/Gloss/Interface/IO/Animate.hs view
@@ -4,7 +4,8 @@ ( module Graphics.Gloss.Data.Display , module Graphics.Gloss.Data.Picture , module Graphics.Gloss.Data.Color- , animateIO)+ , animateIO+ , animateFixedIO) where import Graphics.Gloss.Data.Display import Graphics.Gloss.Data.Picture@@ -17,7 +18,8 @@ -- -- Once the window is open you can use the same commands as with @display@. ---animateIO :: Display -- ^ Display mode.+animateIO + :: Display -- ^ Display mode. -> Color -- ^ Background color. -> (Float -> IO Picture) -- ^ Function to produce the next frame of animation. -- It is passed the time in seconds since the program started.@@ -25,5 +27,23 @@ animateIO display backColor frameFunIO = animateWithBackendIO - defaultBackendState display backColor+ defaultBackendState + True -- pannable+ display backColor+ frameFunIO+++-- | Like `animateIO` but don't allow the display to be panned around.+--+animateFixedIO+ :: Display -- ^ Display mode.+ -> Color -- ^ Background color.+ -> (Float -> IO Picture) -- ^ Function to produce the next frame of animation. + -- It is passed the time in seconds since the program started.+ -> IO ()+animateFixedIO display backColor frameFunIO+ = animateWithBackendIO + defaultBackendState + False+ display backColor frameFunIO
Graphics/Gloss/Interface/Pure/Animate.hs view
@@ -25,5 +25,7 @@ animate display backColor frameFun = animateWithBackendIO - defaultBackendState display backColor+ defaultBackendState+ True -- pannable+ display backColor (return . frameFun)
Graphics/Gloss/Internals/Interface/Animate.hs view
@@ -26,13 +26,14 @@ animateWithBackendIO :: Backend a => a -- ^ Initial State of the backend+ -> Bool -- ^ Whether to allow the image to be panned around. -> Display -- ^ Display mode. -> Color -- ^ Background color. -> (Float -> IO Picture) -- ^ Function to produce the next frame of animation. -- It is passed the time in seconds since the program started. -> IO () -animateWithBackendIO backend display backColor frameOp+animateWithBackendIO backend pannable display backColor frameOp = do -- viewSR <- newIORef viewPortInit@@ -66,11 +67,14 @@ , Callback.Display (animateEnd animateSR) , Callback.Idle (\s -> postRedisplay s) , callback_exit () - , callback_viewPort_keyMouse viewSR viewControlSR , callback_viewPort_motion viewSR viewControlSR , callback_viewPort_reshape ]+ + ++ (if pannable + then [callback_viewPort_keyMouse viewSR viewControlSR]+ else []) - createWindow backend display backColor callbacks+ createWindow backend display backColor callbacks getsIORef :: IORef a -> (a -> r) -> IO r getsIORef ref fun
gloss.cabal view
@@ -1,5 +1,5 @@ Name: gloss-Version: 1.7.1.1+Version: 1.7.2.1 License: MIT License-file: LICENSE Author: Ben Lippmeier