module Renderer: sig
.. end
Renderers
Logging and renderer capabilities
module Log: sig
.. end
module Cap: sig
.. end
Renderer capabilities.
Render operations
val nop : Lit.op
nop
is a render no-op, it has no effect on the renderer.
val op : ?count:int ->
?uniforms:Lit.Uniform.set -> ?tr:Gg.m4 -> Lit.effect -> Lit.prim -> Lit.op
op count uniforms tr e p
is a render op.
count
defaults to 1.
uniforms
defaults to
Lit.Uniform.empty
,
tr
to
M4.id
.
val add_op : Lit.renderer -> Lit.op -> unit
add_op r o
adds render operation o
on r
.
Screen geometry and projection
val size : Lit.renderer -> Gg.size2
val set_size : Lit.renderer -> Gg.size2 -> unit
val view : Lit.renderer -> Lit.View.t
val set_view : Lit.renderer -> Lit.View.t -> unit
Framebuffers
val fbuf : Lit.renderer -> Lit.fbuf
fbuf r
is the framebuffer on which render ops are performed.
val set_fbuf : Lit.renderer -> Lit.fbuf -> unit
set_fbuf r fbuf
sets the framebuffer to fbuf
.
Rendering
val render : ?clear:bool -> Lit.renderer -> unit
render clear r
renders the added operations. If clear
is
true
(default) the current framebuffer is cleared before rendering.
Renderers
module Private: sig
.. end
Private functions and types for implementing renderers.
module type T = sig
.. end
The type for a renderer backend.
type
t = Lit.renderer
The type for renderers.
val create : ?compiler_msg_parser:Log.compiler_msg_parser ->
?log:Log.t ->
?debug:bool -> size:Gg.size2 -> (module Lit.Renderer.T) -> Lit.renderer
creates size b
creates a renderer with backend b
.
A valid OpenGL context is needed before calling this function.
val release : Lit.renderer -> unit
release r
releases GPU resources associated to the renderer.