Copyright | (C) 2015 Dimitri Sabadie |
---|---|
License | BSD3 |
Maintainer | Dimitri Sabadie <dimitri.sabadie@gmail.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- data Framebuffer rw c d
- type ColorFramebuffer rw c = Framebuffer rw c ()
- type DepthFramebuffer rw d = Framebuffer rw () d
- framebufferID :: Framebuffer rw c d -> GLuint
- framebufferOutput :: Framebuffer rw c d -> Output c d
- createFramebuffer :: forall c d e m rw. (HasFramebufferError e, MonadError e m, MonadIO m, MonadResource m, FramebufferColorAttachment c, FramebufferColorRW rw, FramebufferDepthAttachment d, FramebufferTarget rw) => Natural -> Natural -> Natural -> m (Framebuffer rw c d)
- class FramebufferColorAttachment c
- class FramebufferDepthAttachment d
- class FramebufferColorRW rw
- class FramebufferTarget rw
- type family TexturizeFormat a :: *
- data Output c d = Output (TexturizeFormat c) (TexturizeFormat d)
- data FramebufferBlitMask
- defaultFramebuffer :: Framebuffer RW () ()
- newtype FramebufferError = IncompleteFramebuffer String
- class HasFramebufferError a where
- fromFramebufferError :: FramebufferError -> a
Framebuffer creation
data Framebuffer rw c d Source
A Framebuffer
represents two buffers: a color buffer and depth buffer.
You can select which one you want and specify the formats to use by providing Pixel
types. If you want to mute a buffer, use '()'.
type ColorFramebuffer rw c = Framebuffer rw c () Source
A Framebuffer
with the depth buffer muted.
type DepthFramebuffer rw d = Framebuffer rw () d Source
A Framebuffer
with the color buffer muted. Can be used to implement fast pre-passes.
framebufferID :: Framebuffer rw c d -> GLuint Source
framebufferOutput :: Framebuffer rw c d -> Output c d Source
createFramebuffer :: forall c d e m rw. (HasFramebufferError e, MonadError e m, MonadIO m, MonadResource m, FramebufferColorAttachment c, FramebufferColorRW rw, FramebufferDepthAttachment d, FramebufferTarget rw) => Natural -> Natural -> Natural -> m (Framebuffer rw c d) Source
creates a new createFramebuffer
w h mipmapsFramebuffer
with dimension w * h
and
allocating spaces for mipmaps
level of textures. The textures are created by providing a
correct type.
For the color part, you can pass either:
- '()': that will mute the color buffer of the framebuffer;
: that will create a single texture with the wished color format;Format
t c- or
a
: that will create a chain of textures;:.
ba
andb
cannot be '()'.
For the depth part, you can pass either:
- '()': that will mute the depth buffer of the framebuffer;
: that will create a single texture with the wished depth format.Format
t c
Finally, the rw
parameter can be set to R
, W
or RW
to specify which kind of framebuffer
access you’ll need.
Framebuffer attachments
class FramebufferColorAttachment c Source
Typeclass of possible framebuffer color attachments.
addColorOutput
FramebufferColorAttachment () Source | |
ColorPixel (Format t c) => FramebufferColorAttachment (Format t c) Source | |
(ColorPixel a, ColorPixel b, FramebufferColorAttachment a, FramebufferColorAttachment b) => FramebufferColorAttachment ((:.) a b) Source |
class FramebufferDepthAttachment d Source
Typeclass of possible framebuffer depth attachments.
addDepthOutput
FramebufferDepthAttachment () Source | |
Pixel (Format t (CDepth d)) => FramebufferDepthAttachment (Format t (CDepth d)) Source |
Framebuffer access
class FramebufferColorRW rw Source
Typeclass used to implement read/write operation per color attachment.
setFramebufferColorRW
class FramebufferTarget rw Source
framebufferTarget
Framebuffer outputs
type family TexturizeFormat a :: * Source
TexturizeFormat () = () | |
TexturizeFormat (Format t c) = Texture2D (Format t c) | |
TexturizeFormat (a :. b) = TexturizeFormat a :. TexturizeFormat b |
Blitting
data FramebufferBlitMask Source
Mask for framebuffer blit operation.
Special framebuffers
defaultFramebuffer :: Framebuffer RW () () Source
The default Framebuffer
represents the screen (back buffer with double buffering).
Framebuffer errors
newtype FramebufferError Source
class HasFramebufferError a where Source