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

renderLine :: Vector Float -> Vector Float -> Scene Source

Rendering a line between two points.

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

Rendering a rectangle.

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

Rendering a square.

renderTriangle :: Vector Float -> Vector Float -> Vector Float -> Scene Source

Rendering a triangle.

renderPolygon :: [Vector Float] -> Scene Source

Rendering a polygon with 1-N vertecies.

data Sprite Source

A datatype to represent a TextureObject through a reference to the TextureObject itself and its Size.

Constructors

Sprite 

renderSprite :: Sprite -> Vector Float -> Scene Source

Performing an OpenGL call to render the Sprite.

loadSprite :: FilePath -> IO Sprite Source

Loading a Sprite from a file.

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 -> Scene Source

Converting a color to an action in a Scene.

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.

type Scene = IO () Source

A type synonym for a single IO () call to suggest that users should be *rendering* in render calls, and not performing other IO.

togl :: Float -> GLfloat Source

Converting a Float to a GLfloat

fromgl :: GLfloat -> Float Source

Converting a GLfloat to a Float.