Permalink
Browse files

Put the factory methods on MagicProgram.

  • Loading branch information...
1 parent b578a86 commit 57581b3cb7d172af1872342201a46af91ed48316 @deanm deanm committed May 30, 2011
Showing with 3 additions and 6 deletions.
  1. +1 −1 examples/500_triangle/app.js
  2. +2 −5 plask.js
View
2 examples/500_triangle/app.js
@@ -16,7 +16,7 @@ plask.simpleWindow({
this.framerate(30);
- this.mprogram = plask.gl.createMagicProgramFromFiles(
+ this.mprogram = plask.gl.MagicProgram.createFromFiles(
gl,
path.join(__dirname, 'app.vshader'),
path.join(__dirname, 'app.fshader'));
View
7 plask.js
@@ -1356,7 +1356,7 @@ function MagicProgram(gl, program) {
}
}
-function createMagicProgramFromFiles(gl, vfn, ffn) {
+MagicProgram.createFromFiles = function(gl, vfn, ffn) {
return new MagicProgram(gl, webGLcreateProgramFromShaderSources(
gl, fs.readFileSync(vfn, 'utf8'), fs.readFileSync(ffn, 'utf8')));
}
@@ -1376,7 +1376,4 @@ exports.Vec2 = Vec2;
exports.Vec4 = Vec4;
exports.Mat4 = Mat4;
-exports.gl = {
- MagicProgram: MagicProgram,
- createMagicProgramFromFiles: createMagicProgramFromFiles
-};
+exports.gl = {MagicProgram: MagicProgram};

0 comments on commit 57581b3

Please sign in to comment.