This repository has been archived on 2025-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
htanks/GLDriver.hs

26 lines
495 B
Haskell
Raw Normal View History

2010-02-22 16:50:42 +01:00
{-# 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