From 064d74fb2694318615f513c83772276cec34bb86 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 8 Feb 2012 13:41:52 -0800 Subject: Fixed context switching problems in rdge --- js/helper-classes/RDGE/src/core/script/renderer.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'js/helper-classes/RDGE/src/core') diff --git a/js/helper-classes/RDGE/src/core/script/renderer.js b/js/helper-classes/RDGE/src/core/script/renderer.js index 04cb36a7..a50b8a68 100644 --- a/js/helper-classes/RDGE/src/core/script/renderer.js +++ b/js/helper-classes/RDGE/src/core/script/renderer.js @@ -371,7 +371,6 @@ _renderer = function(canvas) { mips = true; if (texture) { - //console.log( "createTexture: " + url ); texture.image = new Image(); texture.image.src = url; texture.image.context = g_Engine.getContext(); @@ -379,16 +378,16 @@ _renderer = function(canvas) { texture.image.onload = function() { var stateMan = this.context.ctxStateManager; stateMan.RDGEInitState.loadTexture(texture); - //console.log( "loaded texture: " + texture.lookUpName ); - if (texture.callback) texture.callback( texture ); this.context.renderer.unloadedTextureCount--; + //console.log( "loaded texture: " + texture.lookUpName + ",to: " + this.context.renderer._world._worldCount + ", textures remaining to load: " + this.context.renderer.unloadedTextureCount ); + if (texture.callback) texture.callback( texture ); if (this.context.renderer.unloadedTextureCount < 0) console.log( "more textures loaded then created..." ); }; texture.image.onerror = function() { this.context.renderer.unloadedTextureCount--; if (texture.callback) texture.callback( texture ); - console.log( "Error loading texture: " + texture.image.src ); + //console.log( "Error loading texture: " + texture.image.src ); if (this.context.renderer.unloadedTextureCount < 0) console.log( "more textures loaded then created..." ); } @@ -565,8 +564,10 @@ _renderer = function(canvas) { */ rdgeDefaultShaderDefintion = { 'shaders': { - 'defaultVShader':"assets/shaders/test_vshader.glsl", - 'defaultFShader':"assets/shaders/test_fshader.glsl" + //'defaultVShader':"assets/shaders/test_vshader.glsl", + //'defaultFShader':"assets/shaders/test_fshader.glsl" + 'defaultVShader':"assets/shaders/Basic.vert.glsl", + 'defaultFShader':"assets/shaders/Basic.frag.glsl" }, 'techniques': { 'defaultTechnique':[{ -- cgit v1.2.3