Brr_canvas.GlSourceThe WebGL2 context.
If you want to get started with WebGL2 from the basics look here. See also the WebGL2 specification and the MDN WebGL page.
Note. Enumerants like ARRAY_BUFFER are lowercased to array_buffer. If they clash with a function name we prime them. If a function is overloaded alternate versions live as seperate entry point with an additional suffix, e.g. Brr_canvas.Gl.buffer_data_size or Brr_canvas.Gl.read_pixels_to_pixel_pack.
Warning. These bindings were semi-automatically generated. Some of the functions signatures may require tweaking; if you doubt a signature you may be right.
The type for WebGL2RenderingContext objects
get_context ~attrs cnv is WebGL2 context for canvas cnv with attributes attrs. If v1 is true (defaults to false) it will be a WebGL1 context but beware that some of the functions below do not work on it.
canvas c is the canvas element associated to the context c (if any).
drawing_buffer_width c is the drawing buffer width of c.
drawing_buffer_height c is the drawing buffer height of c.
get_supported_extensions c are the extensions of c.
The type for GLenum.
The type for WebGLBuffer objects.
The type for WebGLFramebuffer objects.
The type for WebGLProgram objects.
The type for WebGLQuery objects.
The type for WebGLRenderbuffer objects.
The type for WebGLSampler objects.
The type for WebGLShader objects.
The type for WebGLTexture objects.
The type for WebGLTransformFeedback objects.
The type for WebGLUniformLocation objects.
The type for WebGLVertexArrayObject objects.
WebGLActiveInfo objects.
WebGLShaderPrecisionFormat objects.
Texture image sources.
activeTexture ctexture
attachShader cprogram shader
beginQuery ctarget query
beginTransformFeedback cprimitiveMode
bindAttribLocation cprogram index name
bindBuffer ctarget buffer
bindBufferBase ctarget index buffer
bindBufferRange ctarget index buffer offset size
bindFramebuffer ctarget framebuffer
bindRenderbuffer ctarget renderbuffer
bindSampler cunit sampler
bindTexture ctarget texture
bindTransformFeedback ctarget tf
bindVertexArray carray
blendColor cred green blue alpha
blendEquation cmode
blendEquationSeparate cmodeRGB modeAlpha
blendFuncSeparate csrcRGB dstRGB srcAlpha dstAlpha
val blit_framebuffer :
t ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
unitblitFramebuffer csrcX0 srcY0 srcX1 srcY1 dstX0 dstY0 dstX1 dstY1 mask filter
bufferData ctarget srcData usage. See also buffer_data_size
bufferData ctarget size usage.
bufferSubData ctarget dstByteOffset srcData
checkFramebufferStatus ctarget
clearBufferfi cbuffer drawbuffer depth stencil
clearBufferfv cbuffer drawbuffer values
clearBufferiv cbuffer drawbuffer values
clearBufferuiv cbuffer drawbuffer values
clearColor cred green blue alpha
clearDepth cdepth
clearStencil cs
clientWaitSync csync flags timeout
compileShader cshader
val compressed_tex_image2d :
t ->
enum ->
int ->
enum ->
int ->
int ->
int ->
('a, 'b) Brr.Tarray.t ->
unitcompressedTexImage2D ctarget level internalformat width height border srcData
val compressed_tex_image2d_size :
t ->
enum ->
int ->
enum ->
int ->
int ->
int ->
int ->
int ->
unitcompressedTexImage2D ctarget level internalformat width height border imageSize offset
val compressed_tex_image3d :
t ->
enum ->
int ->
enum ->
int ->
int ->
int ->
int ->
('a, 'b) Brr.Tarray.t ->
unitcompressedTexImage3D ctarget level internalformat width height depth border srcData
val compressed_tex_image3d_size :
t ->
enum ->
int ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
unitcompressedTexImage3D ctarget level internalformat width height depth border imageSize offset
val compressed_tex_sub_image2d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
('a, 'b) Brr.Tarray.t ->
unitcompressedTexSubImage2D ctarget level xoffset yoffset width height format srcData
val compressed_tex_sub_image2d_size :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
int ->
int ->
unitcompressedTexSubImage2D ctarget level xoffset yoffset width height format imageSize offset
val compressed_tex_sub_image3d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
('a, 'b) Brr.Tarray.t ->
unitcompressedTexSubImage3D ctarget level xoffset yoffset zoffset width height depth format srcData
val compressed_tex_sub_image3d_size :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
int ->
int ->
unitcompressedTexSubImage3D ctarget level xoffset yoffset zoffset width height depth format imageSize offset
copyBufferSubData creadTarget writeTarget readOffset writeOffset size
copyTexImage2D ctarget level internalformat x y width height border
copyTexSubImage2D ctarget level xoffset yoffset x y width height
val copy_tex_sub_image3d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
unitcopyTexSubImage3D ctarget level xoffset yoffset zoffset x y width height
createShader ctype
deleteBuffer cbuffer
deleteFramebuffer cframebuffer
deleteProgram cprogram
deleteQuery cquery
deleteRenderbuffer crenderbuffer
deleteSampler csampler
deleteShader cshader
deleteSync csync
deleteTexture ctexture
deleteVertexArray cvertexArray
detachShader cprogram shader
disableVertexAttribArray cindex
drawArrays cmode first count
drawArraysInstanced cmode first count instanceCount
drawBuffers cbuffers
drawElements cmode count type offset
drawElementsInstanced cmode count type offset instanceCount
drawRangeElements cmode start end count type offset
enableVertexAttribArray cindex
framebufferRenderbuffer ctarget attachment renderbuffertarget renderbuffer
framebufferTexture2D ctarget attachment textarget texture level
framebufferTextureLayer ctarget attachment texture level layer
generateMipmap ctarget
getActiveAttrib cprogram index
getActiveUniform cprogram index
getActiveUniformBlockName cprogram uniformBlockIndex
getActiveUniformBlockParameter cprogram uniformBlockIndex pname
getActiveUniforms cprogram uniformIndices pname
getAttachedShaders cprogram
getAttribLocation cprogram name
getBufferSubData ctarget srcByteOffset dstBuffer
getFragDataLocation cprogram name
getFramebufferAttachmentParameter ctarget attachment pname
getIndexedParameter ctarget index
getInternalformatParameter ctarget internalformat pname
getParameter cpname
getProgramInfoLog cprogram
getRenderbufferParameter ctarget pname
getShaderInfoLog cshader
getShaderPrecisionFormat cshadertype precisiontype
getShaderSource cshader
getTransformFeedbackVarying cprogram index
getUniform cprogram location
getUniformBlockIndex cprogram uniformBlockName
getUniformIndices cprogram uniformNames
getUniformLocation cprogram name
getVertexAttrib cindex pname
getVertexAttribOffset cindex pname
invalidateFramebuffer ctarget attachments
invalidateSubFramebuffer ctarget attachments x y width height
isFramebuffer cframebuffer
isRenderbuffer crenderbuffer
isVertexArray cvertexArray
linkProgram cprogram
pixelStorei cpname param
polygonOffset cfactor units
readBuffer csrc
readPixels cx y width height format type offset
val read_pixels :
t ->
int ->
int ->
int ->
int ->
enum ->
enum ->
('a, 'b) Brr.Tarray.t ->
unitreadPixels cx y width height format type dstData
renderbufferStorage ctarget internalformat width height
renderbufferStorageMultisample ctarget samples internalformat width height
sampleCoverage cvalue invert
samplerParameterf csampler pname param
samplerParameteri csampler pname param
shaderSource cshader source
stencilFunc cfunc ref mask
stencilFuncSeparate cface func ref mask
stencilMask cmask
stencilMaskSeparate cface mask
stencilOpSeparate cface fail zfail zpass
val tex_image2d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
('a, 'b) Brr.Tarray.t ->
int ->
unittexImage2D ctarget level internalformat width height border format type srcData srcOffset
val tex_image2d_of_source :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
Tex_image_source.t ->
unittexImage2D ctarget level internalformat width height border format type source
val tex_image2d_of_pixel_unpack :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
int ->
unittexImage2D ctarget level internalformat width height border format type pboOffset
val tex_image3d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
('a, 'b) Brr.Tarray.t ->
int ->
unittexImage3D ctarget level internalformat width height depth border format type srcData srcOffset
val tex_image3d_of_source :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
Tex_image_source.t ->
unittexImage3D ctarget level internalformat width height depth border format type source
val tex_image3d_of_pixel_unpack :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
int ->
unittexImage3D ctarget level internalformat width height depth border format type pboOffset
texParameterf ctarget pname param
texParameteri ctarget pname param
texStorage2D ctarget levels internalformat width height
texStorage3D ctarget levels internalformat width height depth
val tex_sub_image2d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
('a, 'b) Brr.Tarray.t ->
int ->
unittexSubImage2D ctarget level xoffset yoffset width height format type srcData srcOffset
val tex_sub_image2d_of_source :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
Tex_image_source.t ->
unittexSubImage2D ctarget level xoffset yoffset width height format type source
val tex_sub_image2d_of_pixel_unpack :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
int ->
unittexSubImage2D ctarget level xoffset yoffset width height format type pboOffset
val tex_sub_image3d :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
('a, 'b) Brr.Tarray.t ->
unittexSubImage3D ctarget level xoffset yoffset zoffset width height depth format type srcData
val tex_sub_image3d_of_source :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
Tex_image_source.t ->
unittexSubImage3D ctarget level xoffset yoffset zoffset width height depth format type source
val tex_sub_image3d_of_pixel_unpack :
t ->
enum ->
int ->
int ->
int ->
int ->
int ->
int ->
int ->
enum ->
enum ->
int ->
unittexSubImage3D ctarget level xoffset yoffset zoffset width height depth format type pboOffset
transformFeedbackVaryings cprogram varyings bufferMode
uniform1f clocation x
uniform1fv clocation data
uniform1i clocation x
uniform1iv clocation data
uniform1ui clocation v0
uniform1uiv clocation data
uniform2f clocation x y
uniform2fv clocation data
uniform2i clocation x y
uniform2iv clocation data
uniform2ui clocation v0 v1
uniform2uiv clocation data
uniform3f clocation x y z
uniform3fv clocation data
uniform3i clocation x y z
uniform3iv clocation data
uniform3ui clocation v0 v1 v2
uniform3uiv clocation data
uniform4f clocation x y z w
uniform4fv clocation data
uniform4i clocation x y z w
uniform4iv clocation data
uniform4ui clocation v0 v1 v2 v3
uniform4uiv clocation data
uniformBlockBinding cprogram uniformBlockIndex uniformBlockBinding
uniformMatrix2fv clocation transpose data
uniformMatrix2x3fv clocation transpose data
uniformMatrix2x4fv clocation transpose data
uniformMatrix3fv clocation transpose data
uniformMatrix3x2fv clocation transpose data
uniformMatrix3x4fv clocation transpose data
uniformMatrix4fv clocation transpose data
uniformMatrix4x2fv clocation transpose data
uniformMatrix4x3fv clocation transpose data
useProgram cprogram
validateProgram cprogram
vertexAttrib1f cindex x
vertexAttrib1fv cindex values
vertexAttrib2f cindex x y
vertexAttrib2fv cindex values
vertexAttrib3f cindex x y z
vertexAttrib3fv cindex values
vertexAttrib4f cindex x y z w
vertexAttrib4fv cindex values
vertexAttribDivisor cindex divisor
vertexAttribI4i cindex x y z w
vertexAttribI4iv cindex values
vertexAttribI4ui cindex x y z w
vertexAttribI4uiv cindex values
vertexAttribIPointer cindex size type stride offset
vertexAttribPointer cindex size type normalized stride offset