From b2ce8b819cc85a558d862c04965b7e65a6ce8640 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 1 Feb 2012 13:05:32 -0800 Subject: changes to allow minimal rendering ofnon-animated materials. --- js/helper-classes/RDGE/src/core/script/engine.js | 18 +++++++++--------- js/helper-classes/RDGE/src/core/script/jshader.js | 6 +++--- js/helper-classes/RDGE/src/core/script/runtime.js | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'js/helper-classes/RDGE/src') diff --git a/js/helper-classes/RDGE/src/core/script/engine.js b/js/helper-classes/RDGE/src/core/script/engine.js index 6fe964c7..5bc9305c 100644 --- a/js/helper-classes/RDGE/src/core/script/engine.js +++ b/js/helper-classes/RDGE/src/core/script/engine.js @@ -377,13 +377,13 @@ Engine.prototype.getRDGEPanel=function(panelID) return panelObjectManager.handleToObject(panelID); } -Engine.prototype.registerCanvas = function(canvas, runState) { - if (canvas && this.getContext(canvas.id)) - return; - +Engine.prototype.registerCanvas = function(canvas, runState) { + if (canvas && this.getContext(canvas.rdgeid)) + return; + canvas.renderer = new _renderer(canvas); // create the renderer for the context - this.canvasToRendererMap[canvas.id] = canvas; // store the canvas in the context map - canvas.renderer.id = canvas.id; + this.canvasToRendererMap[canvas.rdgeid] = canvas; // store the canvas in the context map + canvas.renderer.id = canvas.rdgeid; // configure the state manager for this context var stateMan = new stateManager(); @@ -391,11 +391,11 @@ Engine.prototype.registerCanvas = function(canvas, runState) { // add this context to the contextManager and attach the handle to DOM canvas for user retrieval var context = new contextDef(); - context.id = canvas.id; + context.id = canvas.rdgeid; context.renderer = canvas.renderer; context.ctxStateManager = stateMan; context.startUpState; - context.fpsTracker = new fpsTracker(canvas.id); + context.fpsTracker = new fpsTracker(canvas.rdgeid); context.renderer.mvMatrix = mat4.identity(); context.renderer.invMvMatrix = mat4.identity(); @@ -471,7 +471,7 @@ Engine.prototype.registerCanvas = function(canvas, runState) { } Engine.prototype.unregisterCanvas = function(canvas) { - stat.closePage(canvas.id + "_fps"); + stat.closePage(canvas.rdgeid + "_fps"); contextManager.removeObject(canvas.rdgeCtxHandle); } diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js index f28219cf..36c5939e 100644 --- a/js/helper-classes/RDGE/src/core/script/jshader.js +++ b/js/helper-classes/RDGE/src/core/script/jshader.js @@ -173,7 +173,7 @@ jshader = function(addr) { // if the parameter does not exist in the shader cull it from the pass if (this.loc == null) { - window.console.log("ctx:" + ctx.canvas.id + ", technique: " + technique + ", uniform: " + name + " was not found, jshader param will have no affect"); + window.console.log("ctx:" + ctx.canvas.rdgeid + ", technique: " + technique + ", uniform: " + name + " was not found, jshader param will have no affect"); //return; } @@ -308,7 +308,7 @@ jshader = function(addr) { } } - program.ctxId = this.ctx.canvas.id; + program.ctxId = this.ctx.canvas.rdgeid; if (!program) { this.renderer.console.log("Build errors found in technique: " + t); this.def[t] = null; // remove bad technique @@ -322,7 +322,7 @@ jshader = function(addr) { var gp = new globalParam(this.ctx, p, rdgeGlobalParameters[p], program); if (gp.loc != null) { - gp.loc.ctxID = this.ctx.canvas.id; + gp.loc.ctxID = this.ctx.canvas.rdgeid; this[t].passes[i].defParams[p] = gp; this.global[p] = gp; } diff --git a/js/helper-classes/RDGE/src/core/script/runtime.js b/js/helper-classes/RDGE/src/core/script/runtime.js index e950fce0..18b9b223 100644 --- a/js/helper-classes/RDGE/src/core/script/runtime.js +++ b/js/helper-classes/RDGE/src/core/script/runtime.js @@ -121,7 +121,7 @@ function RDGEStart(canvasOrID) g_Engine.registerCanvas(canvas); - //canvas.task = new RDGETask(canvas, true); + canvas.task = new RDGETask(canvas, true); if (!g_shaderMan) g_shaderMan = new ShaderManager(); @@ -179,7 +179,7 @@ RDGERequestAnimationFrame = (function() { RDGETask = (function() { var tasks = {}; return function(canvas, startNow) { - this.id = canvas.id; + this.id = canvas.rdgeid; this.currTime = 0.0; this.lastTime = 0.0; this.running = false; -- cgit v1.2.3