spice-0.2.0.0: An FRP-based game engine written in Haskell.

Safe HaskellNone
LanguageHaskell2010

FRP.Spice.Graphics

Description

This module re-exports a number of modules having to do with graphics.

Synopsis

Documentation

renderPoint :: Vector Float -> Scene Source

Rendering a point.

renderRectangle :: Vector Float -> Vector Float -> Scene Source

Rendering a rectangle.

renderSquare :: Vector Float -> Float -> Scene Source

Rendering a square.

data Color Source

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.

Constructors

Color 

Instances

bindColor :: Color -> IO () Source

Changes the current OpenGL context's rendering color to the Color specified.

color4f :: Float -> Float -> Float -> Float -> Color Source

A synonym for the Color constructor.

color3f :: Float -> Float -> Float -> Color Source

Constructing a Color from 3 Floats, defaulting the alpha mask to 1.0.

color4i :: Int -> Int -> Int -> Int -> Color Source

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.)

color3i :: Int -> Int -> Int -> Color Source

Constructing a Color from 3 Ints, defaulting the alpha mask to 255.

black :: Color Source

The color black.

white :: Color Source

The color white.

red :: Color Source

The color red.

green :: Color Source

The color green.

blue :: Color Source

The color blue.

data Element Source

Purely specifying the rendering behavior of a single element. To be composed into Scenes for a full rendering effect.

data SceneT a Source

For composing a scene out of a set of elements.

Constructors

SceneT [Element] a 

Instances

Monad SceneT

Used for being able to compose Scenes in a do-notation. Not very useful outside of that.

Functor SceneT

Functor instance to satisfy applicative instance.

Applicative SceneT

Applicative instance to satisfy the monad instance. Not advised to use

type Scene = SceneT () Source

The commonly used instance of SceneT

renderElement :: Element -> IO () Source

Rendering a single Element.

fromElements :: [Element] -> Scene Source

Constructing a SceneT from a list of elements.

renderScene :: Scene -> IO () Source

Rendering a whole Scene (renders each Element from first in list to last in list.)

togl :: Float -> GLfloat Source

Converting a Float to a GLfloat