WebGLContextAttributes object
A dictionary object of attributes used to initialize the context for the first time.
![]() |
Members
The WebGLContextAttributes object has these types of members:
Properties
The WebGLContextAttributes object has these properties.
| Property | Description |
|---|---|
|
Gets or sets whether the drawing buffer has an alpha channel for alpha compositing and operations. | |
|
Get or set the antialias state on a WebGL rendering context. | |
|
Gets or sets whether the drawing buffer has a depth buffer. Returns false if no depth buffer exists. | |
|
A flag that sets whether WebGL creates a context with getContext if system performance is low. | |
|
Gets or sets whether the colors in the drawing buffer are premultiplied alpha values. This property is ignored if the alpha property is false. | |
|
Sets or gets whether the drawing buffer's is cleared once content is presented. |
Remarks
Attributes are a preference, and might not be configurable. To query which properties are actually used for initialization, call getContextAttributes. Here's how they all behave in Internet Explorer 11.
| Attribute | Supported | Returns |
|---|---|---|
| alpha | yes | true or false. |
| depth | yes | Internet Explorer always behaves like true is set. |
| stencil | yes | true or false |
| antialias | yes | true or false.. |
| premultipliedAlpha | yes | Internet Explorer always behaves like true is set. |
| preserveDrawingBuffer | yes | true or false. |
| failIfMajorPerformanceCaveat | yes | true or false. |
