Handles the WebGL2 context for the engine and stenciling functions
Found in Chapter 3, page 67 of the textbook
Example: 3.1 Renderable Objects- Source:
Methods
(static) beginDrawToStencil(bit, mask)
Begins drawing using a stencil
Parameters:
| Name | Type | Description |
|---|---|---|
bit |
int | reference value for the stencil test |
mask |
GLuint | bit-wise mask that is used in comparison |
- Source:
(static) cleanUp()
Closes the canvas and the rendering context with a shut down message
- Source:
(static) disableDrawToStencil()
Disables stencil rendering
- Source:
(static) endDrawToStencil(bit, mask)
Sets the rendering context to use normal drawing method
Parameters:
| Name | Type | Description |
|---|---|---|
bit |
int | reference value for the stencil test |
mask |
GLuint | bit-wise mask that is used in comparison |
- Source:
(static) get() → {WebGL2RenderingContext}
Returns the WebGL2 context for the canvas
- Source:
Returns:
rendering context
- Type
- WebGL2RenderingContext
(static) init(htmlCanvasID) → {void}
Initializes the canvas and rendering context
Parameters:
| Name | Type | Description |
|---|---|---|
htmlCanvasID |
string | the id of the canvas element |
- Source:
Returns:
returns early if the WebGL2 context is null
- Type
- void