diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-03-02 06:10:34 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-03-02 06:10:34 +0100 |
commit | d4db00ce9bce4410becfc4ee71264fc607b96c5b (patch) | |
tree | e8795cc2274714d652a58885b932499597f1826d /GLDriver.hs | |
parent | 6a381a238a10695c5efa79ac7e73818c33c3e1f6 (diff) | |
download | htanks-d4db00ce9bce4410becfc4ee71264fc607b96c5b.tar htanks-d4db00ce9bce4410becfc4ee71264fc607b96c5b.zip |
Implemented correct turning
Diffstat (limited to 'GLDriver.hs')
-rw-r--r-- | GLDriver.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/GLDriver.hs b/GLDriver.hs index 2b55c6f..44964d8 100644 --- a/GLDriver.hs +++ b/GLDriver.hs @@ -35,26 +35,28 @@ instance Driver SomeDriver where nextEvent (SomeDriver d) = nextEvent d -class Typeable a => Event a +class (Typeable a, Show a) => Event a data SomeEvent = forall a. Event a => SomeEvent a +instance Show SomeEvent where + show (SomeEvent a) = show a fromEvent :: Event a => SomeEvent -> Maybe a fromEvent (SomeEvent a) = cast a -data QuitEvent = QuitEvent deriving Typeable +data QuitEvent = QuitEvent deriving (Typeable, Show) instance Event QuitEvent -data ResizeEvent = ResizeEvent Int Int deriving Typeable +data ResizeEvent = ResizeEvent Int Int deriving (Typeable, Show) instance Event ResizeEvent data Key = KeyLeft | KeyRight | KeyUp | KeyDown deriving (Eq, Ord, Show) -data KeyPressEvent = KeyPressEvent Key deriving Typeable +data KeyPressEvent = KeyPressEvent Key deriving (Typeable, Show) instance Event KeyPressEvent -data KeyReleaseEvent = KeyReleaseEvent Key deriving Typeable +data KeyReleaseEvent = KeyReleaseEvent Key deriving (Typeable, Show) instance Event KeyReleaseEvent |