diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-04-07 15:07:27 +0200 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-04-07 15:07:27 +0200 |
commit | d6b28723a26151d8ac6cb195d4e2135b05fdac5a (patch) | |
tree | 3b70252d6384a1a4434364095c3b600118872307 /src/GLDriver.hs | |
parent | c0d2d54ea1687a80ff76fa032ad4dc89670d2988 (diff) | |
download | htanks-d6b28723a26151d8ac6cb195d4e2135b05fdac5a.tar htanks-d6b28723a26151d8ac6cb195d4e2135b05fdac5a.zip |
Use system sleep functions as threadDelay sleep to long without -threaded
Diffstat (limited to 'src/GLDriver.hs')
-rw-r--r-- | src/GLDriver.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/GLDriver.hs b/src/GLDriver.hs index 7340075..3d344ef 100644 --- a/src/GLDriver.hs +++ b/src/GLDriver.hs @@ -24,6 +24,8 @@ class Driver a where swapBuffers :: a -> IO () + usleep :: a -> Integer -> IO () + nextEvent :: a -> IO (a, Maybe SomeEvent) data SomeDriver = forall d. Driver d => SomeDriver d @@ -34,6 +36,7 @@ instance Driver SomeDriver where deinitGL (SomeDriver d) = deinitGL d swapBuffers (SomeDriver d) = swapBuffers d nextEvent (SomeDriver d) = nextEvent d >>= \(gl, ev) -> return (SomeDriver gl, ev) + usleep (SomeDriver d) = usleep d class (Typeable a, Show a) => Event a |