| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Reflex.SDL2
Contents
Description
This module contains the bare minimum needed to get started writing reflex apps using sdl2.
For a tutorial see app/Main.hs
- data SystemEvents t = SystemEvents {
- sysPostBuildEvent :: Event t ()
- sysTicksEvent :: Event t Word32
- sysAnySDLEvent :: Event t EventPayload
- sysWindowShownEvent :: Event t WindowShownEventData
- sysWindowHiddenEvent :: Event t WindowHiddenEventData
- sysWindowExposedEvent :: Event t WindowExposedEventData
- sysWindowMovedEvent :: Event t WindowMovedEventData
- sysWindowResizedEvent :: Event t WindowResizedEventData
- sysWindowSizeChangedEvent :: Event t WindowSizeChangedEventData
- sysWindowMinimizedEvent :: Event t WindowMinimizedEventData
- sysWindowMaximizedEvent :: Event t WindowMaximizedEventData
- sysWindowRestoredEvent :: Event t WindowRestoredEventData
- sysWindowGainedMouseFocusEvent :: Event t WindowGainedMouseFocusEventData
- sysWindowLostMouseFocusEvent :: Event t WindowLostMouseFocusEventData
- sysWindowGainedKeyboardFocusEvent :: Event t WindowGainedKeyboardFocusEventData
- sysWindowLostKeyboardFocusEvent :: Event t WindowLostKeyboardFocusEventData
- sysWindowClosedEvent :: Event t WindowClosedEventData
- sysKeyboardEvent :: Event t KeyboardEventData
- sysTextEditingEvent :: Event t TextEditingEventData
- sysTextInputEvent :: Event t TextInputEventData
- sysKeymapChangedEvent :: Event t ()
- sysMouseMotionEvent :: Event t MouseMotionEventData
- sysMouseButtonEvent :: Event t MouseButtonEventData
- sysMouseWheelEvent :: Event t MouseWheelEventData
- sysJoyAxisEvent :: Event t JoyAxisEventData
- sysJoyBallEvent :: Event t JoyBallEventData
- sysJoyHatEvent :: Event t JoyHatEventData
- sysJoyButtonEvent :: Event t JoyButtonEventData
- sysJoyDeviceEvent :: Event t JoyDeviceEventData
- sysControllerAxisEvent :: Event t ControllerAxisEventData
- sysControllerButtonEvent :: Event t ControllerButtonEventData
- sysControllerDeviceEvent :: Event t ControllerDeviceEventData
- sysAudioDeviceEvent :: Event t AudioDeviceEventData
- sysQuitEvent :: Event t ()
- sysUserEvent :: Event t UserEventData
- sysSysWMEvent :: Event t SysWMEventData
- sysTouchFingerEvent :: Event t TouchFingerEventData
- sysMultiGestureEvent :: Event t MultiGestureEventData
- sysDollarGestureEvent :: Event t DollarGestureEventData
- sysDropEvent :: Event t DropEventData
- sysClipboardUpdateEvent :: Event t ()
- sysUnknownEvent :: Event t UnknownEventData
- host :: ReaderT (SystemEvents Spider) (PerformEventT Spider (SpiderHost Global)) a -> IO ()
- putDebugLnE :: (PerformEvent t m, Reflex t, MonadIO (Performable m)) => Event t a -> (a -> String) -> m ()
- type ReflexSDL2 t m = (Reflex t, MonadHold t m, PerformEvent t m, MonadFix m, MonadIO m, MonadIO (Performable m), MonadReader (SystemEvents t) m)
- module Reflex
- module SDL
- class Monad m => MonadReader r m | m -> r
- asks :: MonadReader r m => (r -> a) -> m a
- class Monad m => MonadIO m where
- liftIO :: MonadIO m => forall a. IO a -> m a
All SDL events, packaged into reflex events
data SystemEvents t Source #
Holds a slot of Event for each kind of SDL2 event plus a couple extras:
An event for *any* SDL2 event payload.
An event for reflex's post network build event.
An event for each frame tick.
Constructors
Running an app
Arguments
| :: ReaderT (SystemEvents Spider) (PerformEventT Spider (SpiderHost Global)) a | A concrete reflex-sdl2 network to run. |
| -> IO () |
Host a reflex-sdl2 app.
Debugging
Arguments
| :: (PerformEvent t m, Reflex t, MonadIO (Performable m)) | |
| => Event t a | The |
| -> (a -> String) | A function to show the |
| -> m () |
Convenience constraints
type ReflexSDL2 t m = (Reflex t, MonadHold t m, PerformEvent t m, MonadFix m, MonadIO m, MonadIO (Performable m), MonadReader (SystemEvents t) m) Source #
A collection of constraints that represent a reflex-sdl2 network.
Re-exports
module Reflex
module SDL
class Monad m => MonadReader r m | m -> r #
See examples in Control.Monad.Reader.
Note, the partially applied function type (->) r is a simple reader monad.
See the instance declaration below.
Instances
Arguments
| :: MonadReader r m | |
| => (r -> a) | The selector function to apply to the environment. |
| -> m a |
Retrieves a function of the current environment.
class Monad m => MonadIO m where #
Monads in which IO computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Minimal complete definition
Instances