essence-of-live-coding-gloss 0.2.0.0 → 0.2.0.1
raw patch · 3 files changed
+13/−7 lines, 3 filesdep ~essence-of-live-codingPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: essence-of-live-coding
API changes (from Hackage documentation)
+ LiveCoding.Gloss: [debugEvents] :: GlossSettings -> Bool
- LiveCoding.Gloss: GlossSettings :: Display -> Color -> Int -> GlossSettings
+ LiveCoding.Gloss: GlossSettings :: Display -> Color -> Int -> Bool -> GlossSettings
- LiveCoding.Gloss: handleEvent :: Event -> GlossVars -> IO GlossVars
+ LiveCoding.Gloss: handleEvent :: Bool -> Event -> GlossVars -> IO GlossVars
Files
- essence-of-live-coding-gloss.cabal +2/−2
- src/LiveCoding/Gloss.hs +6/−3
- src/LiveCoding/Gloss/PictureM.hs +5/−2
essence-of-live-coding-gloss.cabal view
@@ -1,5 +1,5 @@ name: essence-of-live-coding-gloss-version: 0.2.0.0+version: 0.2.0.1 synopsis: General purpose live coding framework - Gloss backend description: essence-of-live-coding is a general purpose and type safe live coding framework.@@ -43,7 +43,7 @@ base >= 4.11 && < 5 , syb >= 0.7 , transformers >= 0.5- , essence-of-live-coding >= 0.2.0.0+ , essence-of-live-coding >= 0.2.0.1 , foreign-store >= 0.2 , gloss >= 1.13 hs-source-dirs: src
src/LiveCoding/Gloss.hs view
@@ -54,6 +54,7 @@ { displaySetting :: Display -- ^ Display mode (e.g. 'InWindow' or 'FullScreen'). , backgroundColor :: Color -- ^ Background color. , stepsPerSecond :: Int -- ^ Number of simulation steps per second of real time.+ , debugEvents :: Bool -- ^ Print all incoming events to the console. } defaultSettings :: GlossSettings@@ -61,6 +62,7 @@ { displaySetting = InWindow "Essence of live coding" (600, 800) (20, 20) , backgroundColor = black , stepsPerSecond = 30+ , debugEvents = False } -- | Will create a handle for communication with the gloss thread,@@ -74,7 +76,7 @@ glossExitRef <- newIORef False let glossVars = GlossVars { .. } glossThread <- forkIO- $ playIO displaySetting backgroundColor stepsPerSecond glossVars getPicture handleEvent stepGloss+ $ playIO displaySetting backgroundColor stepsPerSecond glossVars getPicture (handleEvent debugEvents) stepGloss return GlossHandle { .. } , destroy = \GlossHandle { glossVars = GlossVars { .. }, .. } -> writeIORef glossExitRef True }@@ -82,8 +84,9 @@ getPicture :: GlossVars -> IO Picture getPicture GlossVars { .. } = readIORef glossPicRef -handleEvent :: Event -> GlossVars -> IO GlossVars-handleEvent event vars@GlossVars { .. } = do+handleEvent :: Bool -> Event -> GlossVars -> IO GlossVars+handleEvent debugEvents event vars@GlossVars { .. } = do+ when debugEvents $ print event modifyIORef glossEventsRef (event :) return vars
src/LiveCoding/Gloss/PictureM.hs view
@@ -1,8 +1,11 @@-module LiveCoding.Gloss.PictureM where+module LiveCoding.Gloss.PictureM+ ( module LiveCoding.Gloss.PictureM+ , module X+ ) where -- transformers import Control.Monad.Trans.Class-import Control.Monad.Trans.Reader+import Control.Monad.Trans.Reader as X import Control.Monad.Trans.Writer -- gloss