Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
3 "use strict";
5 let isWebGLAvailable;
7 function onWebGLFail() {
8 isWebGLAvailable = false;
9 }
11 function onWebGLSuccess() {
12 isWebGLAvailable = true;
13 }
15 function test() {
16 if (!isWebGLSupported()) {
17 info("Skipping tilt_gl05 because WebGL isn't supported on this hardware.");
18 return;
19 }
21 let canvas = createCanvas();
23 let renderer = new TiltGL.Renderer(canvas, onWebGLFail, onWebGLSuccess);
24 let gl = renderer.context;
26 if (!isWebGLAvailable) {
27 return;
28 }
31 let mesh = {
32 vertices: new renderer.VertexBuffer([1, 2, 3], 3),
33 indices: new renderer.IndexBuffer([1]),
34 };
36 ok(mesh.vertices instanceof TiltGL.VertexBuffer,
37 "The mesh vertices weren't saved at initialization.");
38 ok(mesh.indices instanceof TiltGL.IndexBuffer,
39 "The mesh indices weren't saved at initialization.");
40 }