HTML and CSS Reference
In-Depth Information
Table 9-1. Functions That Modify State
State
Functions
blendColor
blendEquation
blendEquationSeparate
blendFunc
blendFuncSeparate
depthFunc
stencilFunc
stencilFuncSeparate
stencilOp
stencilOpSeparate
enableVertexAttribArray
clearColor
clearDepth
clearStencil
colorMask
depthMask
stencilMask
stencilMaskSeparate
depthRange
scissor
viewport
disableVertexAttribArray
useProgram
activeTexture
bindTexture
bindBuffer
enable
disable
bindFramebuffer
cullFace
frontFace
lineWidth
polygonOffset
Global
uniform[1234][fi]
uniform[1234][fi]v
uniformMatrix[234]fv
vertexAttrib[1234]f
vertexAttrib[1234]fv
vertexAttribPointer
Programs
texParameterf
texParameteri
texImage2D
Textures
framebufferRenderBuffer
frameBufferTexture2D
Framebuffers
WebGL also allows the state of itself or its objects to be queried. These calls should be avoided, as they can be
very costly, and, at their worst, they can cause the pipeline to stall completely.
The only real exception to this rule, with regard to global state, is during the startup process, as the application can use
this time to determine what features are available with the implementation, such as the number of texture units present.
With shader programs it's perfectly valid to query the uniform information after creation; however, this should
only happen once, as the value returned will be unchanged. The information for setting the value later can easily be
stored by the application for future use.
During development it's highly recommended that you check for any errors, using getError after every call.
Yet, this should not go into production. The Khronos Group, the consortium that oversees the WebGL specification,
provides a debug context for WebGL applications using JavaScript, and doing the same sort of wrapper is trivial in
Dart through noSuchMethod invocations.
Any calls enumerated in Table 9-2 will query the state of WebGL.
Table 9-2. Functions That Query State
State
Functions
getParameter
getError
isEnabled
readPixels
Global
getActiveAttrib
getAttribLocation
isProgram
getActiveUniform
getUniform
getProgramParameter
getVertexAttrib
getVertexAttribOffset
getProgramInfoLog
Programs
isTexture
getTexParameter
Textures
isBuffer
getBufferParameter
Buffers
isRenderbuffer
getRenderbufferParameter
Renderbuffers
checkFramebufferStatus
getFramebufferAttachmentParameter
isFramebuffer
Framebuffers
 
 
Search WWH ::




Custom Search