luminance-0.2: Type-safe, dependently-typed and stateless graphics framework

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Luminance.Vertex

Contents

Description

 

Synopsis

Vertex components

data V :: Nat -> * -> * where Source

Constructors

V1 :: !a -> V 1 a 
V2 :: !a -> !a -> V 2 a 
V3 :: !a -> !a -> !a -> V 3 a 
V4 :: !a -> !a -> !a -> !a -> V 4 a 

Instances

(KnownNat n, Storable a, VertexAttribute * a) => Vertex * (V n a) Source 
Storable a => Storable (V 1 a) Source 
Storable a => Storable (V 2 a) Source 
Storable a => Storable (V 3 a) Source 
Storable a => Storable (V 4 a) Source 

class VertexAttribute a Source

A vertex might have several attributes. The types of those attributes have to implement the VertexAttribute typeclass in order to be used as vertex attributes.

Minimal complete definition

vertexGLType

Vertex

class Vertex v Source

A vertex has to implement Vertex in order to be used as-is. That typeclass is closed, so you you cannot add anymore instances. However, you shouldn’t need to since you can use the already provided types to build up your vertex type.

Minimal complete definition

setFormatV

Instances

(Vertex * a, Vertex * b) => Vertex * ((:.) a b) Source 
(KnownNat n, Storable a, VertexAttribute * a) => Vertex * (V n a) Source