cginternals / cginternals/webgl-operate
Bad example code for Program?
- Dominant language
- TypeScript
- Stars
- 170
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
This example doesn't seem to work as it is:
https://github.com/cginternals/webgl-operate/blob/fa0035e100ec728e964478ea0d694996f861b8ec/source/program.ts#L15-L17
Instead this works:
```typescript
const vert = new Shader(this._context, gl.VERTEX_SHADER, 'testrenderer.vert');
vert.initialize(require('./testrenderer.vert'));
const frag = new Shader(this._context, gl.FRAGMENT_SHADER, 'testrenderer.frag');
frag.initialize(require('./testrenderer.frag'));
this._program = new Program(this._context);
this._program.initialize([vert, frag]);
```
Side remark: from the rest of [doc page](https://www.webgl-operate.org/doc/classes/program.html) it's unclear why you would call `initialize` with these args (has a generic description and `...args: any[]` since it's only inherited).
`create` and `attach` on the other hand look like more reasonable choices.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.