-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | An FRP-based game engine written in Haskell. -- @package spice @version 0.3.3.2 -- | This module re-exports a number of modules having to do with math. module FRP.Spice.Math -- | A datatype that houses two values of a given type. It is provided with -- a Num instance so that, when used with number types it -- can function similarly (though not exactly) to a mathematical vector. data Vector a Vector :: a -> a -> Vector a -- | The default for the Vector. -- | Displaying the Vector. -- | Performs operations on the matching fields of the other -- Vector. -- | Maps over both values in the Vector. -- | Applicative instance for Vector. -- | Multiplying Vector by a scalar value. scalar :: Num a => Vector a -> a -> Vector a -- | This module re-exports a number of modules having to do with graphics. module FRP.Spice.Graphics -- | Rendering a point. renderPoint :: Vector Float -> Scene -- | Rendering a rectangle. renderRectangle :: Vector Float -> Vector Float -> Scene -- | Rendering a square. renderSquare :: Vector Float -> Float -> Scene -- | Representing a Color using four Float representing -- reg, green, blue, and the alpha mask respectively. The -- Floats are in a range from 0-1, representing -- Ints from 0-255. data Color Color :: Float -> Float -> Float -> Float -> Color getRed :: Color -> Float getGreen :: Color -> Float getBlue :: Color -> Float getAlpha :: Color -> Float -- | Converting a color to an action in a Scene. bindColor :: Color -> Scene -- | A synonym for the Color constructor. color4f :: Float -> Float -> Float -> Float -> Color -- | Constructing a Color from 3 Floats, -- defaulting the alpha mask to 1.0. color3f :: Float -> Float -> Float -> Color -- | Creating a Color from 4 Ints. The -- ints, similarly to color4f represent red, green, blue, -- and the alpha mask respectively. The ints should be in the range of -- 0-255. (Note: color4i is functionally equivalent (and -- also equivalent in source code) to calling color4f with each of its -- arguments divided by 255.) color4i :: Int -> Int -> Int -> Int -> Color -- | Constructing a Color from 3 Ints, -- defaulting the alpha mask to 255. color3i :: Int -> Int -> Int -> Color -- | The color black. black :: Color -- | The color white. white :: Color -- | The color red. red :: Color -- | The color green. green :: Color -- | The color blue. blue :: Color -- | A DoList to compose a list of Elements to render using -- do-notation. type Scene = DoList [Element] fromElements :: [Element] -> Scene renderScene :: Scene -> IO () -- | Converting a Float to a GLfloat togl :: Float -> GLfloat -- | This module re-exports some other modules in the spice library so that -- you needn't import all of them explicitly. module FRP.Spice -- | A datatype to configure the window settings when creating an OpenGL -- context using startEngine in the engine. data WindowConfig WindowConfig :: Int -> Int -> Bool -> String -> WindowConfig getWindowWidth :: WindowConfig -> Int getWindowHeight :: WindowConfig -> Int getWindowFullscreen :: WindowConfig -> Bool getWindowTitle :: WindowConfig -> String -- | The default for WindowConfig -- --
--   getWindowWidth      = 640
--   getWindowHeight     = 480
--   getWindowFullscreen = False
--   getWindowTitle      = "Spice Application"
--   
defaultWindowConfig :: WindowConfig -- | A default instance for WindowConfig. Equivalent to -- calling defaultWindowConfig. -- | Starting the spice engine with the parameters prescribed in the -- WindowConfig. It updates and renders the -- Game automatically so all you need to to is set up the -- WindowConfig and make a datatype with an instance of -- Game. startEngine :: Game a => WindowConfig -> a -> IO () -- | A container for all of the states themselves. It is used as a -- Signal Input in the -- InputContainer (which is necessary to use it within -- Elerea's FRP network). data Input Input :: Vector Float -> Map Key Bool -> Map MouseButton Bool -> Input mousePosition :: Input -> Vector Float keyboard :: Input -> Map Key Bool mouse :: Input -> Map MouseButton Bool -- | A synonym to make the update function more self-documenting. type DeltaTime = Float -- | The class which is to be used in the startEngine -- function. update provides the API to update on every -- tick (purely), an render provides the API to render -- every frame. class Game a update :: Game a => DeltaTime -> Input -> a -> a render :: Game a => a -> Scene