From 2b69376fb74eabd2d53c8786a87137f5ea643ad4 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 29 May 2016 18:01:23 +0200 Subject: [PATCH] merging with affection-examples --- affection.cabal | 33 ++++++++++++++++++++++++++++++--- examples/example00.hs | 10 ++++++++++ examples/example01.hs | 9 +++++++++ 3 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 examples/example00.hs create mode 100644 examples/example01.hs diff --git a/affection.cabal b/affection.cabal index c44e398..0dee209 100644 --- a/affection.cabal +++ b/affection.cabal @@ -23,6 +23,13 @@ build-type: Simple cabal-version: >=1.10 +source-repository head + type: git + location: https://github.com/nek0/affection + +flag examples + description: Build example programs + default: False library exposed-modules: Affection @@ -50,6 +57,26 @@ library , gegl -- , sdl2-image -source-repository head - type: git - location: https://github.com/nek0/affection +executable example00 + hs-source-dirs: examples + main-is: example00.hs + ghc-options: -threaded -Wall + default-language: Haskell2010 + default-extensions: OverloadedStrings + if flag(examples) + build-depends: base + , affection + else + buildable: False + +executable example01 + hs-source-dirs: examples + main-is: example01.hs + ghc-options: -threaded -Wall + default-language: Haskell2010 + default-extensions: OverloadedStrings + if flag(examples) + build-depends: base + , affection + else + buildable: False diff --git a/examples/example00.hs b/examples/example00.hs new file mode 100644 index 0000000..3d67ac1 --- /dev/null +++ b/examples/example00.hs @@ -0,0 +1,10 @@ +import Affection +import Affection.Render + +main :: IO () +main = withAllAffection $ + withDefaultWindow "test" $ do + changeColor $ RGBA 255 255 255 255 + clear + present + liftIO $ delaySec 2 diff --git a/examples/example01.hs b/examples/example01.hs new file mode 100644 index 0000000..b0050b5 --- /dev/null +++ b/examples/example01.hs @@ -0,0 +1,9 @@ +import Affection + +main :: IO () +main = withAllAffection $ + withDefaultWindow "test" $ do + changeColor $ RGBA 255 255 255 255 + clear + present + liftIO $ delaySec 2