-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathFreeGame.hs
117 lines (113 loc) · 2.39 KB
/
FreeGame.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{-# LANGUAGE GeneralisedNewtypeDeriving #-}
-----------------------------------------------------------------------------
-- |
-- Module : FreeGame
-- Copyright : (C) 2013 Fumiaki Kinoshita
-- License : BSD-style (see the file LICENSE)
--
-- Maintainer : Fumiaki Kinoshita <[email protected]>
-- Stability : provisional
-- Portability : non-portable
----------------------------------------------------------------------------
module FreeGame
( -- * Game
Game(..),
runGame,
runGameDefault,
WindowMode(..),
BoundingBox2,
Box(..),
isInside,
delay,
tick,
foreverFrame,
untick,
untickInfinite,
-- * Frame
Frame,
FreeGame(..),
liftFrame,
-- * Transformations
Vec2,
Affine(..),
Local(),
globalize,
localize,
-- * Pictures
Picture2D(..),
BlendMode(..),
Bitmap,
bitmapSize,
readBitmap,
cropBitmap,
clipBitmap,
loadBitmaps,
loadBitmapsWith,
writeBitmap,
-- * Text
Font,
loadFont,
text,
-- * Keyboard
Keyboard(..),
Key(..),
charToKey,
keyPress,
keyUp,
keyDown,
-- * Mouse
Mouse(),
mouseScroll,
mouseInWindow,
mousePositionMay,
mousePosition,
mouseButtonL,
mouseButtonR,
mouseButtonM,
mouseDownL,
mouseDownR,
mouseDownM,
mouseUpL,
mouseUpR,
mouseUpM,
-- * IO
liftIO,
randomness,
-- * Utility functions
unitV2,
angleV2,
degrees,
radians,
-- * Reexports
module Control.Monad,
module Control.Applicative,
module Control.Bool,
module Data.Color,
module Data.Color.Names,
module Linear,
-- * Deprecated
keyChar,
keySpecial
) where
import Control.Applicative
import Control.Bool
import Control.Monad
import Control.Monad.IO.Class
import Control.Monad.Trans
import Data.BoundingBox
import Data.Color
import Data.Color.Names
import FreeGame.Backend.GLFW
import FreeGame.Class
import FreeGame.Data.Bitmap
import FreeGame.Data.Font
import FreeGame.Instances ()
import FreeGame.Text
import FreeGame.Types
import FreeGame.UI
import FreeGame.Util
import Linear
liftFrame :: Frame a -> Game a
liftFrame = Game . lift
runGameDefault :: Game a -> IO (Maybe a)
runGameDefault = runGame Windowed (Box (V2 0 0) (V2 640 480))