createProgram()
ts
function createProgram(
gl,
vertexSrc,
fragmentSrc,
attribs?
): WebGLProgram;Defined in: createProgram.js:17
Compiles both shaders and attaches them to a new program. The program is returned unlinked so attribute locations can be bound first; call linkProgram before using it.
Parameters
| Parameter | Type | Description |
|---|---|---|
gl | WebGL2RenderingContext | The WebGL2 context. |
vertexSrc | string | GLSL ES 3.00 vertex shader source. |
fragmentSrc | string | GLSL ES 3.00 fragment shader source. |
attribs? | Record<string, Attribute> | Attributes whose varyings, for transform feedback attributes, are captured from the vertex shader. |
Returns
WebGLProgram