fwgl-0.1.2.0: FRP 2D/3D game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Graphics.Custom

Synopsis

Documentation

data Object gs is Source

An object is a set of geometries associated with some uniforms. For example, if you want to draw a rotating cube, its vertices, normals, etc. would be the Geometry, the combination of the geometry and the value of the model matrix would be the Object, and the combination of the object with a Program would be the Layer. In fact, Objects are just descriptions of the actions to perform to draw something. Instead, the Element types in FWGL.Graphics.D2 and FWGL.Graphics.D3 represent managed (high level) objects, and they are ultimately converted to them.

(~~) :: (Equal gs gs', Equal is is') => Object gs is -> Object gs' is' -> Object (Union gs gs') (Union is is') Source

Join two objects.

unsafeJoin :: (Equal gs'' (Union gs gs'), Equal is'' (Union is is')) => Object gs is -> Object gs' is' -> Object gs'' is'' Source

Join two objects, even if they don't provide the same variables.

nothing :: Object [] [] Source

An empty custom object.

static :: Geometry i -> Object [] i Source

A custom object with a specified Geometry.

data Program gs is Source

A vertex shader associated with a compatible fragment shader.

Instances

Eq (Program gs is) 
Hashable (Program gs is) 

program :: (ValidVertex vgs vis vos, Valid fgs vos [], Equal pgs (Union vgs fgs)) => VertexShader vgs vis vos -> FragmentShader fgs vos -> Program pgs vis Source

Create a Program from the shaders.

global :: (Typeable g, UniformCPU c g) => g -> c -> Object gs is -> Object (g : gs) is Source

Sets a global variable (uniform) of an object.

globalDraw :: (Typeable g, UniformCPU c g) => g -> Draw c -> Object gs is -> Object (g : gs) is Source

Sets a global (uniform) of an object using the Draw monad.

globalTexture :: (BackendIO, Typeable g, UniformCPU ActiveTexture g) => g -> Texture -> Object gs is -> Object (g : gs) is Source

Sets a global (uniform) of an object using a Texture.

globalTexSize :: (BackendIO, Typeable g, UniformCPU c g) => g -> Texture -> ((Int, Int) -> c) -> Object gs is -> Object (g : gs) is Source

Sets a global (uniform) of an object using the dimensions of a Texture.

data Layer Source

An object associated with a program. It can also be a layer included in another.

layer :: (Subset oi pi, Subset og pg) => Program pg pi -> Object og oi -> Layer Source

Associate an object with a program.

subLayer Source

Arguments

:: Int

Texture width.

-> Int

Texture height.

-> Layer

Layer to draw on a Texture.

-> (Texture -> [Layer])

Layer to draw on the screen.

-> Layer 

Use a Layer as a Texture on another.

data Geometry is Source

A set of attributes and indices.

Instances

data AttrList is where Source

Constructors

AttrListNil :: AttrList [] 
AttrListCons :: (Hashable c, AttributeCPU c g) => g -> [c] -> AttrList gs -> AttrList (g : gs) 

Instances

mkGeometry :: GLES => AttrList is -> [Word16] -> Geometry is Source

Create a custom Geometry.

data Texture Source

A texture.

mkTexture Source

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> [Color]

List of pixels

-> Texture 

Creates a Texture from a list of pixels.

textureURL Source

Arguments

:: String

URL

-> Texture 

Creates a Texture from an URL or a local file.

data Color Source

An RGBA 32-bit color.

Constructors

Color !Word8 !Word8 !Word8 !Word8 

colorTex :: GLES => Color -> Texture Source

Generate a 1x1 texture.