Safe Haskell | None |
---|---|
Language | Haskell2010 |
FRP.Spice
Description
This module re-exports the core elements of the library, along with all of the types housed within the library.
- module Graphics.UI.GLFW
- module Data.Map.Strict
- loadSpriteAsset :: FilePath -> LoadAssets
- bindColor :: Color -> Scene
- color4f :: Float -> Float -> Float -> Float -> Color
- color3f :: Float -> Float -> Float -> Color
- color4i :: Int -> Int -> Int -> Int -> Color
- color3i :: Int -> Int -> Int -> Color
- black :: Color
- white :: Color
- grey :: Color
- gray :: Color
- red :: Color
- green :: Color
- blue :: Color
- renderPoint :: Vector Float -> Scene
- renderLine :: Vector Float -> Vector Float -> Scene
- renderTriangle :: Vector Float -> Vector Float -> Vector Float -> Scene
- renderRectangle :: Vector Float -> Vector Float -> Scene
- renderSquare :: Vector Float -> Float -> Scene
- renderPolygon :: [Vector Float] -> Scene
- renderSprite :: Sprite -> Vector Float -> Scene
- renderSpriteWithSize :: Sprite -> Vector Float -> Vector Float -> Scene
- startEngine :: Game a => WindowConfig -> a -> IO ()
- startEngineDefault :: Game a => a -> IO ()
- data DoListT a b = DoListT a b
- type DoList a = DoListT a ()
- data WindowConfig = WindowConfig {}
- data Color = Color {
- colorRed :: Float
- colorGreen :: Float
- colorBlue :: Float
- colorAlpha :: Float
- data Vector a = Vector a a
- data Sinks = Sinks {
- mousePosSink :: Vector Float -> IO ()
- mouseButtonSink :: Map MouseButton (Bool -> IO ())
- keySink :: Map Key (Bool -> IO ())
- data Input = Input {}
- data InputContainer = InputContainer {}
- data Sprite = Sprite {}
- data LoadAsset = LoadSprite FilePath
- type LoadAssets = DoList [LoadAsset]
- data Assets = Assets {}
- type Scene = IO ()
- type DeltaTime = Float
- class Game a where
- update :: DeltaTime -> Input -> a -> a
- render :: Assets -> a -> Scene
- loadAssets :: a -> LoadAssets
- up :: Num a => Vector a
- right :: Num a => Vector a
- left :: Num a => Vector a
- down :: Num a => Vector a
- (^+) :: Num a => Vector a -> Vector a -> Vector a
- (^-) :: Num a => Vector a -> Vector a -> Vector a
- (^*) :: Num a => Vector a -> Vector a -> Vector a
- (^.) :: Num a => Vector a -> Vector a -> a
- (^+>) :: Num a => Vector a -> a -> Vector a
- (^->) :: Num a => Vector a -> a -> Vector a
- (^*>) :: Num a => Vector a -> a -> Vector a
- (^.>) :: Num a => Vector a -> a -> a
Documentation
module Graphics.UI.GLFW
module Data.Map.Strict
color3f :: Float -> Float -> Float -> Color Source
Constructing a color from 3
s, with the alpha channel defaulting to
its maximum (of 1.0).
Float
color3i :: Int -> Int -> Int -> Color Source
Constructing a color from 3
s, with the alpha channel defaulting to
its maximum (of 255).
Int
renderPoint :: Vector Float -> Scene Source
Rendering a position.
renderPolygon :: [Vector Float] -> Scene Source
Rendering a polygon of any n sides.
renderSpriteWithSize :: Sprite -> Vector Float -> Vector Float -> Scene Source
Rendering a
at the position specified with the size specified.
Sprite
startEngine :: Game a => WindowConfig -> a -> IO () Source
Starting the engine with window parameters described within the provided
.
WindowConfig
startEngineDefault :: Game a => a -> IO () Source
Starting the engine with default window parameter.
A data type that can be composed (so long as the data stored is a Monoid) in do-notation.
Constructors
DoListT a b |
data WindowConfig Source
The config that is used to define the GLFW window's properties.
Constructors
WindowConfig | |
Fields |
Instances
Default WindowConfig | The default state for a |
A data type representing a color as 4 floats (r, g, b, a) representing red, green, blue, and the alpha channel respectively. The floats should range from 0 to 1, representing 0 to 255 in more classical representations.
Constructors
Color | |
Fields
|
A data type that stores two values. It can be used to perform basic vector
logic. It should be noted that the
logic provided in this library
is not linear-algebra style vector logic.
Vector
Constructors
Vector a a |
A wrapper around the sinks for the mouse position, mouse buttons, and keyboard keys.
Constructors
Sinks | |
Fields
|
A data structure that represents the current state of the input. Used in the
along with the InputContainer
to handle all input -- updating
and referencing.
Sink
data InputContainer Source
Containing all of the necessary information for rendering an image on screen (aside from the position where the sprite should be rendered.)
Constructors
Sprite | |
Fields |
Representing the loading of an asset into the game framework.
Constructors
LoadSprite FilePath |
Storing the loaded assets in a single data structure.
A type synonym to imply that functions performed in this function should solely render.
A type synonym to make the delta time (in the
definition) more self
documenting.
Game
The requirements for a given data structure to be used as a game within the framework.
(^*) :: Num a => Vector a -> Vector a -> Vector a infixl 7 Source
Multiplying two
s (not a dot product, but rather multiplying the
first value in the first vector by the second value in the second vector,
and the same with with the second value.)
Vector