From 2bb869eb1c0b71e379f159eb0f95dfa168496d8d Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 22 Feb 2012 15:22:13 -0800 Subject: Runtime classes --- js/helper-classes/RDGE/GLWorld.js | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'js/helper-classes/RDGE/GLWorld.js') diff --git a/js/helper-classes/RDGE/GLWorld.js b/js/helper-classes/RDGE/GLWorld.js index 1edd5cff..0addcadc 100755 --- a/js/helper-classes/RDGE/GLWorld.js +++ b/js/helper-classes/RDGE/GLWorld.js @@ -136,13 +136,6 @@ function GLWorld( canvas, use3D ) var camMat = Matrix.I(4); camMat[14] = this.getViewDistance(); this.setCameraMat( camMat ); - - ////////////////////////////////////////// - // test call to SVG importer -// console.log( "***** SVG TEST *****" ); -// var svgImporter = new SVGParse( this ); -// svgImporter.importSVG(); - ////////////////////////////////////////// // post-load processing of the scene this.init = function() @@ -198,7 +191,9 @@ function GLWorld( canvas, use3D ) this.myScene.addNode(lightTr); // Add the scene to the engine - necessary if you want the engine to draw for you - g_Engine.AddScene("myScene" + this._canvas.id, this.myScene); + //g_Engine.AddScene("myScene" + this._canvas.id, this.myScene); + var name = this._canvas.getAttribute( "data-RDGE-id" ); + g_Engine.AddScene("myScene" + name, this.myScene); } // main code for handling user interaction and updating the scene @@ -227,11 +222,11 @@ function GLWorld( canvas, use3D ) } // defining the draw function to control how the scene is rendered - this.draw = function() + this.draw = function() { if (this._useWebGL) { - g_Engine.setContext( this._canvas.uuid ); + g_Engine.setContext( this._canvas.rdgeid ); var ctx = g_Engine.getContext(); var renderer = ctx.renderer; if (renderer.unloadedTextureCount <= 0) @@ -391,12 +386,10 @@ function GLWorld( canvas, use3D ) if (this._useWebGL) { rdgeStarted = true; - this._canvas.rdgeid = this._canvas.uuid; + var id = this._canvas.getAttribute( "data-RDGE-id" ); + this._canvas.rdgeid = id; g_Engine.registerCanvas(this._canvas, this); RDGEStart( this._canvas ); - - //this._canvas.fpsTracker = new fpsTracker( '0' ); - //this._canvas.task = new RDGETask(this._canvas, false); this._canvas.task.stop() } } @@ -765,7 +758,7 @@ GLWorld.prototype.render = function() else { // console.log( "GLWorld.render, " + this._worldCount ); - g_Engine.setContext( this._canvas.uuid ); + g_Engine.setContext( this._canvas.rdgeId ); //this.draw(); this.restartRenderLoop(); } @@ -821,7 +814,9 @@ GLWorld.prototype.getShapeFromPoint = function( offsetX, offsetY ) GLWorld.prototype.export = function() { var exportStr = "GLWorld 1.0\n"; - exportStr += "id: " + this._canvas.rdgeid + "\n"; + var id = this.getCanvas().getAttribute( "data-RDGE-id" ); + exportStr += "id: " + id + "\n"; + //exportStr += "id: " + this._canvas.rdgeid + "\n"; exportStr += "fov: " + this._fov + "\n"; exportStr += "zNear: " + this._zNear + "\n"; exportStr += "zFar: " + this._zFar + "\n"; @@ -829,7 +824,7 @@ GLWorld.prototype.export = function() // we need 2 export modes: One for save/restore, one for publish. // hardcoding for now - var exportForPublish = false; + var exportForPublish = true; exportStr += "publish: " + exportForPublish + "\n"; if (exportForPublish) -- cgit v1.2.3