From ca9c1eb929cf09d9844c4eb331404c77f6556c07 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Wed, 28 Feb 2024 13:48:32 -0800 Subject: [PATCH] add a few ts tests --- test/src/ts/test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/src/ts/test.ts b/test/src/ts/test.ts index e194fea0..fc0204d3 100644 --- a/test/src/ts/test.ts +++ b/test/src/ts/test.ts @@ -24,6 +24,17 @@ window.addEventListener("onload", function() { const canvas = document.getElementById("myCanvas"); const gl = 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 ]);