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.
- data WindowConfig = WindowConfig {}
- defaultWindowConfig :: WindowConfig
- startEngine :: Game a => WindowConfig -> a -> IO ()
- data Sinks = Sinks {
- mousePositionSinks :: Vector Float -> IO ()
- keyboardSinks :: Map Key (Bool -> IO ())
- mouseSinks :: Map MouseButton (Bool -> IO ())
- data Input = Input {}
- data InputContainer = InputContainer {}
- makeInputContainer :: IO InputContainer
- makeMousePositionCallback :: WindowConfig -> InputContainer -> MousePosCallback
- makeKeyboardCallback :: InputContainer -> KeyCallback
- makeMouseCallback :: InputContainer -> MouseButtonCallback
- type DeltaTime = Float
- class Game a where
Documentation
data WindowConfig Source
A datatype to configure the window settings when creating an OpenGL context
using
in the engine.startEngine
defaultWindowConfig :: WindowConfig Source
The default for WindowConfig
getWindowWidth = 640 getWindowHeight = 480 getWindowFullscreen = False getWindowResizeable = 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 wrapper around the sinks for the mouse position, the key states, and the mouse button states.
Sinks | |
|
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
data InputContainer Source
makeInputContainer :: IO InputContainer Source
Making an
filled with all necessary externals.InputContainer
makeMousePositionCallback :: WindowConfig -> InputContainer -> MousePosCallback Source
Creating a callback to update the mouse position's state.
makeKeyboardCallback :: InputContainer -> KeyCallback Source
Creating a callback to update the keyboard's states.
makeMouseCallback :: InputContainer -> MouseButtonCallback Source
Creating a callback to update the mouse buttons' states.