Module VBO


module VBO: sig .. end

VBO : Vertex Buffer Object




Wikipedia article about Vertex Buffer Object
type vbo_id 
val glGenBuffer : unit -> vbo_id
val glGenBuffers : n:int -> vbo_id array

manual page
val glDeleteBuffer : vbo:vbo_id -> unit
manual page
val glDeleteBuffers : vbos:vbo_id array -> unit

type buffer_object_target =
| GL_ARRAY_BUFFER
| GL_ELEMENT_ARRAY_BUFFER
| GL_PIXEL_PACK_BUFFER
| GL_PIXEL_UNPACK_BUFFER
val glBindBuffer : target:buffer_object_target -> vbo:vbo_id -> unit
manual page
val glUnbindBuffer : target:buffer_object_target -> unit
Equivalent to the function glBindBuffer with 0 as vbo_id, as tells the manual to unbind buffer objects.

type vbo_usage_pattern =
| GL_STREAM_DRAW
| GL_STREAM_READ
| GL_STREAM_COPY
| GL_STATIC_DRAW
| GL_STATIC_READ
| GL_STATIC_COPY
| GL_DYNAMIC_DRAW
| GL_DYNAMIC_READ
| GL_DYNAMIC_COPY
val glBufferData : target:buffer_object_target ->
size:int ->
data:('a, 'b, Bigarray.c_layout) Bigarray.Array1.t ->
usage:vbo_usage_pattern -> unit
manual page
val glBufferDataNull : target:buffer_object_target ->
size:int -> usage:vbo_usage_pattern -> unit
same than glBufferData but passes a NULL pointer to the data parameter of the C function
val glBufferSubData : target:buffer_object_target ->
offset:int ->
size:int -> data:('a, 'b, Bigarray.c_layout) Bigarray.Array1.t -> unit
manual page
val elem_size : ba:('a, 'b, Bigarray.c_layout) Bigarray.Array1.t -> int
this function returns the size in octets of the elements of a bigarray
val ba_sizeof : ba:('a, 'b, Bigarray.c_layout) Bigarray.Array1.t -> int
you can use this function to provide the size argument of the function glBufferData

type access_policy =
| GL_READ_ONLY
| GL_WRITE_ONLY
| GL_READ_WRITE
type mapped_buffer 
val glMapBufferAbs : target:buffer_object_target ->
access:access_policy -> mapped_buffer

manual page
val glUnmapBuffer : target:buffer_object_target -> unit
val mapped_buffer_blit : mapped_buffer ->
(float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t ->
len:int -> unit
val mapped_buffer_blit_ofs : mapped_buffer ->
(float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t ->
ofs:int -> len:int -> unit

type bo_param =
| GL_BUFFER_ACCESS
| GL_BUFFER_MAPPED
| GL_BUFFER_SIZE
| GL_BUFFER_USAGE
params for glGetBufferParameter, but not used

in the C API glGetBufferParameteriv can be called with GL_BUFFER_ACCESS, GL_BUFFER_MAPPED, GL_BUFFER_SIZE, or GL_BUFFER_USAGE, each of these parameters return a different type, so glGetBufferParameter have been wrapped as follow:


val glGetBufferAccess : target:buffer_object_target -> access_policy
val glGetBufferMapped : target:buffer_object_target -> bool
val glGetBufferSize : target:buffer_object_target -> int
val glGetBufferUsage : target:buffer_object_target -> vbo_usage_pattern

manual page