WebGL Cheat Sheet v0.2
Buffers
Object
createBuffer
void
void
deleteBuffer
Object buffer
void
bindBuffer
ulong target,
Object buffer
void
bufferData
ulong target,
Object dta,
ulong usage
void
bufferData
ulong target,
long size,
ulong usage
void
bufferSubData
ulong target,
ulong offset,
Object data
any
getBufferParameter
ulong target,
ulong value
bool
isBuffer
Object buffer
any
getParameter
ulong pname
Renderbuffers
Object
createRenderbuffer
void
void
deleteRenderbuffer
Object buffer
void
bindRenderbuffer
ulong target,
Object buffer
any
getRenderbufferParameter
ulong target,
ulong pname
void
renderbufferStorage
ulong target,
ulong format,
ulong width,
ulong height
bool
isRenderbuffer
Object buffer
any
getParameter
ulong pname
Framebuffers
Object
createFramebuffer
void
void
deleteFramebuffer
Object buffer
void
bindFramebuffer
ulong target,
Object buffer
ulong
checkFramebufferStatus
ulong target
ulong
framebufferRenderbuffer
ulong target,
ulong att,
ulong rbtarget,
Object rbuffer
any
getFramebufferAttachmentParameter
ulong target,
ulong attachment,
ulong pname
ulong
framebufferTexture2D
ulong target,
ulong att,
ulong textarget,
Object tex,
ulong level
void
pixelStorei
ulong pname,
long param
Array
readPixels
long x,
long y,
ulong width,
ulong height,
ulong format,
ulong type
bool
isFramebuffer
Object buffer
any
getParameter
ulong pname
Program objects
Object
createProgram
void
void
validateProgram
Object program
void
linkProgram
Object program
void
useProgram
ulong program
void
deleteProgram
Object program
any
getProgramParameter
Object pgm,
ulong pname
string
getProgramInfoLog
Object program
bool
isProgram
Object program
any
getParameter
ulong pname
Shaders
Return
Name
Object
createShader
ulong shaderType
void
compileShader
Object shader
void
attachShader
Object program,
Object shader
void
detachShader
Object program,
Object shader
void
deleteShader
Object shader
any
getShaderParameter
Object shader,
ulong pname
string
getShaderInfoLog
Object shader
string
getShaderSource
Object shader
void
shaderSource
Object shader,
string source
Array
getAttachedShaders1
Object program
bool
isShader
Object shader
any
getParameter
ulong pname
Culling
void
enable|disable
CULL_FACE
void
cullFace
ulong mode
void
frontFace
ulong mode
any
getParameter
ulong pname
Textures
Object
createTexture
void
void
deleteTexture
Object texture
void
bindTexture
ulong target,
Object texture
void
activeTexture
ulong texture
any
getTexParameter
ulong target,
ulong pname
void
texParameterf
ulong target,
ulong pname,
float v
void
texParameteri
ulong target,
ulong pname,
long v
void
texImage2D
ulong target,
long level,
ulong intformat,
ulong width,
ulong height,
long border,
ulong format,
ulong type,
Object data
void
texImage2D
ulong target,
long level,
Object data,
[bool flipY],
[bool asPreMultipliedAlpha]
void
texSubImage2D
ulong target,
long level,
long xoffset,
long yoffset,
ulong width,
ulong height,
ulong format,
ulong type,
Object data
void
texSubImage2D
ulong target,
long level,
long xoffset,
long yoffset,
Object data,
[bool flipY],
[bool asPreMultipliedAlpha]
void
copyTexImage2D
ulong target,
long level,
ulong intformat,
long x,
long y,
ulong width,
ulong height,
long border
void
copyTexSubImage2D
ulong target,
long level,
ulong intformat,
long xoffset,
long yoffset,
long x,
long y,
ulong width,
ulong height
void
generateMipmap
ulong target
bool
isTexture
Object buffer
any
getParameter
ulong pname
Blending
void
enable|disable
BLEND
void
blendFunc
ulong sfactor,
ulong dfactor
void
blendFuncSeparate
ulong srcRGB,
ulong dstRGB,
ulong srcAlpha,
ulong dstAlpha
void
blendEquation
ulong mode
void
blendEquationSeparate
ulong modeRGB,
ulong modeAlpha
void
blendColor
float red,
float green,
float blue,
float alpha
any
getParameter
ulong pname
Depth buffer
void
enable|disable
DEPTH_TEST
void
depthFunc
ulong func
void
depthMask
bool flag
void
depthRange
float nearVal,
float farVal
void
clearDepth
float depth
void
enable|disable
POLYGON_OFFSET_FILL
void
polygonOffset
float factor,
float units
any
getParameter
ulong pname
Stencil buffer
void
enable|disable
STENCIL_TEST
void
stencilFunc
ulong func,
long ref,
ulong mask
void
stencilFuncSeparate
ulong face,
ulong func,
long ref,
ulong mask
void
stencilMask
ulong mask
void
stencilMaskSeparate
ulong face,
ulong mask
void
stencilOp
ulong sfail,
ulong dpfail,
ulong dppass
void
stencilOpSeparate
ulong face,
ulong sfail,
ulong dpfail,
ulong dppass
void
clearStencil
long s
any
getParameter
ulong pname
Array data
Object
createFloatArray
Array values
Object
createByteArray
Array values
Object
createUnsignedByteArray
Array values
Object
createShortArray
Array values
Object
createUnsignedShortArray
Array values
Object
createIntArray
Array values
Object
createUnsignedIntArray
Array values
void
drawArrays
ulong mode,
long first,
ulong count
void
drawElements
ulong mode,
ulong count,
ulong type,
ulong offset
Uniform variables
ulong
getUniformLocation
Object program,
string name
Object
getActiveUniform
Object program,
ulong idx
any
getUniform
Object program,
ulong location
void
uniform[1234][if]
ulong location,
...
void
uniform[1234][if]v
ulong location,
Array v
void
uniformMatrix[234]fv
ulong location,
bool transpose,
Object value
any
getParameter
ulong pname
Attribute variables
ulong
getAttribLocation
Object program,
string name
Object
getActiveAttrib
Object program,
ulong idx
any
getVertexAttrib
Object idx,
ulong pname
void
vertexAttribPointer
ulong idx,
long size,
ulong type,
bool norm,
long stride,
ulong offset
void
vertexAttrib[1234]f
ulong idx,
...
void
vertexAttrib[1234]fv
ulong idx,
Array v
void
bindAttribLocation
Object program,
ulong idx,
string name
void
enableVertexAttribArray
ulong idx
void
disableVertexAttribArray
ulong idx
any
getParameter
ulong pname
Multisampling
void
enable|disable
SAMPLE_COVERAGE
void
enable|disable
SAMPLE_ALPHA_TO_COVERAGE
void
sampleCoverage
float value,
bool invert
any
getParameter
ulong pname
Misc.
void
viewport
long x,
long y,
ulong w,
ulong h
void
lineWidth
float width
void
flush
void
void
finish
void
void
clear
ulong mask
void
enable|disable
DITHER
void
colorMask
bool red,
bool green,
bool blue,
bool alpha
void
clearColor
float red,
float green,
float blue,
float alpha
void
scissor
long x, long y,
ulong width, ulong height
ulong
getError
void
any
getParameter
ulong pname