gore-and-ash-sdl-2.1.1.0: Gore&Ash core module for integration with SDL library

Copyright(c) Anton Gushcha, 2015-2016
LicenseBSD3
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Game.GoreAndAsh.SDL.State

Contents

Description

 

Synopsis

Documentation

data SDLState s Source #

Inner state of SDL module.

s
- State of next module, the states are chained via nesting.

Constructors

SDLState 

Fields

Instances

Generic (SDLState s) Source # 

Associated Types

type Rep (SDLState s) :: * -> * #

Methods

from :: SDLState s -> Rep (SDLState s) x #

to :: Rep (SDLState s) x -> SDLState s #

NFData s => NFData (SDLState s) Source # 

Methods

rnf :: SDLState s -> () #

Monad m => MonadState (SDLState s) (SDLT s m) 

Methods

get :: SDLT s m (SDLState s)

put :: SDLState s -> SDLT s m ()

state :: (SDLState s -> (a, SDLState s)) -> SDLT s m a

type Rep (SDLState s) Source # 
type Rep (SDLState s) = D1 (MetaData "SDLState" "Game.GoreAndAsh.SDL.State" "gore-and-ash-sdl-2.1.1.0-KphxcxP57zE2taVj4mp3mt" False) (C1 (MetaCons "SDLState" PrefixI True) ((:*:) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlNextState") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 s)) (S1 (MetaSel (Just Symbol "sdlWindows") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (HashMap WindowName WindowInfo)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowShownEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowShownEventData))) (S1 (MetaSel (Just Symbol "sdlWindowHiddenEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowHiddenEventData))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowExposedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowExposedEventData))) (S1 (MetaSel (Just Symbol "sdlWindowMovedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowMovedEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowResizedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowResizedEventData))) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowSizeChangedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowSizeChangedEventData))) (S1 (MetaSel (Just Symbol "sdlWindowMinimizedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowMinimizedEventData))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowMaximizedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowMaximizedEventData))) (S1 (MetaSel (Just Symbol "sdlWindowRestoredEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowRestoredEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowGainedMouseFocusEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowGainedMouseFocusEventData))) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowLostMouseFocusEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowLostMouseFocusEventData))) (S1 (MetaSel (Just Symbol "sdlWindowGainedKeyboardFocusEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowGainedKeyboardFocusEventData)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlWindowLostKeyboardFocusEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowLostKeyboardFocusEventData))) (S1 (MetaSel (Just Symbol "sdlWindowClosedEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq WindowClosedEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlKeyboardEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq KeyboardEventData))) ((:*:) (S1 (MetaSel (Just Symbol "sdlTextEditingEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq TextEditingEventData))) (S1 (MetaSel (Just Symbol "sdlTextInputEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq TextInputEventData)))))))) ((:*:) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlMouseMotionEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq MouseMotionEventData))) (S1 (MetaSel (Just Symbol "sdlMouseButtonEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq MouseButtonEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlMouseWheelEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq MouseWheelEventData))) (S1 (MetaSel (Just Symbol "sdlJoyAxisEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq JoyAxisEventData))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlJoyBallEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq JoyBallEventData))) (S1 (MetaSel (Just Symbol "sdlJoyHatEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq JoyHatEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlJoyButtonEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq JoyButtonEventData))) ((:*:) (S1 (MetaSel (Just Symbol "sdlJoyDeviceEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq JoyDeviceEventData))) (S1 (MetaSel (Just Symbol "sdlControllerAxisEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq ControllerAxisEventData))))))) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlControllerButtonEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq ControllerButtonEventData))) (S1 (MetaSel (Just Symbol "sdlControllerDeviceEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq ControllerDeviceEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlQuitEvent") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool)) ((:*:) (S1 (MetaSel (Just Symbol "sdlUserEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq UserEventData))) (S1 (MetaSel (Just Symbol "sdlSysWMEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq SysWMEventData)))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "sdlTouchFingerEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq TouchFingerEventData))) (S1 (MetaSel (Just Symbol "sdlMultiGestureEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq MultiGestureEventData)))) ((:*:) (S1 (MetaSel (Just Symbol "sdlDollarGestureEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq DollarGestureEventData))) ((:*:) (S1 (MetaSel (Just Symbol "sdlDropEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq DropEventData))) (S1 (MetaSel (Just Symbol "sdlClipboardUpdateEvents") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Seq ClipboardUpdateEventData))))))))))

type WindowName = Text Source #

Windows are uniquely identified by names

data WindowInfo Source #

Context of window

Constructors

WindowInfo 

Fields

Instances

Generic WindowInfo Source # 

Associated Types

type Rep WindowInfo :: * -> * #

NFData WindowInfo Source # 

Methods

rnf :: WindowInfo -> () #

type Rep WindowInfo Source # 
type Rep WindowInfo = D1 (MetaData "WindowInfo" "Game.GoreAndAsh.SDL.State" "gore-and-ash-sdl-2.1.1.0-KphxcxP57zE2taVj4mp3mt" False) (C1 (MetaCons "WindowInfo" PrefixI True) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "winfoWindow") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Window)) (S1 (MetaSel (Just Symbol "winfoRenderer") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Renderer))) ((:*:) (S1 (MetaSel (Just Symbol "winfoColor") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe (V4 Word8)))) (S1 (MetaSel (Just Symbol "winfoContext") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe GLContext))))))

