webgl: tests: Fix webgl triangle test

It was giving a ton of whitespace errors, and I don't know if it's due
to nodeValue or ANGLE...
This commit is contained in:
Emilio Cobos Álvarez 2016-03-27 16:25:46 +02:00 committed by Emilio Cobos Álvarez
parent 6fcc03c965
commit ee8ecd9299

View file

@ -9,6 +9,8 @@
<canvas id="canvas" width="512" height="512"></canvas>
</div>
<script id="vertexshader" type="x-shader">
precision mediump float;
attribute vec2 aVertexPosition;
attribute vec4 aColour;
varying vec4 aVertexColor;
@ -44,6 +46,9 @@
var v = document.getElementById("vertexshader").firstChild.nodeValue;
var f = document.getElementById("fragmentshader").firstChild.nodeValue;
console.log("vertex source: ", v);
console.log("fragment source: ", f);
var vs = gl.createShader(gl.VERTEX_SHADER);
gl.shaderSource(vs, v);
gl.compileShader(vs);