ombra-0.1.1.0: Render engine.

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Draw.Internal

Synopsis

Documentation

data Draw a Source #

A state monad on top of GL.

Instances

Monad Draw Source # 

Methods

(>>=) :: Draw a -> (a -> Draw b) -> Draw b #

(>>) :: Draw a -> Draw b -> Draw b #

return :: a -> Draw a #

fail :: String -> Draw a #

Functor Draw Source # 

Methods

fmap :: (a -> b) -> Draw a -> Draw b #

(<$) :: a -> Draw b -> Draw a #

Applicative Draw Source # 

Methods

pure :: a -> Draw a #

(<*>) :: Draw (a -> b) -> Draw a -> Draw b #

(*>) :: Draw a -> Draw b -> Draw b #

(<*) :: Draw a -> Draw b -> Draw a #

MonadIO Draw Source # 

Methods

liftIO :: IO a -> Draw a #

data DrawState Source #

The state of the Draw monad.

drawState Source #

Arguments

:: GLES 
=> Int

Viewport width

-> Int

Viewport height

-> IO DrawState 

Create a DrawState.

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

Draw a Layer.

drawGroup :: GLES => GroupState -> Group gs is -> Draw () Source #

Draw a Group.

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

Draw an Object.

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.

textureUniform :: GLES => Texture -> Draw ActiveTexture Source #

This helps you set the uniforms of type Sampler2D.

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

Get the dimensions of a Texture.

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

Set the program.

resizeViewport Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> Draw () 

Viewport.

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.

evalDraw Source #

Arguments

:: Draw a

Action.

-> DrawState

State.

-> GL a 

Evaluate a Draw action.

gl :: GL a -> Draw a Source #

Perform a GL action in the Draw monad.

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.

layerToTexture Source #

Arguments

:: (GLES, Integral a) 
=> Bool

Draw buffers

-> [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.