public class RenderingContextWebGL extends RenderingContextBase
| Modifier and Type | Class and Description |
|---|---|
static interface |
RenderingContextWebGL.IWebGLInfoCallback |
| Modifier | Constructor and Description |
|---|---|
protected |
RenderingContextWebGL(BaseCanvasComponent<?,?> canvas) |
| Modifier and Type | Method and Description |
|---|---|
void |
activeTexture(WebGLTexture texture)
Makes the specified texture active.
|
void |
attachShader(WebGLProgram program,
WebGLShader shader)
Attaches either a fragment or vertex WebGLShader to a WebGLProgram.
|
void |
bindBuffer(BufferBinding target,
WebGLBuffer buffer)
Binds a given WebGLBuffer to a target.
|
void |
bindFrameBuffer(FrameBufferBinding target,
WebGLFrameBuffer buffer)
Binds a given WebGLFrameBuffer to a target.
|
void |
bindRenderBuffer(RenderBufferBinding target,
WebGLRenderBuffer buffer)
Binds a given WebGLRenderBuffer to a target.
|
void |
bindTexture(TextureType target,
WebGLTexture texture)
Binds a given WebGLTexture to a target (binding point).
|
void |
blendEquation(BlendMode blendMode)
Sets both the RGB blend equation and alpha blend equation to a single equation.
|
void |
blendEquationSeparate(BlendMode modeRGB,
BlendMode modeAlpha)
Sets the RGB blend equation and alpha blend equation separately.
|
void |
blendFunc(BlendFactor sfactor,
BlendFactor dfactor)
Defines the function used for blending pixel arithmetic.
|
void |
blendFuncSeparate(BlendFactor srcRGB,
BlendFactor dstRGB,
BlendFactor srcAlpha,
BlendFactor dstAlpha)
Defines the function used for blending pixel arithmetic for RGB and alpha components
separately.
|
void |
blendTexture(double red,
double green,
double blue,
double alpha)
Sets the source and destination blending factors.
|
void |
bufferData(BufferBinding target,
ArrayBufferBase srcData,
BufferUsagePattern usage)
Initializes and creates the buffer object's data store.
|
void |
bufferData(BufferBinding target,
ArrayBufferBase srcData,
BufferUsagePattern usage,
int srcOffset,
int length)
Initializes and creates the buffer object's data store.
|
void |
bufferData(BufferBinding target,
int size,
BufferUsagePattern usage)
Initializes and creates the buffer object's data store.
|
void |
bufferSubData(BufferBinding target,
int offset,
ArrayBufferBase srcData)
Updates a subset of a buffer object's data store.
|
void |
bufferSubData(BufferBinding target,
int dstByteOffset,
ArrayBufferBase srcData,
int srcOffset,
int length)
Updates a subset of a buffer object's data store.
|
void |
checkFramebufferStatus(FrameBufferBinding target,
IResponseCallback<FrameBufferStatus> callback)
Returns the completeness status of the WebGLFramebuffer object.
|
void |
clear(BufferBitMask... bitmasks)
Clears buffers to preset values.
|
void |
clearColor(double red,
double green,
double blue,
double alpha)
Specifies the color values used when clearing color buffers.
|
void |
clearDepth(double depth)
Specifies the clear value for the depth buffer.
|
void |
clearStencil(int index)
Specifies the clear value for the stencil buffer.
|
void |
colorMask(boolean red,
boolean green,
boolean blue,
boolean alpha)
Sets which color components to enable or to disable when drawing or rendering to a
WebGLFramebuffer.
|
void |
compileShader(WebGLShader shader)
Compiles a GLSL shader into binary data so that it can be used by a WebGLProgram.
|
void |
copyTexImage2D(TextureType2 target,
int level,
ColorFormat internalformat,
int x,
int y,
int width,
int height)
Copies pixels from the current WebGLFramebuffer into a 2D texture image.
|
void |
copyTexSubImage2D(TextureType2 target,
int level,
int xoffset,
int yoffset,
int x,
int y,
int width,
int height)
Copies pixels from the current WebGLFramebuffer into an existing 2D texture sub-image.
|
ArrayBufferView |
createArrayBufferView(PixelDataType type,
int size)
Creates an empty array buffer view of the specified type.
|
WebGLBuffer |
createBuffer()
Creates and initializes a WebGLBuffer instance for storing data such as vertices or colors.
|
WebGLFrameBuffer |
createFrameBuffer()
Creates and initializes a WebGLFrameBuffer instance.
|
WebGLProgram |
createProgram()
Creates and initializes a WebGLProgram instance.
|
WebGLRenderBuffer |
createRenderBuffer()
Creates and initializes a WebGLRenderBuffer instance.
|
WebGLShader |
createShader(ShaderType type)
Creates a WebGLShader instance of the specified type.
|
WebGLTexture |
createTexture()
Creates a new texture.
|
void |
cullFace(FaceMode mode)
Specifies whether or not front- and/or back-facing polygons can be culled.
|
void |
deleteBuffer(WebGLBuffer buffer)
Deletes a given WebGLBuffer.
|
void |
deleteFrameBuffer(WebGLFrameBuffer buffer)
Deletes a given WebGLFrameBuffer.
|
void |
deleteProgram(WebGLProgram program)
Deletes a given WebGLProgram.
|
void |
deleteRenderBuffer(WebGLRenderBuffer buffer)
Deletes a given WebGLRenderBuffer.
|
void |
deleteShader(WebGLShader shader)
Marks a given WebGLShader object for deletion.
|
void |
deleteTexture(WebGLTexture texture)
Deletes a given WebGLTexture.
|
void |
depthFunc(DepthFunction func)
Specifies a function that compares incoming pixel depth to the current depth buffer value.
|
void |
depthMask(boolean flag)
Sets whether writing into the depth buffer is enabled or disabled.
|
void |
depthRange(double zNear,
double zFar)
Specifies the depth range mapping from normalized device coordinates to window or viewport
coordinates.
|
void |
detachShader(WebGLProgram program,
WebGLShader shader)
Detaches a previously attached WebGLShader from a WebGLProgram.
|
void |
disable(Capability cap)
Disable a WebGL capability.
|
void |
disableVertexAttribArray(int index)
Turns off the generic vertex attribute array at a given index position.
|
void |
drawArrays(DrawMode mode,
int first,
int count)
Renders primitives from array data.
|
void |
drawElements(DrawMode mode,
int count,
ValueType type,
int offset)
Renders primitives from array data.
|
void |
enable(Capability cap)
Enable a WebGL capability.
|
void |
enableVertexAttribArray(int index)
Turns on the generic vertex attribute array at a given index position.
|
void |
finish()
Blocks execution until all previously called commands are finished.
|
void |
flush()
Empties different buffer commands, causing all commands to be executed as quickly as
possible.
|
void |
framebufferRenderbuffer(FrameBufferBinding target,
AttachmentPoint attachment,
RenderBufferBinding renderbuffertarget,
WebGLRenderBuffer renderbuffer)
Attaches a WebGLRenderbuffer object to a WebGLFramebuffer object.
|
void |
framebufferTexture2D(FrameBufferBinding target,
AttachmentPoint attachment,
TextureType2 textarget,
WebGLTexture texture)
Attaches a texture to a WebGLFramebuffer.
|
void |
frontFace(WindingMode mode)
Specifies whether polygons are front- or back-facing by setting a winding orientation.
|
void |
generateMipmap(TextureType target)
Generates a set of mipmaps for a WebGLTexture object.
|
void |
getActiveAttrib(WebGLProgram program,
int index,
RenderingContextWebGL.IWebGLInfoCallback callback)
Returns a WebGLActiveInfo object containing size, type, and name of a vertex attribute.
|
void |
getActiveUniform(WebGLProgram program,
int index,
RenderingContextWebGL.IWebGLInfoCallback callback)
Returns a WebGLActiveInfo object containing size, type, and name of a uniform attribute.
|
Set<WebGLShader> |
getAttachedShaders(WebGLProgram program)
Returns a list of WebGLShader objects attached to a WebGLProgram.
|
void |
getAttribLocation(WebGLProgram program,
String name,
IResponseCallback<Integer> callback)
Returns the location of an attribute variable in a given WebGLProgram.
|
void |
getBufferParameter(BufferBinding target,
BufferParameterType pname,
IResponseCallback<Object> callback)
Returns information about the buffer.
|
void |
getContextAttributes(IResponseCallback<Map<String,Object>> callback)
The actual context parameters, or null if the context is lost.
|
void |
getError(IResponseCallback<ErrorType> callback)
Returns error information.
|
void |
getFramebufferAttachmentParameter(FrameBufferBinding target,
AttachmentPoint attachment,
AttachmentParameterType pname,
IResponseCallback<Object> callback)
Returns information about a framebuffer's attachment.
|
void |
getParameter(ContextParameterType pname,
IResponseCallback<Object> callback)
returns a value for the passed parameter name.
|
void |
getProgramInfoLog(WebGLProgram program,
IResponseCallback<String> callback)
Returns the information log for the specified WebGLProgram object.
|
void |
getProgramParameter(WebGLProgram program,
ProgramParameterType pname,
IResponseCallback<Object> callback)
Returns information about the given program.
|
void |
getRenderbufferParameter(RenderBufferBinding target,
RenderBufferParameterType pname,
IResponseCallback<Object> callback)
Returns information about the renderbuffer.
|
void |
getShaderInfoLog(WebGLShader shader,
IResponseCallback<String> callback)
Returns the information log for the specified WebGLShader object.
|
void |
getShaderParameter(WebGLShader shader,
ShaderParameterType pname,
IResponseCallback<Object> callback)
Returns information about the given shader.
|
void |
getShaderPrecisionFormat(ShaderType shaderType,
PrecisionType precisionType,
IResponseCallback<WebGLShaderPrecisionFormat> callback)
Returns a new WebGLShaderPrecisionFormat object describing the range and precision for the
specified shader numeric format.
|
void |
getShaderSource(WebGLShader shader,
IResponseCallback<String> callback)
Returns the source code of a WebGLShader.
|
void |
getSupportedExtensions(IResponseCallback<String[]> callback)
Returns a list of all the supported WebGL extensions.
|
void |
getTexParameter(TextureType target,
TextureParameterType pname,
IResponseCallback<Object> callback)
Returns information about the given texture.
|
void |
getUniform(WebGLProgram program,
WebGLUniformLocation location,
IResponseCallback<Object> callback)
Returns the value of a uniform variable at a given location.
|
WebGLUniformLocation |
getUniformLocation(WebGLProgram program,
String name)
Returns the location of a specific uniform variable which is part of a given WebGLProgram.
|
void |
getVertexAttrib(int index,
VertexAttributeType pname,
IResponseCallback<Object> callback)
Returns information about a vertex attribute at a given position.
|
void |
getVertexAttribOffset(int index,
VertexAttributeOffsetType pname,
IResponseCallback<Integer> callback)
Returns the address of a specified vertex attribute.
|
void |
hint(HintBehavior target,
HintMode mode)
Specifies hints for certain behaviors.
|
void |
isBuffer(WebGLBuffer buffer,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLBuffer is valid and false otherwise.
|
void |
isContextLost(IResponseCallback<Boolean> callback)
Returns whether or not the WebGL context has been lost.
|
void |
isEnabled(Capability cap,
IResponseCallback<Boolean> callback)
Returns whether a specific WebGL capability is enabled or not for this context.
|
void |
isFramebuffer(WebGLFrameBuffer framebuffer,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLFramebuffer is valid and false otherwise.
|
void |
isProgram(WebGLProgram program,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLProgram is valid and false otherwise.
|
void |
isRenderbuffer(WebGLRenderBuffer renderbuffer,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLRenderBuffer is valid and false otherwise.
|
void |
isShader(WebGLShader shader,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLShader is valid and false otherwise.
|
void |
isTexture(WebGLTexture texture,
IResponseCallback<Boolean> callback)
Returns true if the passed WebGLTexture is valid and false otherwise.
|
void |
linkProgram(WebGLProgram program)
Links a given WebGLProgram to the attached vertex and fragment shaders.
|
void |
pixelStorei(PixelStorageParameter pname,
Object value)
Specifies the pixel storage modes.
|
void |
polygonOffset(double factor,
double units)
Specifies the scale factors and units to calculate depth values.
|
void |
readPixels(int x,
int y,
int width,
int height,
PixelFormat format,
ArrayBufferView pixels)
Reads a block of pixels from a specified rectangle of the current color framebuffer into an
ArrayBufferView object.
|
void |
readPixels(int x,
int y,
int width,
int height,
PixelFormat format,
ArrayBufferView pixels,
int offset)
Reads a block of pixels from a specified rectangle of the current color framebuffer into an
ArrayBufferView object.
|
void |
renderbufferStorage(RenderBufferBinding target,
RenderBufferInternalFormat internalFormat,
int width,
int height)
Creates and initializes a renderbuffer object's data store.
|
void |
sampleCoverage(double value,
boolean invert)
Specifies multi-sample coverage parameters for anti-aliasing effects.
|
void |
scissor(int x,
int y,
int width,
int height)
Sets a scissor box, which limits the drawing to a specified rectangle.
|
void |
shaderSource(WebGLShader shader,
String source)
Sets the source code of a WebGLShader.
|
void |
stencilFunc(DepthFunction func,
int ref,
int mask)
Sets the front and back function and reference value for stencil testing.
|
void |
stencilFuncSeparate(FaceMode face,
DepthFunction func,
int ref,
int mask)
Sets the front and back function and reference value for stencil testing.
|
void |
stencilMask(int mask)
Controls enabling and disabling of both the front and back writing of individual bits in the
stencil planes.
|
void |
stencilMaskSeparate(FaceMode face,
int mask)
Controls enabling and disabling of the front and/or back writing of individual bits in the
stencil planes.
|
void |
stencilOp(StencilFunction fail,
StencilFunction zfail,
StencilFunction zpass)
Sets both the front and back-facing stencil test actions.
|
void |
stencilOpSeparate(FaceMode face,
StencilFunction fail,
StencilFunction zfail,
StencilFunction zpass)
Sets the front and/or back-facing stencil test actions.
|
void |
texImage2D(TextureType2 target,
int level,
TextureBufferInternalFormat internalformat,
int width,
int height,
TextureBufferInternalFormat format,
ArrayBufferView pixels)
Specifies a two-dimensional texture image.
|
void |
texParameterf(TextureType target,
TextureParameterType pname,
double param)
Set texture parameters.
|
void |
texParameteri(TextureType target,
TextureParameterType pname,
int param)
Set texture parameters.
|
void |
texSubImage2D(TextureType2 target,
int level,
int xoffset,
int yoffset,
int width,
int height,
TextureFormat format,
ArrayBufferView pixels)
Specifies a sub-rectangle of the current texture.
|
void |
uniform(WebGLUniformLocation location,
Double... values)
Specify values of uniform variables.
|
void |
uniform(WebGLUniformLocation location,
Integer... values)
Specify values of uniform variables.
|
void |
uniformMatrix(WebGLUniformLocation location,
Double... values)
Specify values of uniform variables.
|
void |
useProgram(WebGLProgram program)
Sets the specified WebGLProgram as part of the current rendering state.
|
void |
validateProgram(WebGLProgram program)
Checks if the program is successfully linked and if it can be used in the current WebGL
state.
|
void |
vertexAttrib(int index,
Double... values)
Specify constant values for generic vertex attributes.
|
void |
vertexAttribPointer(int index,
int size,
ValueType type,
boolean normalized,
int stride,
int offset)
Binds the buffer currently bound to ARRAY_BUFFER to a generic vertex attribute of the current
vertex buffer object and specifies its layout.
|
void |
viewport(int x,
int y,
int width,
int height)
Sets the viewport, which specifies the affine transformation of x and y from normalized
device coordinates to window coordinates.
|
getTypecallback, config, config, destroy, finalize, getCanvas, init, init, initResource, invoke, invoke, transformForClientprotected RenderingContextWebGL(BaseCanvasComponent<?,?> canvas)
public void activeTexture(WebGLTexture texture)
texture - Texture to make active.public void attachShader(WebGLProgram program, WebGLShader shader)
program - The program.shader - The shader to attach.public void bindBuffer(BufferBinding target, WebGLBuffer buffer)
target - The binding point.buffer - The buffer to bind.public void bindFrameBuffer(FrameBufferBinding target, WebGLFrameBuffer buffer)
target - The binding point.buffer - The buffer to bind.public void bindRenderBuffer(RenderBufferBinding target, WebGLRenderBuffer buffer)
target - The binding point.buffer - The buffer to bind.public void bindTexture(TextureType target, WebGLTexture texture)
target - The binding point.texture - The texture to bind.public void blendEquation(BlendMode blendMode)
blendMode - Specifies how source and destination colors are combined.public void blendEquationSeparate(BlendMode modeRGB, BlendMode modeAlpha)
modeRGB - Specifies how the red, green and blue components of source and destination
colors are combined.modeAlpha - how the alpha component (transparency) of source and destination colors are
combined.public void blendFunc(BlendFactor sfactor, BlendFactor dfactor)
sfactor - A multiplier for the source blending factors.
Default: ONE
dfactor - A multiplier for the destination blending factors.
Default: ZERO
public void blendFuncSeparate(BlendFactor srcRGB, BlendFactor dstRGB, BlendFactor srcAlpha, BlendFactor dstAlpha)
srcRGB - Multiplier for the red, green and blue (RGB) source blending factors.
Default: ONE
dstRGB - Multiplier for the red, green and blue (RGB) destination blending factors.
Default: ZERO
srcAlpha - Multiplier for the alpha source blending factor.
Default: ONE
dstAlpha - Multiplier for the alpha destination blending factor.
Default: ZERO
public void blendTexture(double red,
double green,
double blue,
double alpha)
red - Value for the red component in the range of 0 to 1.green - Value for the green component in the range of 0 to 1.blue - Value for the blue component in the range of 0 to 1.alpha - Value for the alpha component in the range of 0 to 1.public void bufferData(BufferBinding target, int size, BufferUsagePattern usage)
target - The binding point (target).size - The size of the buffer object's data store.usage - The usage pattern of the data store.public void bufferData(BufferBinding target, ArrayBufferBase srcData, BufferUsagePattern usage)
target - The binding point (target).srcData - Data that will be copied into the data store. If null, a data store is still
created, but the content is uninitialized and undefined.usage - The usage pattern of the data store.public void bufferData(BufferBinding target, ArrayBufferBase srcData, BufferUsagePattern usage, int srcOffset, int length)
target - The binding point (target).srcData - Data that will be copied into the data store. If null, a data store is still
created, but the content is uninitialized and undefined.usage - The usage pattern of the data store.srcOffset - The element index offset where to start reading the buffer.length - ? Defaults to 0.public void bufferSubData(BufferBinding target, int offset, ArrayBufferBase srcData)
target - The binding point (target).offset - Offset in bytes where the data replacement will start.srcData - Data that will be copied into the data store.public void bufferSubData(BufferBinding target, int dstByteOffset, ArrayBufferBase srcData, int srcOffset, int length)
target - The binding point (target).dstByteOffset - Offset in bytes where the data replacement will start.srcData - Data that will be copied into the data store.srcOffset - The element index offset where to start reading the buffer.length - ? Defaults to 0.public void checkFramebufferStatus(FrameBufferBinding target, IResponseCallback<FrameBufferStatus> callback)
target - The binding point (target).callback - Call back to receive result.public void clear(BufferBitMask... bitmasks)
bitmasks - Bitwise OR mask that indicates the buffers to be cleared.public void clearColor(double red,
double green,
double blue,
double alpha)
red - The red color value used when the color buffers are cleared.
Default: 0
green - The green color value used when the color buffers are cleared.
Default: 0
blue - The blue color value used when the color buffers are cleared.
Default: 0
alpha - The alpha value used when the color buffers are cleared.
Default: 0
public void clearDepth(double depth)
depth - The depth value used when the depth buffer is cleared.
Default: 1
public void clearStencil(int index)
index - The index used when the stencil buffer is cleared.
Default: 0
public void colorMask(boolean red,
boolean green,
boolean blue,
boolean alpha)
red - Whether or not the red color component can be written into the frame buffer.
Default: true
green - Whether or not the green color component can be written into the frame buffer.
Default: true
blue - Whether or not the blue color component can be written into the frame buffer.
Default: true
alpha - Whether or not the alpha component can be written into the frame buffer.
Default: true
public void compileShader(WebGLShader shader)
shader - Shader to compile.public void copyTexImage2D(TextureType2 target, int level, ColorFormat internalformat, int x, int y, int width, int height)
target - The binding target of the active texture.level - The level of detail. Level 0 is the base image level and level n is the nth
mipmap reduction level.internalformat - The color components in the texture.x - The x coordinate of the lower left corner where to start copying.y - The y coordinate of the lower left corner where to start copying.width - The width of the texture.height - The height of the texture.public void copyTexSubImage2D(TextureType2 target, int level, int xoffset, int yoffset, int x, int y, int width, int height)
target - The binding target of the active texture.level - The level of detail. Level 0 is the base image level and level n is the nth
mipmap reduction level.xoffset - The horizontal offset within the texture image.yoffset - The vertical offset within the texture image.x - The x coordinate of the lower left corner where to start copying.y - The y coordinate of the lower left corner where to start copying.width - The width of the texture.height - The height of the texture.public ArrayBufferView createArrayBufferView(PixelDataType type, int size)
type - The pixel data type.size - The size of the array.public WebGLBuffer createBuffer()
public WebGLFrameBuffer createFrameBuffer()
public WebGLProgram createProgram()
public WebGLRenderBuffer createRenderBuffer()
public WebGLShader createShader(ShaderType type)
type - The shader type.public WebGLTexture createTexture()
public void cullFace(FaceMode mode)
mode - The culling mode.public void deleteBuffer(WebGLBuffer buffer)
buffer - Buffer to delete.public void deleteFrameBuffer(WebGLFrameBuffer buffer)
buffer - Buffer to delete.public void deleteProgram(WebGLProgram program)
program - Program to delete.public void deleteRenderBuffer(WebGLRenderBuffer buffer)
buffer - Buffer to delete.public void deleteShader(WebGLShader shader)
shader - Shader to delete.public void deleteTexture(WebGLTexture texture)
texture - Texture to delete.public void depthFunc(DepthFunction func)
func - The depth comparison function, which sets the conditions under which the pixel
will be drawn.
Default: LESS
public void depthMask(boolean flag)
flag - If true, writing into the depth buffer is enabled.public void depthRange(double zNear,
double zFar)
zNear - Specifies the mapping of the near clipping plane to window or viewport
coordinates. Clamped to the range 0 to 1 and must be less than or equal to zFar.
Constraints: ≥0 and ≤1
Default: 0
zFar - Specifies the mapping of the far clipping plane to window or viewport
coordinates.
Constraints: ≥0 and ≤1
Default: 1
public void detachShader(WebGLProgram program, WebGLShader shader)
program - A program.shader - The shader to detach.public void disable(Capability cap)
cap - The WebGL capability to disable.public void disableVertexAttribArray(int index)
index - The index position.public void drawArrays(DrawMode mode, int first, int count)
mode - The drawing mode.first - The starting index in the array of vector points.count - The number of indices to be rendered.public void drawElements(DrawMode mode, int count, ValueType type, int offset)
mode - The drawing mode.count - The number of elements to be rendered.type - The type of the values in the element array buffer.
Constraints: one of UNSIGNED_BYTE, UNSIGNED_SHORT, UNSIGNED_INT
offset - The offset in the element array buffer. Must be a valid multiple of the size of
the given type.public void enable(Capability cap)
cap - The WebGL capability to enable.public void enableVertexAttribArray(int index)
index - The index position.public void finish()
public void flush()
public void framebufferRenderbuffer(FrameBufferBinding target, AttachmentPoint attachment, RenderBufferBinding renderbuffertarget, WebGLRenderBuffer renderbuffer)
target - The binding point (target) for the frame buffer.attachment - The attachment point for the buffer.renderbuffertarget - The binding point (target) for the render buffer.renderbuffer - The render buffer to attach.public void framebufferTexture2D(FrameBufferBinding target, AttachmentPoint attachment, TextureType2 textarget, WebGLTexture texture)
target - The binding point (target) for the frame buffer.attachment - The attachment point for the buffer.textarget - The texture target.texture - The texture whose image is to be attached.public void frontFace(WindingMode mode)
mode - The winding orientation.
Default: CCW
public void generateMipmap(TextureType target)
target - The binding point (target) of the active texture whose mipmaps will be
generated.public void getActiveAttrib(WebGLProgram program, int index, RenderingContextWebGL.IWebGLInfoCallback callback)
program - A WebGLProgram containing the vertex attribute.index - The index of the vertex attribute to get. This value is an index 0 to N - 1 as
returned by gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES).callback - Callback to receive result.public void getActiveUniform(WebGLProgram program, int index, RenderingContextWebGL.IWebGLInfoCallback callback)
program - A WebGLProgram specifying the WebGL shader program from which to obtain the
uniform variable's information.index - The index of the uniform attribute to get. This value is an index 0 to N - 1 as
returned by gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS).callback - Callback to receive result.public Set<WebGLShader> getAttachedShaders(WebGLProgram program)
program - A WebGLProgram object to get attached shaders for.public void getAttribLocation(WebGLProgram program, String name, IResponseCallback<Integer> callback)
program - A WebGLProgram containing the attribute variable.name - A DOMString specifying the name of the attribute variable whose location to get.callback - Callback to receive result.public void getBufferParameter(BufferBinding target, BufferParameterType pname, IResponseCallback<Object> callback)
target - The target buffer object.pname - Requested parameter. If BUFFER_SIZE, the response will be the size of the buffer
in bytes. If BUFFER_USAGE, the response will be a BufferUsagePattern.callback - Callback to receive result.public void getContextAttributes(IResponseCallback<Map<String,Object>> callback)
callback - Callback to receive result.public void getError(IResponseCallback<ErrorType> callback)
callback - Callback to receive result.public void getFramebufferAttachmentParameter(FrameBufferBinding target, AttachmentPoint attachment, AttachmentParameterType pname, IResponseCallback<Object> callback)
target - The binding point (target).attachment - The attachment point for the texture.pname - Information to query.callback - Callback to receive result.public void getParameter(ContextParameterType pname, IResponseCallback<Object> callback)
pname - Parameter value to return.callback - Callback to receive result.public void getProgramInfoLog(WebGLProgram program, IResponseCallback<String> callback)
program - A WebGLProgram to query.callback - Callback to receive result.public void getProgramParameter(WebGLProgram program, ProgramParameterType pname, IResponseCallback<Object> callback)
program - A WebGLProgram to get parameter information from.pname - The information to querycallback - Callback to receive result.public void getRenderbufferParameter(RenderBufferBinding target, RenderBufferParameterType pname, IResponseCallback<Object> callback)
target - The target renderbuffer object.pname - The information to query.callback - Callback to receive result.public void getShaderInfoLog(WebGLShader shader, IResponseCallback<String> callback)
shader - A WebGLShader to query.callback - Callback to receive result.public void getShaderParameter(WebGLShader shader, ShaderParameterType pname, IResponseCallback<Object> callback)
shader - A WebGLShader to get parameter information from.pname - The information to query.callback - Callback to receive result.public void getShaderPrecisionFormat(ShaderType shaderType, PrecisionType precisionType, IResponseCallback<WebGLShaderPrecisionFormat> callback)
shaderType - The shader type.precisionType - The precision type.callback - Callback to receive result.public void getShaderSource(WebGLShader shader, IResponseCallback<String> callback)
shader - A WebGLShader object to get the source code from.callback - Callback to receive result.public void getSupportedExtensions(IResponseCallback<String[]> callback)
callback - Callback to receive result.public void getTexParameter(TextureType target, TextureParameterType pname, IResponseCallback<Object> callback)
target - The binding point (target).pname - The information to querycallback - Callback to receive result.public void getUniform(WebGLProgram program, WebGLUniformLocation location, IResponseCallback<Object> callback)
program - A WebGLProgram containing the uniform attribute.location - A WebGLUniformLocation object containing the location of the uniform
attribute to get.callback - Callback to receive result.public WebGLUniformLocation getUniformLocation(WebGLProgram program, String name)
program - The WebGLProgram in which to locate the specified uniform variable.name - the name of the uniform variable whose location is to be returned. The name can't
have any whitespace in it, and you can't use this function to get the location of
any uniforms starting with the reserved string "gl_", since those are internal to
the WebGL layer. The possible values correspond to the uniform names returned by
getActiveUniform(org.fujion.canvas.webgl.WebGLProgram, int, org.fujion.canvas.webgl.RenderingContextWebGL.IWebGLInfoCallback). Additionally, for uniforms declared as arrays, the
following names are also valid:
public void getVertexAttrib(int index,
VertexAttributeType pname,
IResponseCallback<Object> callback)
index - The index of the vertex attribute.pname - The information to querycallback - Callback to receive result.public void getVertexAttribOffset(int index,
VertexAttributeOffsetType pname,
IResponseCallback<Integer> callback)
index - The index of the vertex attribute.pname - The type of attribute offset.callback - Callback to receive result.public void hint(HintBehavior target, HintMode mode)
target - Which behavior to be controlled.mode - The behavior mode.public void isBuffer(WebGLBuffer buffer, IResponseCallback<Boolean> callback)
buffer - A WebGLBuffer to check.callback - Callback to receive result.public void isContextLost(IResponseCallback<Boolean> callback)
callback - Callback to receive result.public void isEnabled(Capability cap, IResponseCallback<Boolean> callback)
cap - Which WebGL capability to test.callback - Callback to receive result.public void isFramebuffer(WebGLFrameBuffer framebuffer, IResponseCallback<Boolean> callback)
framebuffer - A WebGLFramebuffer to check.callback - Callback to receive result.public void isProgram(WebGLProgram program, IResponseCallback<Boolean> callback)
program - A WebGLProgram to check.callback - Callback to receive result.public void isRenderbuffer(WebGLRenderBuffer renderbuffer, IResponseCallback<Boolean> callback)
renderbuffer - A WebGLRenderBuffer to check.callback - Callback to receive result.public void isShader(WebGLShader shader, IResponseCallback<Boolean> callback)
shader - A WebGLShader to check.callback - Callback to receive result.public void isTexture(WebGLTexture texture, IResponseCallback<Boolean> callback)
texture - A WebGLTexture to check.callback - Callback to receive result.public void linkProgram(WebGLProgram program)
program - Program to link.public void pixelStorei(PixelStorageParameter pname, Object value)
pname - The parameter to set.value - The value to set into the parameter.public void polygonOffset(double factor,
double units)
factor - The scale factor for the variable depth offset for each polygon.
Default: 0
units - The multiplier by which an implementation-specific value is multiplied with to
create a constant depth offset.
Default: 0
public void readPixels(int x,
int y,
int width,
int height,
PixelFormat format,
ArrayBufferView pixels)
x - The first horizontal pixel that is read from the lower left corner of a rectangular
block of pixels.y - The first vertical pixel that is read from the lower left corner of a rectangular
block of pixels.width - The width of the rectangle.height - The height of the rectangle.format - The format of the pixel data.pixels - An ArrayBufferView object to read data into.public void readPixels(int x,
int y,
int width,
int height,
PixelFormat format,
ArrayBufferView pixels,
int offset)
x - The first horizontal pixel that is read from the lower left corner of a rectangular
block of pixels.y - The first vertical pixel that is read from the lower left corner of a rectangular
block of pixels.width - The width of the rectangle.height - The height of the rectangle.format - The format of the pixel data.pixels - An ArrayBufferView object to read data into.offset - The starting array position.public void renderbufferStorage(RenderBufferBinding target, RenderBufferInternalFormat internalFormat, int width, int height)
target - The target renderbuffer object.internalFormat - The internal format of the renderbuffer.width - The width of the renderbuffer in pixels.height - The height of the renderbuffer in pixels.public void sampleCoverage(double value,
boolean invert)
value - Coverage value.
Constraints: ≥0 and ≤1
Default: 1.0
invert - Whether or not the coverage masks should be inverted.
Default: false
public void scissor(int x,
int y,
int width,
int height)
x - The horizontal coordinate for the lower left corner of the box.
Default: 0
y - The vertical coordinate for the lower left corner of the box.
Default: 0
width - The width of the scissor box.
Default: width of the canvas
height - The height of the scissor box.
Default: height of the canvas
public void shaderSource(WebGLShader shader, String source)
shader - A WebGLShader object in which to set the source code.source - The GLSL source code to set.public void stencilFunc(DepthFunction func, int ref, int mask)
func - The test function.
Default: ALWAYS
ref - the reference value for the stencil test.
Constraints: ≥0 and ≤2n-1, where n is the number of bitplanes in the stencil buffer.
Default: 0
mask - A bit-wise mask that is used to AND the reference value and the stored stencil
value when the test is done.
Default: all 1's
public void stencilFuncSeparate(FaceMode face, DepthFunction func, int ref, int mask)
face - Whether the front and/or back stencil state is updated.func - The test function.
Default: ALWAYS
ref - the reference value for the stencil test.
Constraints: ≥0 and ≤2n-1, where n is the number of bitplanes in the stencil buffer.
Default: 0
mask - A bit-wise mask that is used to AND the reference value and the stored stencil
value when the test is done.
Default: all 1's
public void stencilMask(int mask)
stencilMaskSeparate(org.fujion.canvas.webgl.FaceMode, int) method can set front and back stencil
writemasks to different values.mask - a bit mask to enable or disable writing of individual bits in the stencil planes.
Default: all 1's
public void stencilMaskSeparate(FaceMode face, int mask)
stencilMaskSeparate(org.fujion.canvas.webgl.FaceMode, int) method can set front and back stencil
writemasks to different values.face - Whether the front and/or back stencil writemask is updated.mask - a bit mask to enable or disable writing of individual bits in the stencil planes.
Default: all 1's
public void stencilOp(StencilFunction fail, StencilFunction zfail, StencilFunction zpass)
fail - The function to use when the stencil test fails.
Default: KEEP
zfail - the function to use when the stencil test passes, but the depth test fails.
Default: KEEP
zpass - the function to use when both the stencil test and the depth test pass, or when
the stencil test passes and there is no depth buffer or depth testing is disabled.
Default: KEEP
public void stencilOpSeparate(FaceMode face, StencilFunction fail, StencilFunction zfail, StencilFunction zpass)
face - The face mode.fail - The function to use when the stencil test fails.
Default: KEEP
zfail - the function to use when the stencil test passes, but the depth test fails.
Default: KEEP
zpass - the function to use when both the stencil test and the depth test pass, or when
the stencil test passes and there is no depth buffer or depth testing is disabled.
Default: KEEP
public void texImage2D(TextureType2 target, int level, TextureBufferInternalFormat internalformat, int width, int height, TextureBufferInternalFormat format, ArrayBufferView pixels)
target - The binding point (target) of the active texture.level - The level of detail. Level 0 is the base image level and level n is the nth
mipmap reduction level.internalformat - The color components in the texture.width - the width of the texture.height - the height of the texture.format - the format of the texel data. In WebGL 1, this must be the same as
internalformat (see above). In WebGL 2, the combinations are listed in this
table.pixels - The ArrayViewBuffer.public void texParameterf(TextureType target, TextureParameterType pname, double param)
target - The binding point (target).pname - The texture parameter to set.param - The value to set into the parameter. See texParameter
for information on value constraints.public void texParameteri(TextureType target, TextureParameterType pname, int param)
target - The binding point (target).pname - The texture parameter to set.param - The value to set into the parameter. See texParameter
for information on value constraints.public void texSubImage2D(TextureType2 target, int level, int xoffset, int yoffset, int width, int height, TextureFormat format, ArrayBufferView pixels)
target - the binding point (target) of the active texture.level - the level of detail. Level 0 is the base image level and level n is the nth
mipmap reduction level.xoffset - the horizontal offset within the texture image.yoffset - the vertical offset within the texture image.width - the width of the texture.height - the height of the texture.format - the format of the texel data.pixels - The array buffer view.public void uniform(WebGLUniformLocation location, Double... values)
location - A WebGLUniformLocation object containing the location of the uniform
attribute to modify.values - The value(s) to set.public void uniform(WebGLUniformLocation location, Integer... values)
location - A WebGLUniformLocation object containing the location of the uniform
attribute to modify.values - The value(s) to set.public void uniformMatrix(WebGLUniformLocation location, Double... values)
location - A WebGLUniformLocation object containing the location of the uniform
attribute to modify.values - The value(s) to set.public void useProgram(WebGLProgram program)
program - A WebGLProgram to use.public void validateProgram(WebGLProgram program)
program - The program to check.public void vertexAttrib(int index,
Double... values)
index - The position of the vertex attribute to be modified.values - The vertex attribute value(s).public void vertexAttribPointer(int index,
int size,
ValueType type,
boolean normalized,
int stride,
int offset)
index - The index of the vertex attribute that is to be modified.size - The number of components per vertex attribute.
Constraints: 1, 2, 3, or 4
type - The data type of each component in the array.
Constraints: one of BYTE, SHORT, UNSIGNED_BYTE, UNSIGNED_SHORT, FLOAT, HALF_FLOAT
normalized - Whether integer data values should be normalized into a certain range when
being casted to a float.stride - The offset in bytes between the beginning of consecutive vertex attributes.
Cannot be larger than 255. If stride is 0, the attribute is assumed to be tightly
packed, that is, the attributes are not interleaved but each attribute is in a
separate block, and the next vertex' attribute follows immediately after the
current vertex.offset - Offset in bytes of the first component in the vertex attribute array. Must be a
multiple of type.public void viewport(int x,
int y,
int width,
int height)
x - The horizontal coordinate for the lower left corner of the viewport origin.
Default: 0
y - The vertical coordinate for the lower left corner of the viewport origin.
Default: 0
width - The width of the viewport.
Default: width of the canvas.
height - The height of the viewport.
Default: height of the canvas.
Copyright © 2018 Regenstrief Center for Biomedical Informatics. All rights reserved.