SimpleGL-0.9.3: A Simple Graphics Library from the SimpleH framework.

Safe HaskellNone

SimpleH.GL

Contents

Synopsis

Documentation

module SimpleH

data V2 t Source

A two-element vector

Constructors

V2 !t !t 

data V3 t Source

A three-element vector

Constructors

V3 !t !t !t 

data V4 t Source

A three-element vector

Constructors

V4 !t !t !t !t 

Creating windows & Handling events

spawnWindow :: Title -> EventHandler -> IO ()Source

Create an OpenGL window and sinks all events into the given handler.

data KeyButtonState

Key or button state.

Constructors

Release 
Press 

data Size

A 2-dimensional size, measured in pixels.

Constructors

Size !GLsizei !GLsizei 

Instances

Examining and modifying the window

data GettableStateVar a

A concrete implementation of a read-only state variable, carrying an IO action to read the value.

data SettableStateVar a

A concrete implementation of a write-only state variable, carrying an IO action to write the new value.

Drawing the scene

type Scene t = [Widget t]Source

data Widget t Source

Constructors

Shape [ShapeProp] (Shape t) 
SubScene [Transform t] (Scene t) 

Instances

data Transform t Source

Constructors

Translate !t !t !t 
Rotate !t (V3 t) 
Zoom !t !t !t 

data Shape t Source

Constructors

Polygon [Vertex t] 

Instances

data ShapeProp Source

Constructors

Texture Texture 

Instances

data Vertex t Source

Constructors

Vertex [VertexProp t] !t !t !t 

Instances

data VertexProp t Source

Constructors

Color (V4 t) 
TexCoord (V2 t) 

Basic types

Utilities

Basic colors

white :: Num t => V4 tSource

black :: Num t => V4 tSource

grey :: Num t => t -> V4 tSource

gray :: Num t => t -> V4 tSource

red :: Num t => V4 tSource

green :: Num t => V4 tSource

blue :: Num t => V4 tSource

yellow :: (Num t, Semigroup t) => V4 tSource

magenta :: (Num t, Semigroup t) => V4 tSource

cyan :: (Num t, Semigroup t) => V4 tSource

Vertices

vert :: t -> t -> t -> Vertex tSource

cvert :: VertexProp t -> t -> t -> t -> Vertex tSource