Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- myWindowConfig :: V2 CInt -> WindowConfig
- withWindow :: Text -> WindowConfig -> (Window -> IO a) -> IO a
- withRenderer :: MonadIO m => Window -> ((Window, Renderer) -> m a) -> m a
- apploop :: ResourcesT TVar -> TQueue Response -> Renderer -> a -> ([Response] -> [EventPayload] -> (Scancode -> Bool) -> a -> IO (Either [String] ([Request], a))) -> (a -> IO ()) -> IO a
- regulateFPS :: Word32 -> Word32 -> Word32 -> IO ()
- getJoystick :: IO (Maybe Joystick)
- setBGColor :: MonadIO m => V4 Word8 -> Renderer -> m Renderer
- collectEvents :: MonadIO m => m [EventPayload]
- checkEvent :: EventPayload -> [EventPayload] -> Bool
- isWindowHidden :: [EventPayload] -> Bool
- isWindowExposed :: [EventPayload] -> Bool
- data Resource
- data ResourceType a
- data Request
- = Load ![(String, ResourceType FilePath)]
- | DestroyTexture Texture
- | MakeText (String, FilePath) Text
- | PlayMusic (String, FilePath)
- | MuteMusic
- | UnmuteMusic
- data Response
- data ResourcesT f = Resources {}
- type family HKD f a where ...
- type Resources = ResourcesT Identity
- initResources :: IO (ResourcesT TVar)
- runRequest :: ResourcesT TVar -> TQueue Response -> Renderer -> Request -> IO ()
- loadResource :: (HKD f (Map FilePath Font) ~# TVar (Map [Char] Font), HKD f (Map FilePath Texture) ~# TVar (Map [Char] Texture), HKD f (Map FilePath ByteString) ~# TVar (Map [Char] ByteString)) => Renderer -> ResourcesT f -> (t, ResourceType [Char]) -> IO (t, Resource)
- resourcesToResponse :: [(String, Resource)] -> Response
Documentation
myWindowConfig :: V2 CInt -> WindowConfig Source #
Config window
withWindow :: Text -> WindowConfig -> (Window -> IO a) -> IO a Source #
Init SDL and create a Window and pass in as a parameter to function
apploop :: ResourcesT TVar -> TQueue Response -> Renderer -> a -> ([Response] -> [EventPayload] -> (Scancode -> Bool) -> a -> IO (Either [String] ([Request], a))) -> (a -> IO ()) -> IO a Source #
App loop: takes the current world and functions that updates the world renders it manage ticks, events and loop
collectEvents :: MonadIO m => m [EventPayload] Source #
Collect all events from inputs
checkEvent :: EventPayload -> [EventPayload] -> Bool Source #
Checks if specific event happend
isWindowHidden :: [EventPayload] -> Bool Source #
isWindowExposed :: [EventPayload] -> Bool Source #
data ResourcesT f Source #
type Resources = ResourcesT Identity Source #
initResources :: IO (ResourcesT TVar) Source #
runRequest :: ResourcesT TVar -> TQueue Response -> Renderer -> Request -> IO () Source #