Use system sleep functions as threadDelay sleep to long without -threaded

This commit is contained in:
Matthias Schiffer 2010-04-07 15:07:27 +02:00
parent c0d2d54ea1
commit d6b28723a2
5 changed files with 17 additions and 4 deletions

View file

@ -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