Js_of_ocaml.WebGL2WebGL2 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).
type sizei = WebGL.sizeitype sizeiptr = WebGL.sizeiptrtype intptr = WebGL.intptrtype uint = WebGL.uinttype clampf = WebGL.clampftype void = WebGL.voidtype clearBufferMask = WebGL.clearBufferMasktype beginMode = WebGL.beginModetype bufferTarget = WebGL.bufferTargettype bufferUsage = WebGL.bufferUsagetype enableCap = WebGL.enableCaptype dataType = WebGL.dataTypetype pixelType = WebGL.pixelTypetype pixelFormat = WebGL.pixelFormattype format = WebGL.formattype texTarget = WebGL.texTargettype texFilter = WebGL.texFiltertype rbTarget = WebGL.rbTargettype fbTarget = WebGL.fbTargettype attachmentPoint = WebGL.attachmentPointtype 'a parameter = 'a WebGL.parametertype 'a pixelStoreParam = 'a WebGL.pixelStoreParamtype buffer = WebGL.buffertype framebuffer = WebGL.framebuffertype program = WebGL.programtype renderbuffer = WebGL.renderbuffertype shader = WebGL.shadertype texture = WebGL.texturetype 'a uniformLocation = 'a WebGL.uniformLocationtype 'a texParam = 'a WebGL.texParamtype wrapMode = WebGL.wrapModetype depthFunction = WebGL.depthFunctiontype 'a programParam = 'a WebGL.programParamtype 'a vertexAttribParam = 'a WebGL.vertexAttribParamtype 'a attachParam = 'a WebGL.attachParamtype framebufferStatus = WebGL.framebufferStatustype uniformType = WebGL.uniformTypetype hintTarget = WebGL.hintTargettype objectType = WebGL.objectTypeclass type renderingContext = object ... endval getContext : Dom_html.canvasElement Js.t -> renderingContext Js.t Js.optval getContextWithAttributes :
Dom_html.canvasElement Js.t ->
WebGL.contextAttributes Js.t ->
renderingContext Js.t Js.opt