Safe Haskell | None |
---|---|
Language | Haskell2010 |
Text frontend based on SDL2.
Synopsis
- startup :: ClientOptions -> IO RawFrontend
- frontendName :: String
- type FontAtlas = EnumMap AttrCharW32 Texture
- data FrontendSession = FrontendSession {}
- startupFun :: ClientOptions -> MVar RawFrontend -> IO ()
- shutdown :: FrontendSession -> IO ()
- forceShutdown :: FrontendSession -> IO ()
- display :: FrontendSession -> SingleFrame -> IO ()
- drawFrame :: ClientOptions -> FrontendSession -> SingleFrame -> IO ()
- printScreen :: FrontendSession -> IO ()
- modTranslate :: KeyModifier -> Modifier
- keyTranslate :: Bool -> Keycode -> Key
- colorToRGBA :: Color -> V4 Word8
Documentation
startup :: ClientOptions -> IO RawFrontend Source #
Set up and start the main loop providing input and output.
Apparently some SDL backends are not thread-safe (https://wiki.libsdl.org/FAQDevelopment; "this should only be run in the thread that initialized the video subsystem, and for extra safety, you should consider only doing those things on the main thread in any case") so we stick to a single bound thread (but not to the main thread; enough is enough and at least in the case of OpenGL all bound threads are supposed to be as good as the main thread).
frontendName :: String Source #
The name of the frontend.
Internal operations
data FrontendSession Source #
Session data maintained by the frontend.
FrontendSession | |
|
startupFun :: ClientOptions -> MVar RawFrontend -> IO () Source #
shutdown :: FrontendSession -> IO () Source #
forceShutdown :: FrontendSession -> IO () Source #
:: FrontendSession | frontend session data |
-> SingleFrame | the screen frame to draw |
-> IO () |
Add a frame to be drawn.
:: ClientOptions | |
-> FrontendSession | frontend session data |
-> SingleFrame | the screen frame to draw |
-> IO () |
printScreen :: FrontendSession -> IO () Source #
modTranslate :: KeyModifier -> Modifier Source #
Translates modifiers to our own encoding, ignoring Shift.