Skip to content

Commit

Permalink
add a few ts tests
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Feb 28, 2024
1 parent 516973a commit ca9c1eb
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/src/ts/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ window.addEventListener("onload", function() {
const canvas = <HTMLCanvasElement> document.getElementById("myCanvas");
const gl = <WebGLRenderingContext> canvas.getContext("webgl");
twgl.setDefaults({attribPrefix: "a_"});

// just testing that these compile in typescript
twgl.createProgramInfo(gl, ['vs', 'fs'], ['position', 'normals']);
twgl.createProgramInfo(gl, ['vs', 'fs'], ['position', 'normals'], [0, 1]);
twgl.createProgramInfo(gl, ['vs', 'fs'], ['position', 'normals'], [0, 1], (msg: string) => {});
twgl.createProgramInfo(gl, ['vs', 'fs'], {
errorCallback: (msg: string) => {},
attribLocations: ['position', 'normals'],
transformFeedbackVaryings: ['colors'],
});

const programInfo: twgl.ProgramInfo = twgl.createProgramInfo(gl, [
"vs", "fs" // Placeholders
]);
Expand Down

0 comments on commit ca9c1eb

Please sign in to comment.