diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-03-05 04:38:31 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-03-05 04:38:31 +0100 |
commit | 0fb75af68220527fb10ab0ce39e35f61cba67e4c (patch) | |
tree | 6bc7dd114daa0b74cb7d25743741de90dfc5a768 /GLDriver.hs | |
parent | 1020310190063279b7951e44d8ae21fe3a623aa3 (diff) | |
download | htanks-0fb75af68220527fb10ab0ce39e35f61cba67e4c.tar htanks-0fb75af68220527fb10ab0ce39e35f61cba67e4c.zip |
Aim with mouse in DefaultPlayer
Diffstat (limited to 'GLDriver.hs')
-rw-r--r-- | GLDriver.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/GLDriver.hs b/GLDriver.hs index f4dca5e..ce84563 100644 --- a/GLDriver.hs +++ b/GLDriver.hs @@ -6,10 +6,10 @@ module GLDriver ( Driver(..) , SomeEvent(..) , fromEvent , QuitEvent(..) - --, ResizeEvent(..) , Key(..) , KeyPressEvent(..) , KeyReleaseEvent(..) + , MouseMotionEvent(..) ) where import Data.Typeable @@ -23,7 +23,7 @@ class Driver a where swapBuffers :: a -> IO () - nextEvent :: a -> IO (Maybe SomeEvent) + nextEvent :: a -> IO (a, Maybe SomeEvent) data SomeDriver = forall d. Driver d => SomeDriver d @@ -32,7 +32,7 @@ instance Driver SomeDriver where initGL (SomeDriver d) = initGL d >>= return . SomeDriver deinitGL (SomeDriver d) = deinitGL d swapBuffers (SomeDriver d) = swapBuffers d - nextEvent (SomeDriver d) = nextEvent d + nextEvent (SomeDriver d) = nextEvent d >>= \(gl, ev) -> return (SomeDriver gl, ev) class (Typeable a, Show a) => Event a @@ -57,3 +57,7 @@ instance Event KeyPressEvent data KeyReleaseEvent = KeyReleaseEvent Key deriving (Typeable, Show) instance Event KeyReleaseEvent + + +data MouseMotionEvent = MouseMotionEvent Float Float deriving (Typeable, Show) +instance Event MouseMotionEvent
\ No newline at end of file |