luminance-0.6.0.5: Type-safe, type-level and stateless graphics framework

Copyright(C) 2015 Dimitri Sabadie
LicenseBSD3
MaintainerDimitri Sabadie <dimitri.sabadie@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Luminance.RenderCmd

Contents

Description

 

Synopsis

Render commands

data RenderCmd rw c d u a Source

A GPU render command. That type exists to implement a stateless way to issue draw commands to the GPU. You can set several hints for a given draw command:

  • blending: the blending mode is represented by Maybe (BlendingMode,BlendingFactor,BlendingFactor). If you pass Nothing, blending is disabled for that draw command. If you want to enable it, you have to pass Just (mode,srcK,dstK), where mode is the BlendingMode and srcK and dstK are both BlendingFactor representing the source and destination factors.
  • depth test: the depth test can be enabled by passing True and disabled with False.
  • a per draw command uniform interface and uniform value: that is the way you can customize the draw calls. You just have to pass the uniform interface and the value to send down to the shader.

Finally, a RenderCmd holds a value. That value will be consumed later by other functions. In general, it’ll be Geometry.

Instances

Functor (RenderCmd rw c d u) Source 

renderCmd :: Maybe (BlendingMode, BlendingFactor, BlendingFactor) -> Bool -> U u -> u -> a -> RenderCmd rw c d u a Source

renderCmd blending depthTest uniformInterface u a constructs a new RenderCmd.

Special render commands

stdRenderCmd :: U u -> u -> a -> RenderCmd rw c d u a Source

A standard RenderCmd builder.

  • no blending
  • depth test enabled

stdRenderCmd_ :: a -> RenderCmd rw c d () a Source

A standard RenderCmd builder with no uniform interface.

  • no blending
  • depth test enabled