graphics-drawingcombinators 1.4.3 → 1.4.4
raw patch · 3 files changed
+13/−18 lines, 3 filesdep ~OpenGLPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: OpenGL
API changes (from Hackage documentation)
Files
- Graphics/DrawingCombinators.hs +1/−1
- example.hs +9/−14
- graphics-drawingcombinators.cabal +3/−3
Graphics/DrawingCombinators.hs view
@@ -307,7 +307,7 @@ -- | A Sprite represents a finite bitmap image. -- -- > [[Sprite]] = [-1,1]^2 -> Color-newtype Sprite = Sprite { spriteObject :: GL.TextureObject }+data Sprite = Sprite { spriteObject :: GL.TextureObject } -- | Load an image from a file and create a sprite out of it. openSprite :: FilePath -> IO Sprite
example.hs view
@@ -35,30 +35,25 @@ (Draw.translate (0.5,-0.5) `Draw.compose` Draw.rotate pi %%), (Draw.translate (-0.5,-0.5) `Draw.compose` Draw.rotate (pi/2) %%)] (Draw.scale 0.5 0.5 %% img) -circleText :: Draw.Sprite -> Draw.Font -> String -> Draw.Image Any-circleText sprite font str = mconcat- [ unitText font str- , Draw.scale 0.5 0.5 %% Draw.sprite sprite- , Draw.tint (Draw.Color 0 0 1 0.5) Draw.circle- ]+circleText :: Draw.Font -> String -> Draw.Image Any+circleText font str = unitText font str `mappend` Draw.tint (Draw.Color 0 0 1 0.5) Draw.circle main :: IO () main = do initScreen args <- getArgs- (font, sprite) <-- case args of- [fontName, spriteName] -> do- font <- Draw.openFont fontName- sprite <- Draw.openSprite spriteName- return (font, sprite)- _ -> fail "Usage: drawingcombinators-example some_font.ttf some_image.[png|jpg|...]"+ font <- case args of+ [fontName] -> do+ font <- Draw.openFont fontName+ return font+ _ -> error "Usage: drawingcombinators-example some_font.ttf" + doneRef <- newIORef False GLFW.setWindowCloseCallback $ do writeIORef doneRef True return True- waitClose doneRef $ quadrants (circleText sprite font "Hello, World!")+ waitClose doneRef $ quadrants (circleText font "Hello, World!") GLFW.terminate return () where
graphics-drawingcombinators.cabal view
@@ -4,7 +4,7 @@ have to go into the deep, dark world of imperative stateful programming just to draw stuff. It supports 2D only (for now), with support drawing geometry, images, and text.-Version: 1.4.3+Version: 1.4.4 Stability: experimental Synopsis: A functional interface to 2D drawing in OpenGL License: BSD3@@ -24,10 +24,10 @@ Description: Does the system have FTGL, thus we could use not sucky fonts Library- Build-Depends: base == 4.*, containers, OpenGL >= 2.4 && < 2.6, stb-image == 0.2.*, bitmap >= 0.0.2+ Build-Depends: base == 4.*, containers, OpenGL >= 2.4 && < 2.7, stb-image == 0.2.*, bitmap >= 0.0.2 Exposed-Modules: Graphics.DrawingCombinators, Graphics.DrawingCombinators.Affine Other-Modules: Graphics.DrawingCombinators.Bitmap- ghc-options : -Wall + ghc-options : -Wall Ghc-Prof-Options: -prof -auto-all if flag(ftgl)