sdl2-2.5.5.1: Both high- and low-level bindings to the SDL library (version 2.0.6+).

Safe Haskell | None
Language | Haskell2010

SDL.Init

Synopsis

- initialize :: (Foldable f, Functor m, MonadIO m) => f InitFlag -> m ()
- initializeAll :: (Functor m, MonadIO m) => m ()
- data InitFlag
  - = InitTimer
  - | InitAudio
  - | InitVideo
  - | InitJoystick
  - | InitHaptic
  - | InitGameController
  - | InitEvents
- quit :: MonadIO m => m ()
- version :: (Integral a, MonadIO m) => m (a, a, a)

# Documentation

initialize :: (Foldable f, Functor m, MonadIO m) => f InitFlag -> m () Source #

Initializes SDL and the given subsystems. Do not call any SDL functions prior to this one, unless otherwise documented that you may do so.

You may call this function again with additional subsystems to initialize.

Throws `SDLException` if initialization fails.

initializeAll :: (Functor m, MonadIO m) => m () Source #

Equivalent to ``initialize` [`minBound` .. `maxBound`]`.

data InitFlag Source #

Constructors

InitTimer |
InitAudio |
InitVideo |
InitJoystick |
InitHaptic |
InitGameController |
InitEvents |

#### Instances

Instances details

Data InitFlag Source # |

Instance details

Defined in SDL.Init

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> InitFlag -> c InitFlag Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c InitFlag Source #

toConstr :: InitFlag -> Constr Source #

dataTypeOf :: InitFlag -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c InitFlag) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c InitFlag) Source #

gmapT :: (forall b. Data b => b -> b) -> InitFlag -> InitFlag Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> InitFlag -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> InitFlag -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> InitFlag -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> InitFlag -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> InitFlag -> m InitFlag Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> InitFlag -> m InitFlag Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> InitFlag -> m InitFlag Source #

Bounded InitFlag Source # |
Instance details Defined in SDL.Init Methods minBound :: InitFlag Source # maxBound :: InitFlag Source #
Enum InitFlag Source # |

Instance details

Defined in SDL.Init

Methods

succ :: InitFlag -> InitFlag Source #

pred :: InitFlag -> InitFlag Source #

toEnum :: Int -> InitFlag Source #

fromEnum :: InitFlag -> Int Source #

enumFrom :: InitFlag -> [InitFlag] Source #

enumFromThen :: InitFlag -> InitFlag -> [InitFlag] Source #

enumFromTo :: InitFlag -> InitFlag -> [InitFlag] Source #

enumFromThenTo :: InitFlag -> InitFlag -> InitFlag -> [InitFlag] Source #

Generic InitFlag Source # |

Instance details

Defined in SDL.Init

Associated Types

type Rep InitFlag |

Instance details

Defined in SDL.Init

type Rep InitFlag = D1 ('MetaData "InitFlag" "SDL.Init" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) ((C1 ('MetaCons "InitTimer" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InitAudio" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitVideo" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "InitJoystick" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitHaptic" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InitGameController" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitEvents" 'PrefixI 'False) (U1 :: Type -> Type))))

Methods

from :: InitFlag -> Rep InitFlag x Source #

to :: Rep InitFlag x -> InitFlag Source #

Read InitFlag Source # |
Instance details Defined in SDL.Init Methods readsPrec :: Int -> ReadS InitFlag Source # readList :: ReadS [InitFlag] Source # readPrec :: ReadPrec InitFlag Source # readListPrec :: ReadPrec [InitFlag] Source #
Show InitFlag Source # |
Instance details Defined in SDL.Init Methods showsPrec :: Int -> InitFlag -> ShowS Source # show :: InitFlag -> String Source # showList :: [InitFlag] -> ShowS Source #
Eq InitFlag Source # |
Instance details Defined in SDL.Init Methods (==) :: InitFlag -> InitFlag -> Bool Source # (/=) :: InitFlag -> InitFlag -> Bool Source #
Ord InitFlag Source # |
Instance details Defined in SDL.Init Methods compare :: InitFlag -> InitFlag -> Ordering Source # (<) :: InitFlag -> InitFlag -> Bool Source # (<=) :: InitFlag -> InitFlag -> Bool Source # (>) :: InitFlag -> InitFlag -> Bool Source # (>=) :: InitFlag -> InitFlag -> Bool Source # max :: InitFlag -> InitFlag -> InitFlag Source # min :: InitFlag -> InitFlag -> InitFlag Source #
ToNumber InitFlag Word32 Source # |
Instance details Defined in SDL.Init Methods toNumber :: InitFlag -> Word32 Source #
type Rep InitFlag Source # |

Instance details

Defined in SDL.Init

type Rep InitFlag = D1 ('MetaData "InitFlag" "SDL.Init" "sdl2-2.5.5.1-AgF6e4ywebPJjPO67cQCnV" 'False) ((C1 ('MetaCons "InitTimer" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "InitAudio" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitVideo" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "InitJoystick" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitHaptic" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "InitGameController" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "InitEvents" 'PrefixI 'False) (U1 :: Type -> Type))))

quit :: MonadIO m => m () Source #

Quit and shutdown SDL, freeing any resources that may have been in use. Do not call any SDL functions after you've called this function, unless otherwise documented that you may do so.

version :: (Integral a, MonadIO m) => m (a, a, a) Source #

The major, minor, and patch versions of the SDL library linked with. Does not require initialization.