spice-0.3.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

newtype Render Source

A container around IO to suggest that one should perform rendering in a rendering function.

Constructors

Render (IO ()) 

runRender :: Render -> IO () Source

Performing the IO contained in a Render.

class Renderable a where Source

A class that provides an API to convert a datatype into a Render.

Methods

toRender :: a -> Render Source

Instances

Renderable Color

Changing the current OpenGL context's Color4 to whatever Color specified.

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

Eq Color 
Read Color 
Show Color 
Renderable Color

Changing the current OpenGL context's Color4 to whatever Color specified.

color4f :: Float -> Float -> Float -> Float -> Scene Source

A synonym for the Color constructor.

color3f :: Float -> Float -> Float -> Scene Source

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

color4i :: Int -> Int -> Int -> Int -> Scene 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 -> Scene Source

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

black :: Scene Source

The color black.

white :: Scene Source

The color white.

red :: Scene Source

The color red.

green :: Scene Source

The color green.

blue :: Scene Source

The color blue.

type Scene = SceneT () Source

The commonly used instance of SceneT

fromRenderables :: Renderable a => [a] -> Scene Source

Constructing a SceneT from a list of renderables.

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