ombra-0.2.0.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Draw

Synopsis

Documentation

data DrawState Source #

The state of the Draw monad.

refDrawCtx :: GLES => Ctx -> Draw a -> IORef DrawState -> IO a Source #

Run a Draw action using an IORef and a context.

runDrawCtx Source #

Arguments

:: Ctx

Context (use the appropriate backend functions)

-> Draw a

Draw action

-> DrawState

State (create it with drawState)

-> IO (a, DrawState) 

evalDrawCtx :: Ctx -> Draw a -> DrawState -> IO a Source #

drawInit :: GLES => Draw () Source #

drawState Source #

Arguments

:: GLES 
=> Int

Viewport width

-> Int

Viewport height

-> IO DrawState 

Create a DrawState.

clearBuffers :: GLES => [Buffer] -> Draw () Source #

drawLayer :: GLES => Layer -> Draw () Source #

Draw a Layer.

removeGeometry :: GLES => Geometry is -> Draw () Source #

Manually delete a Geometry from the GPU (this is automatically done when the Geometry becomes unreachable). Note that if you try to draw it, it will be allocated again.

removeTexture :: GLES => Texture -> Draw () Source #

Manually delete a Texture from the GPU.

removeProgram :: GLES => Program gs is -> Draw () Source #

Manually delete a Program from the GPU.

resizeViewport Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> Draw () 

Viewport.

renderLayer :: GLES => 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.

gl :: GL a -> Draw a Source #

Perform a GL action in the Draw monad.