module Graphics.Rendering.Ombra.Draw.Class (
MonadDraw(..),
MonadDrawBuffers(..),
MonadRead(..)
) where
import Data.Word
import Graphics.Rendering.Ombra.Color
import Graphics.Rendering.Ombra.OutBuffer.Types
import Graphics.Rendering.Ombra.Geometry.Draw
import Graphics.Rendering.Ombra.Geometry.Types
import Graphics.Rendering.Ombra.Internal.GL (MonadGL)
import Graphics.Rendering.Ombra.Texture.Draw
import Graphics.Rendering.Ombra.Shader.Program
import Graphics.Rendering.Ombra.Shader.Types
import Graphics.Rendering.Ombra.Screen
import Graphics.Rendering.Ombra.Vector
class ( MonadGeometry (m o)
, MonadProgram (m o)
, MonadTexture (m o)
, MonadScreen (m o)
) => MonadDraw o m where
drawGeometry :: (GeometryVertex g, ElementType e)
=> Geometry e g
-> m o ()
default drawGeometry :: (MonadGL (m o), GeometryVertex g, ElementType e)
=> Geometry e g
-> m o ()
drawGeometry = defaultDrawGeometry
withColorMask :: (Bool, Bool, Bool, Bool) -> m o a -> m o a
withDepthTest :: Bool -> m o a -> m o a
withDepthMask :: Bool -> m o a -> m o a
clearColor :: m o ()
clearColor = clearColorWith $ Vec4 0 0 0 1
clearColorWith :: Vec4 -> m o ()
clearDepth :: m o ()
clearDepth = clearDepthWith 1
clearDepthWith :: Double -> m o ()
clearStencil :: m o ()
clearStencil = clearStencilWith 0
clearStencilWith :: Int -> m o ()
class MonadDrawBuffers m where
createBuffers :: FragmentShaderOutput o
=> Int
-> Int
-> GBufferInfo o
-> DepthBufferInfo
-> m o a
-> m o' (a, BufferPair o)
createGBuffer :: FragmentShaderOutput o
=> GBufferInfo o
-> DepthBuffer
-> m o a
-> m o' (a, BufferPair o)
createDepthBuffer :: FragmentShaderOutput o
=> GBuffer o
-> DepthBufferInfo
-> m o a
-> m o' (a, BufferPair o)
drawBuffers :: FragmentShaderOutput o
=> BufferPair o
-> m o a
-> m o' a
class MonadDraw o m => MonadRead o m where
readColor :: (Int, Int, Int, Int) -> m o [Color]
readColorFloat :: (Int, Int, Int, Int) -> m o [Vec4]
readDepth :: (Int, Int, Int, Int) -> m o [Word16]
readDepthFloat :: (Int, Int, Int, Int) -> m o [Float]
readStencil :: (Int, Int, Int, Int) -> m o [Word8]