Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- data RenderCmd rw c d u a
- renderCmd :: Maybe (BlendingMode, BlendingFactor, BlendingFactor) -> Bool -> U u -> u -> a -> RenderCmd rw c d u a
- stdRenderCmd :: U u -> u -> a -> RenderCmd rw c d u a
- stdRenderCmd_ :: a -> RenderCmd rw c d () a
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
. If you passMaybe
(BlendingMode
,BlendingFactor
,BlendingFactor
)Nothing
, blending is disabled for that draw command. If you want to enable it, you have to pass
, whereJust
(mode,srcK,dstK)mode
is theBlendingMode
andsrcK
anddstK
are bothBlendingFactor
representing the source and destination factors. - depth test: the depth test can be enabled by passing
True
and disabled withFalse
. - 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
.
renderCmd :: Maybe (BlendingMode, BlendingFactor, BlendingFactor) -> Bool -> U u -> u -> a -> RenderCmd rw c d u a Source
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