merging with affection-examples

This commit is contained in:
nek0 2016-05-29 18:01:23 +02:00
parent 54d9f891b4
commit 2b69376fb7
3 changed files with 49 additions and 3 deletions

View file

@ -23,6 +23,13 @@ build-type: Simple
cabal-version: >=1.10 cabal-version: >=1.10
source-repository head
type: git
location: https://github.com/nek0/affection
flag examples
description: Build example programs
default: False
library library
exposed-modules: Affection exposed-modules: Affection
@ -50,6 +57,26 @@ library
, gegl , gegl
-- , sdl2-image -- , sdl2-image
source-repository head executable example00
type: git hs-source-dirs: examples
location: https://github.com/nek0/affection 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

10
examples/example00.hs Normal file
View file

@ -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

9
examples/example01.hs Normal file
View file

@ -0,0 +1,9 @@
import Affection
main :: IO ()
main = withAllAffection $
withDefaultWindow "test" $ do
changeColor $ RGBA 255 255 255 255
clear
present
liftIO $ delaySec 2