fwgl-0.1.3.0: Game engine

Safe HaskellNone
LanguageHaskell2010

FWGL.Graphics.Draw

Synopsis

Documentation

data Draw a Source

A state monad on top of GL.

data DrawState Source

The state of the Draw monad.

runDraw :: Draw a -> DrawState -> GL (a, DrawState) Source

Run a Draw action.

execDraw Source

Arguments

:: Draw a

Action.

-> DrawState

State.

-> GL DrawState 

Execute a Draw action.

drawInit Source

Arguments

:: (BackendIO, GLES) 
=> Int

Viewport width

-> Int

Viewport height

-> Canvas

Canvas

-> GL DrawState 

Create a DrawState.

drawBegin :: GLES => Draw () Source

Clear the buffers.

drawLayer :: (GLES, BackendIO) => Layer -> Draw () Source

Draw a Layer.

drawGroup :: (GLES, BackendIO) => Group gs is -> Draw () Source

Draw a Group.

drawObject :: (GLES, BackendIO) => Object gs is -> Draw () Source

Draw an Object.

removeGeometry :: (GLES, BackendIO) => Geometry is -> Draw Bool Source

Delete a Geometry from the GPU.

removeTexture :: BackendIO => Texture -> Draw Bool Source

Delete a Texture from the GPU.

removeProgram :: (GLES, BackendIO) => Program gs is -> Draw Bool Source

Delete a Program from the GPU.

textureUniform :: (GLES, BackendIO) => Texture -> Draw ActiveTexture Source

This helps you set the uniforms of type Sampler2D.

textureSize :: (GLES, BackendIO, Num a) => Texture -> Draw (a, a) Source

Get the dimensions of a Texture.

setProgram :: (GLES, BackendIO) => Program g i -> Draw () Source

Set the program.

resizeViewport Source

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> Draw () 

Viewport.

gl :: GL a -> Draw a Source

Perform a GL action in the Draw monad.

renderLayer :: BackendIO => RenderLayer a -> Draw (a, [Texture]) Source

Realize a RenderLayer. It returns the list of allocated Textures so that you can free them if you want.

layerToTexture Source

Arguments

:: (GLES, BackendIO, Integral a) 
=> [LayerType]

Textures contents.

-> a

Width

-> a

Height

-> Layer

Layer to draw

-> Either b ([Color] -> Draw b, Int, Int, Int, Int)

Color inspecting function, start x, start y, width, height

-> Either c ([Word8] -> Draw c, Int, Int, Int, Int)

Depth inspecting, function, etc.

-> Draw ([Texture], b, c) 

Draw a Layer on some textures.