@@ -15,38 +15,37 @@ Elm.Native.Graphics.WebGL.make = function(elm) {
1515 //var Utils = Elm.Native.Utils.make(elm);
1616 //var Tuple2 = Utils.Tuple2;
1717
18+ function drawGL(ctx,model) {
19+ var scene = model.scene;
20+ console.log(scene);
21+ }
22+
23+ function render(model) {
24+ var canvas = newNode('canvas');
25+ gl = canvas.getContext("webgl");
26+ drawGL(gl,model);
27+ return canvas;
28+ }
29+
30+ function update(canvasNode, _oldModel, newModel) {
31+ gl = canvasNode.getContext("webgl");
32+ drawGL(gl,newModel)
33+ }
34+
1835 function glContext(w,h,scene) {
1936
20− function drawGL(ctx,model) {
21− throw "Not implemented"
22− }
23−
24− function render(model) {
25− var canvas = newNode('canvas');
26− gl = canvas.getContext("webgl");
27− drawGL(gl,model);
28− return canvas;
29− }
30−
31− function update(canvasNode, _oldModel, newModel) {
32− gl = canvasNode.getContext("webgl");
33− drawGL(gl,newModel)
34− }
35−
36− return function (scene) {
37− return A3(newElement, 100, 40, {
38− ctor: 'Custom',
39− type: 'WebGL',
40− render: render,
41− update: update,
42− model: scene,
43− });
44− }
37+ return A3(newElement, w, h, {
38+ ctor: 'Custom',
39+ type: 'WebGL',
40+ render: render,
41+ update: update,
42+ model: {scene:scene},
43+ });
4544
4645 }
4746
48− return elm.Native.Graphics.Input.values = {
49− glContext:glContext,
47+ return elm.Native.Graphics.WebGL.values = {
48+ glContext:F3(glContext),
5049 };
5150
5251};