minilight-0.4.0: A SDL2-based graphics library, batteries-included.

Safe HaskellNone
LanguageHaskell2010

MiniLight

Contents

Description

MiniLight module exports all basic concepts and oprations except for concrete components.

Synopsis

Documentation

runLightT :: (MonadIO m, MonadMask m) => LightT LightEnv m a -> m a Source #

Run a Light monad.

data LoopConfig Source #

Use defConfig for a default setting.

Constructors

LoopConfig 

Fields

defConfig :: LoopConfig Source #

Default configurations for the mainloop. You need to set componentResolver if you use a component.

runMainloop Source #

Arguments

:: (HasLightEnv env, HasLightEnv env', HasLoopEnv env', HasLoaderEnv env', MonadIO m, MonadMask m) 
=> (env -> LoopEnv -> LoaderEnv -> env')

Environment conversion

-> LoopConfig

Loop config

-> s

Initial state

-> (s -> LightT env' m s)

A function called in every loop

-> LightT env m () 

Run a mainloop. In a mainloop, components and events are managed.

Components in a mainloop: draw ~ update ~ (user-defined function) ~ event handling

type MiniLoop = LightT LoopState IO Source #

Type synonym to the minimal type of the mainloop

runMiniloop :: LoopConfig -> s -> (s -> MiniLoop s) -> MiniLight () Source #

Same as runMainloop but fixing the type.

Orphan instances

Hashable Scancode Source # 
Instance details

Methods

hashWithSalt :: Int -> Scancode -> Int #

hash :: Scancode -> Int #