emptySDLState :: s -> SDLState s Source #

Creates empty module state

flashSDLState :: SDLState s -> SDLState s Source #

After full cycle of simulation all events are dropped

Helpers

whenJust :: Monad m => Maybe a -> (a -> m ()) -> m () Source #

Helper to trigger action when value is Just

Orphan instances

NFData MouseDevice Source # 

Methods

rnf :: MouseDevice -> () #

NFData Keysym Source # 

Methods

rnf :: Keysym -> () #

NFData Window Source # 

Methods

rnf :: Window -> () #

NFData MouseButton Source # 

Methods

rnf :: MouseButton -> () #

NFData WindowSizeChangedEventData Source # 

Methods

rnf :: WindowSizeChangedEventData -> () #

NFData WindowShownEventData Source # 

Methods

rnf :: WindowShownEventData -> () #

NFData WindowRestoredEventData Source # 

Methods

rnf :: WindowRestoredEventData -> () #

NFData WindowResizedEventData Source # 

Methods

rnf :: WindowResizedEventData -> () #

NFData WindowMovedEventData Source # 

Methods

rnf :: WindowMovedEventData -> () #

NFData WindowMinimizedEventData Source # 

Methods

rnf :: WindowMinimizedEventData -> () #

NFData WindowMaximizedEventData Source # 

Methods

rnf :: WindowMaximizedEventData -> () #

NFData WindowLostMouseFocusEventData Source # 

Methods

rnf :: WindowLostMouseFocusEventData -> () #

NFData WindowLostKeyboardFocusEventData Source # 

Methods

rnf :: WindowLostKeyboardFocusEventData -> () #

NFData WindowHiddenEventData Source # 

Methods

rnf :: WindowHiddenEventData -> () #

NFData WindowGainedMouseFocusEventData Source # 

Methods

rnf :: WindowGainedMouseFocusEventData -> () #

NFData WindowGainedKeyboardFocusEventData Source # 

Methods

rnf :: WindowGainedKeyboardFocusEventData -> () #

NFData WindowExposedEventData Source # 

Methods

rnf :: WindowExposedEventData -> () #

NFData WindowClosedEventData Source # 

Methods

rnf :: WindowClosedEventData -> () #

NFData UserEventData Source # 

Methods

rnf :: UserEventData -> () #

NFData TouchFingerEventData Source # 

Methods

rnf :: TouchFingerEventData -> () #

NFData TextInputEventData Source # 

Methods

rnf :: TextInputEventData -> () #

NFData TextEditingEventData Source # 

Methods

rnf :: TextEditingEventData -> () #

NFData SysWMEventData Source # 

Methods

rnf :: SysWMEventData -> () #

NFData MultiGestureEventData Source # 

Methods

rnf :: MultiGestureEventData -> () #

NFData MouseWheelEventData Source # 

Methods

rnf :: MouseWheelEventData -> () #

NFData MouseMotionEventData Source # 

Methods

rnf :: MouseMotionEventData -> () #

NFData MouseButtonEventData Source # 

Methods

rnf :: MouseButtonEventData -> () #

NFData KeyboardEventData Source # 

Methods

rnf :: KeyboardEventData -> () #

NFData JoyHatEventData Source # 

Methods

rnf :: JoyHatEventData -> () #

NFData JoyDeviceEventData Source # 

Methods

rnf :: JoyDeviceEventData -> () #

NFData JoyButtonEventData Source # 

Methods

rnf :: JoyButtonEventData -> () #

NFData JoyBallEventData Source # 

Methods

rnf :: JoyBallEventData -> () #

NFData JoyAxisEventData Source # 

Methods

rnf :: JoyAxisEventData -> () #

NFData InputMotion Source # 

Methods

rnf :: InputMotion -> () #

NFData DropEventData Source # 

Methods

rnf :: DropEventData -> () #

NFData DollarGestureEventData Source # 

Methods

rnf :: DollarGestureEventData -> () #

NFData ControllerDeviceEventData Source # 

Methods

rnf :: ControllerDeviceEventData -> () #

NFData ControllerButtonEventData Source # 

Methods

rnf :: ControllerButtonEventData -> () #

NFData ControllerAxisEventData Source # 

Methods

rnf :: ControllerAxisEventData -> () #

NFData ClipboardUpdateEventData Source # 

Methods

rnf :: ClipboardUpdateEventData -> () #

NFData Scancode Source # 

Methods

rnf :: Scancode -> () #

NFData Keycode Source # 

Methods

rnf :: Keycode -> () #

NFData KeyModifier Source # 

Methods

rnf :: KeyModifier -> () #

NFData Renderer Source # 

Methods

rnf :: Renderer -> () #

NFData GLContext Source # 

Methods

rnf :: GLContext -> () #