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

Safe HaskellNone
LanguageHaskell2010

FWGL.Graphics.Custom

Synopsis

Documentation

data Layer Source

An object associated with a program.

data Object gs is Source

An object is a set of geometries associated with some uniforms.

data AttrList is where Source

A set of attributes and indices.

Constructors

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

Instances

data Geometry is Source

Instances

data Texture Source

A texture.

data Color Source

An RGBA 32-bit color.

Constructors

Color !Word8 !Word8 !Word8 !Word8 

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

Join two objects.

program :: (Subset gs' gs, Subset gs'' gs, Subset os' os) => VertexShader gs' is os -> FragmentShader gs'' os' -> Program gs is Source

Create a Program from the shaders.

nothing :: Object [] [] Source

An empty custom object.

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

A custom object with a specified Geometry.

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

Sets a global (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.

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

Associate an object with a program.

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.

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

Create a custom Geometry.

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 (JavaScript only).

textureFile :: String -> Texture Source

Creates a Texture from a file (Desktop only).

colorTex :: GLES => Color -> Texture Source

Generate a 1x1 texture.