/* This file contains proprietary software owned by Motorola Mobility, Inc.
No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
*/ /** * 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(); /** * 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; } /** * 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 UNIFORMTYPE */ RenderObject.prototype.addUniformArray = function(name, value, type, size) { var uniform = gl.getUniformLocation(this.shader, name); if (uniform) { for (var index=0; index