Module Lit.Attr

module Attr: sig .. end

An attribute is part of the vertex stream sent to the GPU by a primitive. It define the value of an input variable of the vertex shader (e.g. vertice, normal, color, etc.).

An attribute value adds immutable metadata to a (mutable) buffer value in order specify the location and nature of the attribute elements in the buffer.


type t = Lit.attr 
The type for attributes.
val create : ?normalize:bool ->
?stride:int -> ?first:int -> string -> dim:int -> Lit.Buf.t -> t
create normalize stride first name dim buf is an attribute such that:
Raises Invalid_argument if dim is out of range.
val name : Lit.attr -> string
name a is a's name.
val dim : Lit.attr -> int
dim a is a's dimension.
val buf : Lit.attr -> Lit.Buf.t
buf a is a's buffer.
val stride : Lit.attr -> int
stride a is a's attribute element scalar stride. See Lit.Attr.create.
val first : Lit.attr -> int
first a is a's first attribute element scalar index. See Lit.Attr.create.
val normalize : Lit.attr -> bool
normalize a is a's normalization behaviour. See Lit.Attr.create.
val rename : Lit.attr -> string -> Lit.attr
rename a name is like a except the name is changed to name.
val pp : Format.formatter -> Lit.attr -> unit
pp ppf a prints an unspecified representation of a on ppf.

Standard attributes names

val vertex : string
vertex is "vertex".
val normal : string
normal is "normal".
val color : string
color is "color".
val tex : string
tex is "tex".
val texn : int -> string
texn n is (Printf.sprintf "tex%d" n)
Raises Invalid_argument if n is negative.