free-game 0.3.1.2 → 0.3.1.3
raw patch · 9 files changed
+51/−12 lines, 9 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Graphics.FreeGame.Data.Color: fromRGBA :: Float -> Float -> Float -> Float -> Color
+ Graphics.FreeGame.Simple: data GameParam
+ Graphics.FreeGame.Simple: degrees :: Float -> Float
Files
- Graphics/FreeGame/Backends/GLFW.hs +11/−0
- Graphics/FreeGame/Base.hs +1/−1
- Graphics/FreeGame/Data/Bitmap.hs +1/−1
- Graphics/FreeGame/Data/Color.hs +18/−5
- Graphics/FreeGame/Data/Font.hs +1/−1
- Graphics/FreeGame/Input.hs +13/−0
- Graphics/FreeGame/Simple.hs +3/−1
- Graphics/FreeGame/Util.hs +1/−1
- free-game.cabal +2/−2
Graphics/FreeGame/Backends/GLFW.hs view
@@ -1,3 +1,14 @@+----------------------------------------------------------------------------- +-- | +-- Module : Graphics.FreeGame.Backends.GLFW +-- Copyright : (C) 2013 Fumiaki Kinoshita +-- License : BSD-style (see the file LICENSE) +-- +-- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com> +-- Stability : experimental +-- Portability : non-portable +-- +---------------------------------------------------------------------------- {-# LANGUAGE ImplicitParams, ScopedTypeVariables #-} module Graphics.FreeGame.Backends.GLFW (runGame) where import Graphics.UI.GLFW as GLFW
Graphics/FreeGame/Base.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Base --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2012-2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com>
Graphics/FreeGame/Data/Bitmap.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Data.Bitmap --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com>
Graphics/FreeGame/Data/Color.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Data.Color --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com> @@ -10,27 +10,40 @@ -- -- Colors and its operations ---------------------------------------------------------------------------- -module Graphics.FreeGame.Data.Color (Color(..), fromRGBA, colorAsWord8, transparent, white, black, red, green, blue, yellow, cyan, magenta, intermediate, halfD, halfB) where +module Graphics.FreeGame.Data.Color ( + -- * The type + Color(..) + , colorAsWord8 + -- * Color operations + , transparent + , intermediate + , halfD + , halfB + -- * Basic colors + , white, black, red, green, blue, yellow, cyan, magenta + ) where import Data.Word +-- | A color that has red, green, blue, alpha as its component. data Color = Color Float Float Float Float deriving (Show, Eq, Ord) -fromRGBA :: Float -> Float -> Float -> Float -> Color -fromRGBA = Color - colorAsWord8 :: Color -> (Word8, Word8, Word8, Word8) colorAsWord8 (Color r g b a) = (floor $ r * 255, floor $ g * 255, floor $ b * 255, floor $ a * 255) +-- | An intermediate between the given colors. intermediate :: Color -> Color -> Color intermediate (Color r0 g0 b0 a0) (Color r1 g1 b1 a1) = Color ((r0 + r1)/2) ((g0 + g1)/2) ((b0 + b1)/2) ((a0 + a1)/2) +-- | Give a transparency to the color. transparent :: Float -> Color -> Color transparent f (Color r g b a) = Color r g b (f * a) +-- | An intermediate between the black and the given color halfD :: Color -> Color halfD = intermediate black +-- | An intermediate between the white and the given color halfB :: Color -> Color halfB = intermediate white
Graphics/FreeGame/Data/Font.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Data.Font --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com>
Graphics/FreeGame/Input.hs view
@@ -1,7 +1,19 @@+----------------------------------------------------------------------------- +-- | +-- Module : Graphics.FreeGame.Input +-- Copyright : (C) 2013 Fumiaki Kinoshita +-- License : BSD-style (see the file LICENSE) +-- +-- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com> +-- Stability : experimental +-- Portability : non-portable +-- +---------------------------------------------------------------------------- module Graphics.FreeGame.Input where import Data.Vect +-- | The state of the mouse. data MouseState = MouseState { mousePosition :: Vec2 , leftButton :: Bool @@ -10,6 +22,7 @@ , mouseWheel :: Int } deriving Show +-- | Keys. data Key = KeyChar Char | KeySpace
Graphics/FreeGame/Simple.hs view
@@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Simple --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com> @@ -15,6 +15,7 @@ Game -- * Run the game + ,GameParam ,defaultGameParam ,runSimple @@ -39,6 +40,7 @@ -- * Utilities ,randomness + ,degrees -- * Reexports ,module Graphics.FreeGame.Input
Graphics/FreeGame/Util.hs view
@@ -2,7 +2,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.FreeGame.Util --- Copyright : (C) 2012 Fumiaki Kinoshita +-- Copyright : (C) 2013 Fumiaki Kinoshita -- License : BSD-style (see the file LICENSE) -- -- Maintainer : Fumiaki Kinsohita <fumiexcel@gmail.com>
free-game.cabal view
@@ -1,5 +1,5 @@ name: free-game -version: 0.3.1.2 +version: 0.3.1.3 synopsis: Create graphical applications for free. description: Cross-platform GUI library based on free monads. homepage: https://github.com/fumieval/free-game @@ -22,7 +22,7 @@ source-repository head type: git - location: git@github.com:fumieval/free-game.git + location: https://github.com/fumieval/free-game.git library exposed-modules: Graphics.FreeGame