Methods
Execute a clear command.
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | ||||||||||||||||
options |
Object |
optional
|
Create an instance of WebGLRenderingContext or WebGL2RenderingContext.
| Name | Type | Description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contextOptions |
Object |
|
Returns:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | WebGL2RenderingContext | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
|
Returns:
| Name | Type | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | WebGL2RenderingContext | ||||||||||||||||
options |
Object |
|
Returns:
Create a WebGLTexture.
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
|
Returns:
Create a vertex array object. You can imagine it like this
var glState = {
attributeState: {
ELEMENT_ARRAY_BUFFER: null,
attributes: [
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
{ enable: ?, size: ?, type: ?, normalize: ?, stride: ?, offset: ?, buffer: ?, divisor: ?, },
],
},
| Name | Type | Description | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | WebGL2RenderingContext | ||||||||||
options |
Object |
|
Returns:
Execute a draw command.
| Name | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | WebGL2RenderingContext | ||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
|
|||||||||||||||||||||||||||||||||||||||||||||
instanceCount |
Number |
0
|
optional
The number of instances to draw. |
Update texture data.
| Name | Type | Description | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
gl |
WebGLRenderingContext | |||||||||||||||||||||||||||||||||
texture |
WebGLTexture | |||||||||||||||||||||||||||||||||
source |
Object | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement |
|