Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Draw a
- data DrawState
- refDrawCtx :: GLES => Ctx -> Draw a -> IORef DrawState -> IO a
- runDrawCtx :: Ctx -> Draw a -> DrawState -> IO (a, DrawState)
- execDrawCtx :: Ctx -> Draw a -> DrawState -> IO DrawState
- evalDrawCtx :: Ctx -> Draw a -> DrawState -> IO a
- drawState :: GLES => Int -> Int -> IO DrawState
- drawInit :: GLES => Draw ()
- clearBuffers :: GLES => [Buffer] -> Draw ()
- drawLayer :: GLES => Layer' Drawable t a -> Draw a
- resizeViewport :: GLES => Int -> Int -> Draw ()
- preloadGeometry :: GLES => Geometry is -> Draw ()
- preloadTexture :: GLES => Texture -> Draw ()
- preloadProgram :: GLES => Program gs is -> Draw ()
- removeGeometry :: GLES => Geometry is -> Draw ()
- removeTexture :: GLES => Texture -> Draw ()
- removeProgram :: GLES => Program gs is -> Draw ()
- gl :: GL a -> Draw a
Documentation
A state monad on top of GL
.
Running the Draw monad
refDrawCtx :: GLES => Ctx -> Draw a -> IORef DrawState -> IO a Source #
Run a Draw action using an IORef and a context.
Create a DrawState
.
Draw actions
Resources
In Ombra, GPU resources are allocated when they're needed, and they're kept alive by their corresponding CPU resources. Specifically, these resources are Geometries, Textures and Programs. This means that, when a CPU resource is garbage collected, the GPU resource is also removed. The functions below let you manage allocation and deallocation manually.