comparison webGL/dandy/resources/J3DI.js @ 26:933062d8e917

update library J3DI.js J3DMath.js
author NOBUYASU Oshiro
date Tue, 09 Nov 2010 00:03:42 +0900
parents fac103fcf60d
children
comparison
equal deleted inserted replaced
25:e8c591a01a8e 26:933062d8e917
70 // Attach our two shaders to the program 70 // Attach our two shaders to the program
71 gl.attachShader (gl.program, vertexShader); 71 gl.attachShader (gl.program, vertexShader);
72 gl.attachShader (gl.program, fragmentShader); 72 gl.attachShader (gl.program, fragmentShader);
73 73
74 // Bind attributes 74 // Bind attributes
75 for (var i in attribs) 75 for (var i = 0; i < attribs.length; ++i)
76 gl.bindAttribLocation (gl.program, i, attribs[i]); 76 gl.bindAttribLocation (gl.program, i, attribs[i]);
77 77
78 // Link the program 78 // Link the program
79 gl.linkProgram(gl.program); 79 gl.linkProgram(gl.program);
80 80
95 gl.useProgram(gl.program); 95 gl.useProgram(gl.program);
96 96
97 gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); 97 gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
98 gl.clearDepth(clearDepth); 98 gl.clearDepth(clearDepth);
99 99
100 // gl.enable(gl.DEPTH_TEST); 100 // gl.enable(gl.DEPTH_TEST);
101 gl.enable(gl.BLEND); 101 gl.enable(gl.BLEND);
102 gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); 102 gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
103 103
104 return gl; 104 return gl;
105 } 105 }