diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-02-22 16:50:42 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-02-22 16:50:42 +0100 |
commit | 62fe58cb55a279c285980a313d4355d91e93601c (patch) | |
tree | 7e318f4b62c7f90b0fad5e267ec9c3194fae53c7 /GLDriver.hs | |
download | htanks-62fe58cb55a279c285980a313d4355d91e93601c.tar htanks-62fe58cb55a279c285980a313d4355d91e93601c.zip |
Initial commit
Diffstat (limited to 'GLDriver.hs')
-rw-r--r-- | GLDriver.hs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/GLDriver.hs b/GLDriver.hs new file mode 100644 index 0000000..e527d09 --- /dev/null +++ b/GLDriver.hs @@ -0,0 +1,25 @@ +{-# LANGUAGE ExistentialQuantification #-} + +module GLDriver ( GLDriver(..) + , Event + , SomeEvent(..) + ) where + +import Data.Typeable + + +class GLDriver a where + initialized :: a -> Bool + + initGL :: a -> IO a + deinitGL :: a -> IO () + + nextEvent :: a -> IO (Maybe SomeEvent) + + +class Typeable a => Event a + +data SomeEvent = forall a. Event a => SomeEvent a + +fromEvent :: Event a => SomeEvent -> Maybe a +fromEvent (SomeEvent a) = cast a |