From fb0a659c9ca3479fd6799325498b11f074689936 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Mon, 2 Apr 2012 14:57:31 -0700 Subject: -Namespaced all RDGE javascript. -Removed the following unused files from the build script /core/script/fx/blur.js /core/script/fx/ssao.js /core/script/animation.js - Fully removed the following from the build and from source control as they are unused or no longer needed /core/script/util/dbgpanel.js /core/script/util/fpsTracker.js /core/script/util/statTracker.js /core/script/input.js /core/script/TextureManager.js /core/script/ubershader.js --- .../RDGE/src/core/script/RenderProcs.js | 787 ++++++++++----------- 1 file changed, 369 insertions(+), 418 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/RenderProcs.js') diff --git a/js/helper-classes/RDGE/src/core/script/RenderProcs.js b/js/helper-classes/RDGE/src/core/script/RenderProcs.js index 6d3b02df..4d7c055c 100755 --- a/js/helper-classes/RDGE/src/core/script/RenderProcs.js +++ b/js/helper-classes/RDGE/src/core/script/RenderProcs.js @@ -4,533 +4,484 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ +// RDGE namespaces +var RDGE = RDGE || {}; + /** - * supported uniform types - */ -function __UNIFORMTYPE() -{ - this.INT = 0x3F0; - this.FLOAT = 0x3E8; - this.FLOAT2 = 0x3E9; - this.FLOAT3 = 0x3EA; - this.FLOAT4 = 0x3EB; - this.MATRIX3 = 0x3EC; - this.MATRIX4 = 0x3ED; - this.TEXTURE2D = 0x3EE; - this.TEXTURECUBE = 0x3EF; -} -UNIFORMTYPE = new __UNIFORMTYPE(); +* supported uniform types +*/ +RDGE.UNIFORMTYPE = function () { + this.INT = 0x3F0; + this.FLOAT = 0x3E8; + this.FLOAT2 = 0x3E9; + this.FLOAT3 = 0x3EA; + this.FLOAT4 = 0x3EB; + this.MATRIX3 = 0x3EC; + this.MATRIX4 = 0x3ED; + this.TEXTURE2D = 0x3EE; + this.TEXTURECUBE = 0x3EF; +}; /** - * RenderObject - contains references to all the data need to render, including vertex buffers, uniform handles, and matrices - * @param shaderHandle - */ -function RenderObject(shaderHandle) -{ - this.shader = shaderHandle; - this.world = null; - this.bindings = new ShaderData(); - this.initRenderProc = null; - this.renderProc = null; - this.postRenderProc = null; -} +* RDGE.RenderObject - contains references to all the data need to render, including vertex buffers, uniform handles, and matrices +* @param shaderHandle +*/ +RDGE.RenderObject = function (shaderHandle) { + this.shader = shaderHandle; + this.world = null; + this.bindings = new RDGE.ShaderData(); + this.initRenderProc = null; + this.renderProc = null; + this.postRenderProc = null; +}; /** - * Adds a uniform to the render object to bound during render - * @param name - name of the uniform - * @param value - reference to value that will get bound (will be referenced from now on, don't delete the ref) - * @param type - type of uniform, use UNIFORMTYPE - */ -RenderObject.prototype.addUniform = function(name, value, type) -{ - var uniform = gl.getUniformLocation(this.shader, name); - if(uniform) - { - uniform.debugName = name; - this.bindings.uniforms.push( new UniformPair(uniform, value, type)); - } -/* - else - { - gl.console.log("ERROR: uniform - " + name + " not found!"); - } +* Adds a uniform to the render object to bound during render +* @param name - name of the uniform +* @param value - reference to value that will get bound (will be referenced from now on, don't delete the ref) +* @param type - type of uniform, use RDGE.UNIFORMTYPE */ +RDGE.RenderObject.prototype.addUniform = function (name, value, type) { + var uniform = RDGE.globals.gl.getUniformLocation(this.shader, name); + if (uniform) { + uniform.debugName = name; + this.bindings.uniforms.push(new RDGE.UniformPair(uniform, value, type)); + } + /* + else + { + gl.console.log("ERROR: uniform - " + name + " not found!"); + } + */ }; /** * Adds a uniform to the render object to bound during render * @param name - name of the uniform * @param value - reference to value that will get bound (will be referenced from now on, don't delete the ref) -* @param type - type of uniform, use UNIFORMTYPE +* @param type - type of uniform, use RDGE.UNIFORMTYPE */ -RenderObject.prototype.addUniformArray = function(name, value, type, size) -{ - var uniform = gl.getUniformLocation(this.shader, name); - if (uniform) - { - for (var index=0; index