module Fbuf:sig..end
type clears = {
|
clear_color : |
|
clear_depth : |
|
clear_stencil : |
None the corresponding
buffer is not cleared.val clears_default : clearsclear_default is the default clears:
clears_default.clear_color is Some Color.voidclears_default.clear_depth is Some 1.clears_default.clear_stencil is None.module Rbuf:sig..end
typeimage =[ `Rbuf of Rbuf.t
| `Tex of int * Lit.tex
| `Tex_layer of int * int * Lit.tex ]
typeattachement =[ `Color of int * image
| `Depth of image
| `Depth_stencil of image
| `Stencil of image ]
typet =Lit.fbuf
val default : Lit.fbuf
val create : ?clears:clears -> attachement list -> Lit.fbufcreate attachements is a framebuffer with attachements attachments.val attachements : Lit.fbuf -> attachement list
val is_multisample : Lit.fbuf -> boolis_multisample fb is true if fb is a multisample
framebuffer. Always false on Lit.Fbuf.default, though not entirely
accurate it's always possible to Lit.Fbuf.read from a multisample
framebuffer.val clears : Lit.fbuf -> clearsclears fb is fb's clears.val set_clears : Lit.fbuf -> clears -> unitset_clears fb clears sets fb's clears to clears.val clear : Lit.renderer -> Lit.fbuf -> unitclear r fb clears the framebuffer fb using clears fb.
Only r's Lit.Renderer.view viewport is affected.typestatus =[ `Complete
| `Incomplete_attachement
| `Incomplete_draw_buffer
| `Incomplete_layer_targets
| `Incomplete_missing_attachement
| `Incomplete_multisample
| `Incomplete_read_buffer
| `Undefined
| `Unknown of int
| `Unsupported ]
val pp_status : Format.formatter -> status -> unitpp_status ppf s prints a textual representation of s on ppf.val status : Lit.renderer -> Lit.fbuf -> statusstatus r fb is fb's status.typeread =[ `Color_b of int
| `Color_g of int
| `Color_r of int
| `Color_rgb of int
| `Color_rgba of int
| `Depth
| `Depth_stencil
| `Stencil ]
Lit.Fbuf.default).val read : ?first:int ->
?w_stride:int ->
Lit.renderer -> Lit.fbuf -> read -> Gg.box2 -> Lit.buf -> unitread r fb read box buf asynchronously reads the contents of
framebuffer fb according to read in the rectangle box
specified in integral screen coordinates and stores the result
in the GPU buffer of buf, starting at index first (defaults
to 0) and using w_stride pixels (defaults to (Box2.w box))
to move from line to line.Invalid_argument if `Depth_stencil is used and the
scalar type of buf is not `UInt32 (the data is packed as 24
bits of depth and 8 bits of stencil) or if is_multisample fb is
true.typeblit_buffer =[ `Color | `Depth | `Stencil ]
typeblit_filter =[ `Linear | `Nearest ]
`Color buffer.val blit : ?filter:blit_filter ->
Lit.renderer ->
blit_buffer list ->
src:Lit.fbuf -> Gg.box2 -> dst:Lit.fbuf -> Gg.box2 -> unitblit filter r src sbox dst dbox blits between the buffers bufs
src and dfb. blit_filter defaults to `Nearest and
can be only set to `Linear for blits that involve only
color buffers.
TODO. No way to specify color attachement.
FIXME. There are a lot of things to
consider
for this operation. We should try to make more checks.