michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: "use strict"; michael@0: michael@0: let isWebGLAvailable; michael@0: michael@0: function onWebGLFail() { michael@0: isWebGLAvailable = false; michael@0: } michael@0: michael@0: function onWebGLSuccess() { michael@0: isWebGLAvailable = true; michael@0: } michael@0: michael@0: function test() { michael@0: if (!isWebGLSupported()) { michael@0: info("Skipping tilt_gl05 because WebGL isn't supported on this hardware."); michael@0: return; michael@0: } michael@0: michael@0: let canvas = createCanvas(); michael@0: michael@0: let renderer = new TiltGL.Renderer(canvas, onWebGLFail, onWebGLSuccess); michael@0: let gl = renderer.context; michael@0: michael@0: if (!isWebGLAvailable) { michael@0: return; michael@0: } michael@0: michael@0: michael@0: let mesh = { michael@0: vertices: new renderer.VertexBuffer([1, 2, 3], 3), michael@0: indices: new renderer.IndexBuffer([1]), michael@0: }; michael@0: michael@0: ok(mesh.vertices instanceof TiltGL.VertexBuffer, michael@0: "The mesh vertices weren't saved at initialization."); michael@0: ok(mesh.indices instanceof TiltGL.IndexBuffer, michael@0: "The mesh indices weren't saved at initialization."); michael@0: }