Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module re-exports some other modules in the spice library so that you needn't import all of them explicitly.
- module Graphics.UI.GLFW
- module Data.Map.Strict
- data LoadAsset = LoadSprite FilePath
- type LoadAssets = DoList [LoadAsset]
- data Assets = Assets {}
- defaultAssets :: Assets
- appendSprite :: Assets -> FilePath -> Sprite -> Assets
- performAssetLoads :: LoadAssets -> IO Assets
- loadSpriteAsset :: FilePath -> LoadAssets
- data WindowConfig = WindowConfig {}
- defaultWindowConfig :: WindowConfig
- startEngine :: Game a => WindowConfig -> a -> IO ()
- data Input = Input {}
- type DeltaTime = Float
- class Game a where
- update :: DeltaTime -> Input -> a -> a
- render :: Assets -> a -> Scene
- loadAssets :: a -> LoadAssets
Documentation
module Graphics.UI.GLFW
module Data.Map.Strict
type LoadAssets = DoList [LoadAsset] Source
A list of
that may be composed in do-notation.
LoadAssets
The data structure that contains the loaded assets.
Default Assets | A synonym for |
defaultAssets :: Assets Source
The default state for the
data type. Used as the initial state for
Assets
.
performAssetLoads
performAssetLoads :: LoadAssets -> IO Assets Source
Performing the actual loading upon a
.
LoadAssets
loadSpriteAsset :: FilePath -> LoadAssets Source
Loading a
asset.
Sprite
data WindowConfig Source
A datatype to configure the window settings when creating an OpenGL context
using
in the engine.
startEngine
Eq WindowConfig | |
Read WindowConfig | |
Show WindowConfig | |
Default WindowConfig | A default instance for |
defaultWindowConfig :: WindowConfig Source
The default for WindowConfig
getWindowWidth = 640 getWindowHeight = 480 getWindowFullscreen = False getWindowTitle = "Spice Application"
startEngine :: Game a => WindowConfig -> a -> IO () Source
Starting the spice engine with the parameters prescribed in the
. It updates and renders the WindowConfig
automatically so all
you need to to is set up the Game
and make a datatype with an
instance of WindowConfig
.
Game
A container for all of the states themselves. It is used as a Signal
in the Input
(which is necessary to use it within
Elerea's FRP network).
InputContainer
The class which is to be used in the
function. startEngine
provides the API to update on every tick (purely), an
update
provides the API to render every frame.
render