public static class WebGLContext.Attributes
extends com.google.gwt.core.client.JavaScriptObject
Modifier | Constructor and Description |
---|---|
protected |
Attributes() |
Modifier and Type | Method and Description |
---|---|
static WebGLContext.Attributes |
create()
Creates an Attributes object with the default values as specified in the WebGL 1.0 Specification.
|
boolean |
getAlpha()
Returns whether the draw buffer has an alpha channel.
|
boolean |
getAntialias()
Returns whether anti aliasing is enabled.
|
boolean |
getDepth()
Returns the depth property of the WebGLContext.
|
boolean |
getFailIfMajorPerformanceCaveat()
If the value is true, context creation will fail if the implementation determines that the performance of
the created WebGL context would be dramatically lower than that of a native application making equivalent
OpenGL calls.
|
boolean |
getPremultipliedAlpha()
If the value is true the page compositor will assume the drawing buffer contains colors with premultiplied
alpha.
|
boolean |
getPreserveDrawingBuffer()
If false, once the drawing buffer is presented as described in the Drawing Buffer section, the
contents of the drawing buffer are cleared to their default values.
|
boolean |
getStencil()
Returns whether there is a stencil buffer associated with the context.
|
void |
setAlpha(boolean alpha)
Sets the existence of the alpha channel on the drawing buffer.
|
void |
setAntialias(boolean antialias)
Sets the antialias property of the to be created context.
|
void |
setDepth(boolean depth)
Sets the depth property of the WebGLContext.
|
void |
setFailIfMajorPerformanceCaveat(boolean fail)
If the value is true, context creation will fail if the implementation determines that the performance of
the created WebGL context would be dramatically lower than that of a native application making equivalent
OpenGL calls.
|
void |
setPremultipliedAlpha(boolean premultipliedAlpha)
If the value is true the page compositor will assume the drawing buffer contains colors with premultiplied
alpha.
|
void |
setPreserveDrawingBuffer(boolean preserveDrawingBuffer)
If false, once the drawing buffer is presented as described in the Drawing Buffer section, the
contents of the drawing buffer are cleared to their default values.
|
void |
setStencil(boolean stencil)
Sets whether there is a stencil buffer associated with the context.
|
public static WebGLContext.Attributes create()
Creates an Attributes object with the default values as specified in the WebGL 1.0 Specification. The default values for the properties are as follows.
alpha: true depth: true stencil: false antiAlias: true preMultipliedAlpha: true preserveDrawingBuffer: false failIfMajorPerformanceCaveat: false
public final boolean getAlpha()
true
.public final void setAlpha(boolean alpha)
true
.alpha
- The value of the alpha channel.public final boolean getAntialias()
true
.public final void setAntialias(boolean antialias)
true
.antialias
- The new value of the antialiasing property.public final boolean getDepth()
public final void setDepth(boolean depth)
depth
- The depth property of WebGLContext.public final boolean getFailIfMajorPerformanceCaveat()
If the value is true, context creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls. This could happen for a number of reasons, including:
Applications that don't require high performance should leave this parameter at its default value of false. Applications that require high performance may set this parameter to true, and if context creation fails then the application may prefer to use a fallback rendering path.
public final void setFailIfMajorPerformanceCaveat(boolean fail)
If the value is true, context creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than that of a native application making equivalent OpenGL calls. This could happen for a number of reasons, including:
Applications that don't require high performance should leave this parameter at its default value of false. Applications that require high performance may set this parameter to true, and if context creation fails then the application may prefer to use a fallback rendering path.
fail
- Whether the context should fail if there is a major performance caveat.public final boolean getPremultipliedAlpha()
premultipliedAlpha
flag.public final void setPremultipliedAlpha(boolean premultipliedAlpha)
premultipliedAlpha
flag.premultipliedAlpha
- Whether the drawing buffer should accept colors with premultiplied alpha.public final boolean getPreserveDrawingBuffer()
If false, once the drawing buffer is presented as described in the Drawing Buffer section, the contents of the drawing buffer are cleared to their default values. All elements of the drawing buffer (color, depth and stencil) are cleared. If the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
On some hardware setting the preserveDrawingBuffer flag to true can have significant performance implications.
public final void setPreserveDrawingBuffer(boolean preserveDrawingBuffer)
If false, once the drawing buffer is presented as described in the Drawing Buffer section, the contents of the drawing buffer are cleared to their default values. All elements of the drawing buffer (color, depth and stencil) are cleared. If the value is true the buffers will not be cleared and will preserve their values until cleared or overwritten by the author.
On some hardware setting the preserveDrawingBuffer flag to true can have significant performance implications.
preserveDrawingBuffer
- Whether the drawing buffer should be preserved after presenting.public final boolean getStencil()
public final void setStencil(boolean stencil)
stencil
- Whether a stencil buffer of at least 8 bits should be used.