@@ -102,7 +102,7 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
103 function drawScene(scene,n) {
103 function drawScene(scene,n) {
104 switch(scene.ctor) {
104 switch(scene.ctor) {
105− case 'Leaf':
105+ case 'SceneLeaf':
106 drawMesh(scene._0, sceneMatrixStack[n]);
106 drawMesh(scene._0, sceneMatrixStack[n]);
@@ -137,7 +137,7 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
137 drawGL(newModel)
137 drawGL(newModel)
140− function glContext(w,h) {
140+ function makeGL(w,h) {
141 var node = newNode('canvas');
141 var node = newNode('canvas');
142 var gl = node.getContext('webgl');
142 var gl = node.getContext('webgl');
143 var programPtr = createProgram(gl, geoVert, geoFrag);
143 var programPtr = createProgram(gl, geoVert, geoFrag);
@@ -153,7 +153,7 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
153 return Signal.constant({w:w,h:h,gl:gl,node:node,program:program});
153 return Signal.constant({w:w,h:h,gl:gl,node:node,program:program});
156− function bindMesh(triangles, context) {
156+ function bufferMesh(triangles, context) {
157 var indices = [];
157 var indices = [];
158 var positions = [];
158 var positions = [];
159 var colors = [];
159 var colors = [];
@@ -161,10 +161,9 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
161 function pushTriangle(n, node) {
161 function pushTriangle(n, node) {
162 if (node.ctor === "[]") return;
162 if (node.ctor === "[]") return;
163 var tri = node._0;
163 var tri = node._0;
164− var names = ['a','b','c'];
165 for (var i = 0; i < 3; i+= 1) {
164 for (var i = 0; i < 3; i+= 1) {
166 indices.push(3 * n + i);
165 indices.push(3 * n + i);
167− var vertex = tri[names[i]];
166+ var vertex = tri['_' + i];
168 for (var j = 0; j < 3; j += 1) {
167 for (var j = 0; j < 3; j += 1) {
169 positions.push(vertex.pos[j]);
168 positions.push(vertex.pos[j]);
@@ -201,7 +200,7 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
204− function renderGL(context, scene) {
203+ function webgl(context, scene) {
206 return A3(newElement, context.w, context.h, {
205 return A3(newElement, context.w, context.h, {
207 ctor: 'Custom',
206 ctor: 'Custom',
@@ -220,9 +219,9 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
222 return elm.Native.Graphics.WebGL.values = {
221 return elm.Native.Graphics.WebGL.values = {
223− glContext:F2(glContext),
222+ makeGL:F2(makeGL),
224− bindMesh:F2(bindMesh),
223+ bufferMesh:F2(bufferMesh),
225− renderGL:F2(renderGL),
224+ webgl:F2(webgl),