proc commit(gl: WebGLRenderingContext)
-
Pushes frames back to the original HTMLCanvasElement, if the context is not directly fixed to a specific canvas.
Source
Edit
proc getContextAttributes(gl: WebGLRenderingContext): WebGLContextAttributes
-
Returns a WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost.
Source
Edit
proc isContextLost(gl: WebGLRenderingContext): bool
-
Returns true if the context is lost, otherwise returns false.
Source
Edit
proc scissor(gl: WebGLRenderingContext; x, y, width, height: int)
-
Defines the scissor box.
Source
Edit
proc viewport(gl: WebGLRenderingContext; x, y, width, height: int)
-
Sets the viewport.
Source
Edit
proc blendColor(gl: WebGLRenderingContext; red, green, blue, alpha: float32)
-
Sets the source and destination blending factors.
Source
Edit
proc blendEquation(gl: WebGLRenderingContext; mode: uint)
-
Sets both the RGB blend equation and alpha blend equation to a single equation.
Source
Edit
proc blendEquationSeparate(gl: WebGLRenderingContext; modeRGB, modeAlpha: uint)
-
Sets the RGB blend equation and alpha blend equation separately.
Source
Edit
proc blendFunc(gl: WebGLRenderingContext; sfactor, dfactor: uint)
-
Defines which function is used for blending pixel arithmetic.
Source
Edit
proc blendFuncSeparate(gl: WebGLRenderingContext;
srcRGB, dstRGB, srcAlpha, dstAlpha: uint)
-
Defines which function is used for blending pixel arithmetic for RGB and alpha components separately.
Source
Edit
proc clearColor(gl: WebGLRenderingContext; red, green, blue, alpha: float32)
-
Specifies the color values used when clearing color buffers.
Source
Edit
proc clearDepth(gl: WebGLRenderingContext; depth: float32)
-
Specifies the depth value used when clearing the depth buffer.
Source
Edit
proc clearStencil(gl: WebGLRenderingContext; s: int)
-
Specifies the stencil value used when clearing the stencil buffer.
Source
Edit
proc colorMask(gl: WebGLRenderingContext; red, green, blue, alpha: bool)
-
Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer.
Source
Edit
proc cullFace(gl: WebGLRenderingContext; mode: uint)
-
Specifies whether or not front- and/or back-facing polygons can be culled.
Source
Edit
proc depthFunc(gl: WebGLRenderingContext; fun: uint)
-
Specifies a function that compares incoming pixel depth to the current depth buffer value.
Source
Edit
proc depthMask(gl: WebGLRenderingContext; flag: bool)
-
Sets whether writing into the depth buffer is enabled or disabled.
Source
Edit
proc depthRange(gl: WebGLRenderingContext; zNear, zFar: float)
-
Specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
Source
Edit
proc disable(gl: WebGLRenderingContext; cap: uint)
-
Disables specific WebGL capabilities for this context.
Source
Edit
proc enable(gl: WebGLRenderingContext; cap: uint)
-
Enables specific WebGL capabilities for this context.
Source
Edit
proc frontFace(gl: WebGLRenderingContext; mode: uint)
-
Specifies whether polygons are front- or back-facing by setting a winding orientation.
Source
Edit
proc getError(gl: WebGLRenderingContext): uint
-
Returns error information.
Source
Edit
proc hint(gl: WebGLRenderingContext; target, mode: uint)
-
Specifies hints for certain behaviors. The interpretation of these hints depend on the implementation.
Source
Edit
proc isEnabled(gl: WebGLRenderingContext; cap: uint): bool
-
Tests whether a specific WebGL capability is enabled or not for this context.
Source
Edit
proc lineWidth(gl: WebGLRenderingContext; width: float32)
-
Sets the line width of rasterized lines.
Source
Edit
proc pixelStorei(gl: WebGLRenderingContext; pname: uint; param: int)
-
Specifies the pixel storage modes
Source
Edit
proc polygonOffset(gl: WebGLRenderingContext; factor, units: float32)
-
Specifies the scale factors and units to calculate depth values.
Source
Edit
proc sampleCoverage(gl: WebGLRenderingContext; value: float32; invert: bool)
-
Specifies multi-sample coverage parameters for anti-aliasing effects.
Source
Edit
proc stencilFunc(gl: WebGLRenderingContext; fun: uint; rf: int; mask: uint)
-
Sets the both front and back function and reference value for stencil testing.
Source
Edit
proc stencilFuncSeparate(gl: WebGLRenderingContext; face, fun: uint; rf: int; mask: uint)
-
Sets the front and/or back function and reference value for stencil testing.
Source
Edit
proc stencilMask(gl: WebGLRenderingContext; mask: uint)
-
Controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
Source
Edit
proc stencilMaskSeparate(gl: WebGLRenderingContext; face: uint; mask: uint)
-
Controls enabling and disabling of front and/or back writing of individual bits in the stencil planes.
Source
Edit
proc stencilOp(gl: WebGLRenderingContext; fail, zfail, zpass: uint)
-
Sets both the front and back-facing stencil test actions.
Source
Edit
proc stencilOpSeparate(gl: WebGLRenderingContext; face, fail, zfail, zpass: uint)
-
Sets the front and/or back-facing stencil test actions.
Source
Edit
proc bindBuffer(gl: WebGLRenderingContext; target: uint | BufferEnum;
buffer: WebGLBuffer)
-
Binds a WebGLBuffer object to a given target.
Source
Edit
proc createBuffer(gl: WebGLRenderingContext): WebGLBuffer
-
Creates a WebGLBuffer object.
Source
Edit
proc deleteBuffer(gl: WebGLRenderingContext; buffer: WebGLBuffer)
-
Deletes a WebGLBuffer object.
Source
Edit
proc isBuffer(gl: WebGLRenderingContext; buffer: WebGLBuffer): bool
-
Returns a Boolean indicating if the passed buffer is valid.
Source
Edit
proc bindFramebuffer(gl: WebGLRenderingContext; target: uint;
framebuffer: WebGLFramebuffer)
-
Binds a WebGLFrameBuffer object to a given target.
Source
Edit
proc checkFramebufferStatus(gl: WebGLRenderingContext; target: uint): uint
-
Returns the status of the framebuffer.
Source
Edit
proc createFramebuffer(gl: WebGLRenderingContext): WebGLFramebuffer
-
Creates a WebGLFrameBuffer object.
Source
Edit
proc deleteFramebuffer(gl: WebGLRenderingContext; framebuffer: WebGLFramebuffer)
-
Deletes a WebGLFrameBuffer object.
Source
Edit
proc framebufferRenderbuffer(gl: WebGLRenderingContext;
target, attachment, renderbuffertarget: uint;
renderbuffer: WebGLRenderbuffer)
-
Attaches a WebGLRenderingBuffer object to a WebGLFrameBuffer object.
Source
Edit
proc framebufferTexture2D(gl: WebGLRenderingContext;
target, attachment, textarget: uint; texture: WebGLTexture;
level: int)
-
Attaches a textures image to a WebGLFrameBuffer object.
Source
Edit
proc isFramebuffer(gl: WebGLRenderingContext; framebuffer: WebGLFramebuffer): bool
-
Returns a Boolean indicating if the passed WebGLFrameBuffer object is valid.
Source
Edit
proc readPixels(gl: WebGLRenderingContext; x, y: int; width, height: int;
format, typ: uint; pixels: ArrayBufferView)
-
Reads a block of pixels from the WebGLFrameBuffer.
Source
Edit
proc bindRenderbuffer(gl: WebGLRenderingContext; target: uint;
renderbuffer: WebGLRenderbuffer)
-
Binds a WebGLRenderBuffer object to a given target.
Source
Edit
proc createRenderbuffer(gl: WebGLRenderingContext): WebGLRenderbuffer
-
Creates a WebGLRenderBuffer object.
Source
Edit
proc deleteRenderbuffer(gl: WebGLRenderingContext; renderbuffer: WebGLRenderbuffer)
-
Deletes a WebGLRenderBuffer object.
Source
Edit
proc isRenderbuffer(gl: WebGLRenderingContext; renderbuffer: WebGLRenderbuffer): bool
-
Returns a Boolean indicating if the passed WebGLRenderingBuffer is valid.
Source
Edit
proc renderbufferStorage(gl: WebGLRenderingContext; target, internalFormat: uint;
width, height: int)
-
Creates a renderbuffer data store.
Source
Edit
proc bindTexture(gl: WebGLRenderingContext; target: uint; texture: WebGLTexture)
-
Binds a WebGLTexture object to a given target.
Source
Edit
proc compressedTexImage2D(gl: WebGLRenderingContext; target: uint; level: int;
internalformat: uint; width, height: int; border: int;
pixels: ArrayBufferView)
-
Specifies a 2D texture image in a compressed format.
Source
Edit
proc compressedTexSubImage2D(gl: WebGLRenderingContext; target: uint;
level, xoffset, yoffset: int; width, height: int;
format: int; pixels: ArrayBufferView)
-
Specifies a 2D texture sub-image in a compressed format.
Source
Edit
proc copyTexImage2D(gl: WebGLRenderingContext; target: uint;
level, internalformat, x, y: int; width, height: int; border: int)
-
Copies a 2D texture image.
Source
Edit
proc copyTexSubImage2D(gl: WebGLRenderingContext; target: uint;
level, xoffset, yoffset, x, y: int; width, height: int)
-
Copies a 2D texture sub-image.
Source
Edit
proc createTexture(gl: WebGLRenderingContext): WebGLTexture
-
Creates a WebGLTexture object.
Source
Edit
proc deleteTexture(gl: WebGLRenderingContext; texture: WebGLTexture)
-
Deletes a WebGLTexture object.
Source
Edit
proc generateMipmap(gl: WebGLRenderingContext; target: uint)
-
Generates a set of mipmaps for a WebGLTexture object.
Source
Edit
proc isTexture(gl: WebGLRenderingContext; texture: WebGLTexture): bool
-
Returns a Boolean indicating if the passed WebGLTexture is valid.
Source
Edit
proc texParameterf(gl: WebGLRenderingContext; target: uint; pname: uint; param: float32)
-
Sets texture parameters.
Source
Edit
proc texParameteri(gl: WebGLRenderingContext; target: uint; pname: uint; param: uint)
-
Sets texture parameters.
Source
Edit
proc attachShader(gl: WebGLRenderingContext; program: WebGLProgram;
shader: WebGLShader)
-
Attaches a WebGLShader to a WebGLProgram.
Source
Edit
proc bindAttribLocation(gl: WebGLRenderingContext; program: WebGLProgram;
index: uint; name: cstring)
-
Binds a generic vertex index to a named attribute variable.
Source
Edit
proc compileShader(gl: WebGLRenderingContext; shader: WebGLShader)
-
Compiles a WebGLShader.
Source
Edit
proc createProgram(gl: WebGLRenderingContext): WebGLProgram
-
Creates a WebGLProgram.
Source
Edit
proc createShader(gl: WebGLRenderingContext; typ: uint | ShaderEnum): WebGLShader
-
Creates a WebGLShader.
Source
Edit
proc deleteProgram(gl: WebGLRenderingContext; program: WebGLProgram)
-
Deletes a WebGLProgram.
Source
Edit
proc deleteShader(gl: WebGLRenderingContext; shader: WebGLShader)
-
Deletes a WebGLShader.
Source
Edit
proc detachShader(gl: WebGLRenderingContext; program: WebGLProgram;
shader: WebGLShader)
-
Detaches a WebGLShader.
Source
Edit
proc getAttachedShaders(gl: WebGLRenderingContext; program: WebGLProgram): seq[
WebGLShader]
-
Returns a list of WebGLShader objects attached to a WebGLProgram.
Source
Edit
proc getProgramInfoLog(gl: WebGLRenderingContext; program: WebGLProgram): cstring
-
Returns the information log for a WebGLProgram object.
Source
Edit
proc getShaderPrecisionFormat(gl: WebGLRenderingContext;
shaderType, precisionType: uint): WebGLShaderPrecisionFormat
-
Returns a WebGLShaderPrecisionFormat object describing the precision for the numeric format of the shader.
Source
Edit
proc getShaderInfoLog(gl: WebGLRenderingContext; shader: WebGLShader): cstring
-
Returns the information log for a WebGLShader object.
Source
Edit
proc getShaderSource(gl: WebGLRenderingContext; shader: WebGLShader): cstring
-
Returns the source code of a WebGLShader as a string.
Source
Edit
proc isProgram(gl: WebGLRenderingContext; program: WebGLProgram): bool
-
Returns a Boolean indicating if the passed WebGLProgram is valid.
Source
Edit
proc isShader(gl: WebGLRenderingContext; shader: WebGLShader): bool
-
Returns a Boolean indicating if the passed WebGLShader is valid.
Source
Edit
proc linkProgram(gl: WebGLRenderingContext; program: WebGLProgram)
-
Links the passed WebGLProgram object.
Source
Edit
proc shaderSource(gl: WebGLRenderingContext; shader: WebGLShader; source: cstring)
-
Sets the source code in a WebGLShader.
Source
Edit
proc useProgram(gl: WebGLRenderingContext; program: WebGLProgram)
-
Uses the specified WebGLProgram as part the current rendering state.
Source
Edit
proc validateProgram(gl: WebGLRenderingContext; program: WebGLProgram)
-
Validates a WebGLProgram.
Source
Edit
proc disableVertexAttribArray(gl: WebGLRenderingContext; index: uint)
-
Disables a vertex attribute array at a given position.
Source
Edit
proc enableVertexAttribArray(gl: WebGLRenderingContext; index: uint)
-
Enables a vertex attribute array at a given position.
Source
Edit
proc getActiveAttrib(gl: WebGLRenderingContext; program: WebGLProgram; index: uint): WebGLActiveInfo
-
Returns information about an active attribute variable.
Source
Edit
proc getActiveUniform(gl: WebGLRenderingContext; program: WebGLProgram; index: uint): WebGLActiveInfo
-
Returns information about an active uniform variable.
Source
Edit
proc getAttribLocationUnchecked(gl: WebGLRenderingContext; program: WebGLProgram;
name: cstring): int {.
importcpp: "#.getAttribLocation(@)"
.}
-
Source
Edit
proc getAttribLocation(gl: WebGLRenderingContext; program: WebGLProgram;
name: cstring): uint {.
importcpp: "#.getAttribLocationChecked(@)", raises: [AssertionError], tags: []
.}
-
Source
Edit
proc getUniformLocation(gl: WebGLRenderingContext; program: WebGLProgram;
name: cstring): WebGLUniformLocation
-
Returns the location of a uniform variable.
Source
Edit
proc getVertexAttribOffset(gl: WebGLRenderingContext; index: uint; pname: uint): int64
-
Returns the address of a given vertex attribute.
Source
Edit
proc uniform1f(gl: WebGLRenderingContext; location: WebGLUniformLocation; v0: float32)
-
Specifies a value for a uniform variable.
Source
Edit
proc uniform1fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Float32Array)
-
Source
Edit
proc uniform1i(gl: WebGLRenderingContext; location: WebGLUniformLocation; v0: int)
-
Source
Edit
proc uniform1iv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Int32Array)
-
Source
Edit
proc uniform2f(gl: WebGLRenderingContext; location: WebGLUniformLocation;
v0, v1: float32)
-
Source
Edit
proc uniform2fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Float32Array)
-
Source
Edit
proc uniform2i(gl: WebGLRenderingContext; location: WebGLUniformLocation; v0, v1: int)
-
Source
Edit
proc uniform2iv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Int32Array)
-
Source
Edit
proc uniform3f(gl: WebGLRenderingContext; location: WebGLUniformLocation;
v0, v1, v2: float32)
-
Source
Edit
proc uniform3fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Float32Array)
-
Source
Edit
proc uniform3i(gl: WebGLRenderingContext; location: WebGLUniformLocation;
v0, v1, v2: int)
-
Source
Edit
proc uniform3iv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Int32Array)
-
Source
Edit
proc uniform4f(gl: WebGLRenderingContext; location: WebGLUniformLocation;
v0, v1, v2, v3: float32)
-
Source
Edit
proc uniform4fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Float32Array)
-
Source
Edit
proc uniform4i(gl: WebGLRenderingContext; location: WebGLUniformLocation;
v0, v1, v2, v3: int)
-
Source
Edit
proc uniform4iv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
value: Int32Array)
-
Source
Edit
proc uniformMatrix2fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
transpose: bool; value: Float32Array)
-
Specifies a matrix value for a uniform variable.
Source
Edit
proc uniformMatrix3fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
transpose: bool; value: Float32Array)
-
Source
Edit
proc uniformMatrix4fv(gl: WebGLRenderingContext; location: WebGLUniformLocation;
transpose: bool; value: Float32Array)
-
Source
Edit
proc vertexAttrib1f(gl: WebGLRenderingContext; index: uint; v0: float32)
-
Specifies a value for a generic vertex attribute.
Source
Edit
proc vertexAttrib2f(gl: WebGLRenderingContext; index: uint; v0, v1: float32)
-
Source
Edit
proc vertexAttrib3f(gl: WebGLRenderingContext; index: uint; v0, v1, v2: float32)
-
Source
Edit
proc vertexAttrib4f(gl: WebGLRenderingContext; index: uint; v0, v1, v2, v3: float32)
-
Source
Edit
proc vertexAttrib1fv(gl: WebGLRenderingContext; index: uint; value: Float32Array)
-
Source
Edit
proc vertexAttrib2fv(gl: WebGLRenderingContext; index: uint; value: Float32Array)
-
Source
Edit
proc vertexAttrib3fv(gl: WebGLRenderingContext; index: uint; value: Float32Array)
-
Source
Edit
proc vertexAttrib4fv(gl: WebGLRenderingContext; index: uint; value: Float32Array)
-
Source
Edit
proc vertexAttribPointer(gl: WebGLRenderingContext; index: uint; size: int;
typ: uint | DataType; normalized: bool; stride: int;
offset: int64)
-
Specifies the data formats and locations of vertex attributes in a vertex attributes array.
Source
Edit
proc clear(gl: WebGLRenderingContext; mask: uint | BufferBit)
-
Clears specified buffers to preset values.
Source
Edit
proc drawArrays(gl: WebGLRenderingContext; mode: uint | PrimitiveMode; first: int;
count: int)
-
Renders primitives from array data.
Source
Edit
proc drawElements(gl: WebGLRenderingContext; mode: uint | PrimitiveMode; count: int;
typ: uint | DataType; offset: int64)
-
Renders primitives from element array data.
Source
Edit
proc finish(gl: WebGLRenderingContext)
-
Blocks execution until all previously called commands are finished.
Source
Edit
proc flush(gl: WebGLRenderingContext)
-
Empties different
Source
Edit
proc bufferData(gl: WebGLRenderingContext; target: uint | BufferEnum; size: int64;
usage: uint | BufferEnum)
-
Updates buffer data.
Source
Edit
proc bufferData(gl: WebGLRenderingContext; target: uint | BufferEnum;
data: Int32Array | Uint16Array | Float32Array; usage: uint | BufferEnum)
-
Updates buffer data.
Source
Edit
proc bufferSubData(gl: WebGLRenderingContext; target: uint; offset: int64; data: auto)
-
Updates buffer data starting at a passed offset.
Source
Edit
proc getParameter(gl: WebGLRenderingContext; pname: uint): auto
-
Returns a value for the passed parameter name.
Source
Edit
proc activeTexture(gl: WebGLRenderingContext; texture: auto)
-
Selects the active texture unit.
Source
Edit
proc getProgramParameter(gl: WebGLRenderingContext; program: WebGLProgram;
pname: uint): int
-
Returns information about the program.
Source
Edit
proc getBufferParameter(gl: WebGLRenderingContext; target, pname: uint): auto
-
Returns information about the buffer.
Source
Edit
proc getFramebufferAttachmentParameter(gl: WebGLRenderingContext;
target, attachment, pname: uint): auto
-
Returns information about the framebuffer.
Source
Edit
proc getRenderbufferParameter(gl: WebGLRenderingContext; target, pname: uint): auto
-
Returns information about the framebuffer.
Source
Edit
proc getTexParameter(gl: WebGLRenderingContext; target: uint; pname: uint): auto
-
Returns information about the texture.
Source
Edit
proc getShaderParameter(gl: WebGLRenderingContext; shader: WebGLShader; pname: uint): int
-
Returns information about the shader.
Source
Edit
proc getUniform(gl: WebGLRenderingContext; program: WebGLProgram;
location: WebGLUniformLocation): auto
-
Returns the value of a uniform variable at a given location.
Source
Edit
proc getVertexAttrib(gl: WebGLRenderingContext; index: uint; pname: uint): WebGLBuffer
-
Returns information about a vertex attribute at a given position.
Source
Edit
proc texImage2D(gl: WebGLRenderingContext; target: uint; level: int;
internalformat: int; width, height: int; border: int; format: uint;
typ: uint; pixels: ArrayBufferView)
-
Source
Edit
proc texImage2D(gl: WebGLRenderingContext; target: uint; level: int;
internalformat: uint; format: uint; typ: uint; pixels: dom.ImageElement)
-
Source
Edit
proc texImage2D(gl: WebGLRenderingContext; target: uint; level: int;
internalformat: int; format: uint; typ: uint; pixels: Canvas)
-
Source
Edit
proc texImage2D(gl: WebGLRenderingContext; target: uint; level: int;
internalformat: int; format: uint; typ: uint; pixels: dom.EmbedElement)
-
Source
Edit
proc texSubImage2D(target: uint; level, xoffset, yoffset: int; width, height: int;
format, typ: uint; pixels: ArrayBufferView)
-
Source
Edit
proc texSubImage2D(target: uint; level, xoffset, yoffset: int; format, typ: uint;
pixels: ImageElement)
-
Source
Edit
proc texSubImage2D(target: uint; level, xoffset, yoffset: int; format, typ: uint;
pixels: Canvas)
-
Source
Edit
proc texSubImage2D(target: uint; level, xoffset, yoffset: int; format, typ: uint;
pixels: EmbedElement)
-
Source
Edit
proc getContext(c: Canvas; kind: cstring): WebGLRenderingContext
-
Get the specified context on the given canvas. Does NOT account for eg. experimental-webgl vs webgl etc. See getContextWebgl for that Example: .. code-block:: nim var canvas = dom.document.getElementById("canvas").Canvas var gl = canvas.getContext("webgl")
Source
Edit
proc getContextWebgl(c: Canvas): WebGLRenderingContext {.raises: [], tags: []
.}
-
Get a webgl context on the given canvas. Tries webgl first, then experimental-webgl Example: .. code-block:: nim var canvas = dom.document.getElementById("canvas").Canvas var gl = canvas.getContextWebgl()
Source
Edit
proc getBoundingClientRect(c: Canvas): tuple[top, bottom, left, right: float] {.
raises: [], tags: []
.}
-
Source
Edit
proc log(str: varargs[auto]) {.raises: [], tags: []
.}
-
Source
Edit
proc requestAnimationFrame(fn: proc (time: float)) {.raises: [], tags: []
.}
-
Source
Edit
proc getStatus(gl: WebGLRenderingContext; what: WebGLShader): bool {.raises: [],
tags: []
.}
-
Source
Edit
proc getStatus(gl: WebGLRenderingContext; what: WebGLProgram): bool {.raises: [],
tags: []
.}
-
Source
Edit
proc resize(canvas: Canvas) {.raises: [], tags: []
.}
-
Source
Edit
proc identity4(a: auto): auto
-
Source
Edit
proc traslate4(a, b, c: auto): auto
-
Source
Edit
proc perspective4(a, b, c, d, e: auto): auto
-
Source
Edit