Module Js_of_ocaml.WebGL2

WebGL2 binding.

WebGL2 (WebGL2RenderingContext) is a strict superset of WebGL1, so the context renderingContext inherits every method and constant of WebGL.renderingContext and adds the WebGL2 ones on top.

Following the pragmatic style of WebGL, the enumerations are kept as abstract types shared between related uses. In particular the many WebGL2 sized internal formats and the plain formats share the single type pixelFormat; the binding therefore does not enforce, at compile time, that the (internalformat, format, type) triples passed to e.g. renderingContext.texImage3D are mutually coherent (WebGL itself is not type safe there).

Types reused from WebGL1

type sizei = WebGL.sizei
type sizeiptr = WebGL.sizeiptr
type intptr = WebGL.intptr
type uint = WebGL.uint
type clampf = WebGL.clampf
type void = WebGL.void
type clearBufferMask = WebGL.clearBufferMask
type beginMode = WebGL.beginMode
type bufferTarget = WebGL.bufferTarget
type bufferUsage = WebGL.bufferUsage
type enableCap = WebGL.enableCap
type dataType = WebGL.dataType
type pixelType = WebGL.pixelType
type pixelFormat = WebGL.pixelFormat
type format = WebGL.format
type texTarget = WebGL.texTarget
type texFilter = WebGL.texFilter
type rbTarget = WebGL.rbTarget
type fbTarget = WebGL.fbTarget
type attachmentPoint = WebGL.attachmentPoint
type 'a parameter = 'a WebGL.parameter
type 'a pixelStoreParam = 'a WebGL.pixelStoreParam
type buffer = WebGL.buffer
type framebuffer = WebGL.framebuffer
type program = WebGL.program
type renderbuffer = WebGL.renderbuffer
type shader = WebGL.shader
type texture = WebGL.texture
type 'a uniformLocation = 'a WebGL.uniformLocation
type 'a texParam = 'a WebGL.texParam
type wrapMode = WebGL.wrapMode
type depthFunction = WebGL.depthFunction
type 'a programParam = 'a WebGL.programParam
type 'a vertexAttribParam = 'a WebGL.vertexAttribParam
type 'a attachParam = 'a WebGL.attachParam
type framebufferStatus = WebGL.framebufferStatus
type uniformType = WebGL.uniformType
type hintTarget = WebGL.hintTarget
type objectType = WebGL.objectType

New WebGL2 objects

type query
type sampler
type sync
type transformFeedback
type vertexArrayObject

New WebGL2 enumerations

type queryTarget
type currentQueryParam
type 'a queryParam
type syncCondition
type 'a syncParam
type syncStatus
type clientWaitSyncStatus
type clearBuffer
type transformFeedbackMode
type 'a samplerParam
type 'a activeUniformParam
type 'a uniformBlockParam
type transformFeedbackTarget
type textureCompareMode
type 'a indexedParameter
type 'a internalformatParam
type componentType
type colorEncoding
type syncObjectType
class type renderingContext = object ... end

Getting a WebGL2 context