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.
typet =Lit.attr
val create : ?normalize:bool ->
?stride:int -> ?first:int -> string -> dim:int -> Lit.Buf.t -> tcreate normalize stride first name dim buf is an attribute such that:
normalize, if true, scalars stored as integer and
signed integer are respectively mapped to floating point
ranges [0;1] and [-1;1] on access on the GPU;
defaults to false.stride is the number of scalars from attribute
element to attribute element, defaults to dim.first is the scalar index of the first attribute
element in buf; defaults to 0.name is the name of the attribute. This name will be used
to bind the attribute to the corresponding input variable in
the vertex shaderdim is the dimension of the data (from 1 to 4).buf is the buffer holding the attribute elements.Invalid_argument if dim is out of range.val name : Lit.attr -> stringname a is a's name.val dim : Lit.attr -> intdim a is a's dimension.val buf : Lit.attr -> Lit.Buf.tbuf a is a's buffer.val stride : Lit.attr -> int
val first : Lit.attr -> int
val normalize : Lit.attr -> bool
val rename : Lit.attr -> string -> Lit.attrrename a name is like a except the name is changed to name.val pp : Format.formatter -> Lit.attr -> unitpp ppf a prints an unspecified representation of a on ppf.val vertex : stringvertex is "vertex".val normal : stringnormal is "normal".val color : stringcolor is "color".val tex : stringtex is "tex".val texn : int -> stringtexn n is (Printf.sprintf "tex%d" n)Invalid_argument if n is negative.