diff options
author | petersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 23:48:08 +0000 |
---|---|---|
committer | petersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-09 23:48:08 +0000 |
commit | 8fee64afe7ba2867255af94eae719f6f6b5ddc33 (patch) | |
tree | 5ab5f082a0fe5f27bdef1b056a024e0384937993 /o3d/samples/o3d-webgl/param.js | |
parent | 2c1ca1a516107745daa0a892875d61944dd791f6 (diff) | |
download | chromium_src-8fee64afe7ba2867255af94eae719f6f6b5ddc33.zip chromium_src-8fee64afe7ba2867255af94eae719f6f6b5ddc33.tar.gz chromium_src-8fee64afe7ba2867255af94eae719f6f6b5ddc33.tar.bz2 |
Implemented picking, at last. The picking sample is already checked in, but to get the sample to draw the right thing required a bunch of ancillary bug fixes, also in this cl.
Review URL: http://codereview.chromium.org/2874008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52021 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl/param.js')
-rw-r--r-- | o3d/samples/o3d-webgl/param.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/o3d/samples/o3d-webgl/param.js b/o3d/samples/o3d-webgl/param.js index a7b3e6f..59c0219 100644 --- a/o3d/samples/o3d-webgl/param.js +++ b/o3d/samples/o3d-webgl/param.js @@ -767,8 +767,29 @@ o3d.WorldViewProjectionInverseTransposeParamMatrix4 = function() { o3d.inherit('WorldViewProjectionInverseTransposeParamMatrix4', 'CompositionParamMatrix4'); + +/** + * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. + */ +o3d.ParamInteger.prototype.applyToLocation = function(gl, location) { + gl.uniform1i(location, this.value); +}; + +/** + * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. + */ +o3d.ParamBoolean.prototype.applyToLocation = function(gl, location) { + gl.uniform1i(location, this.value); +}; + /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamFloat.prototype.applyToLocation = function(gl, location) { gl.uniform1f(location, this.value); @@ -776,6 +797,8 @@ o3d.ParamFloat.prototype.applyToLocation = function(gl, location) { /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamFloat2.prototype.applyToLocation = function(gl, location) { gl.uniform2fv(location, this.value); @@ -783,6 +806,8 @@ o3d.ParamFloat2.prototype.applyToLocation = function(gl, location) { /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamFloat3.prototype.applyToLocation = function(gl, location) { gl.uniform3fv(location, this.value); @@ -790,6 +815,8 @@ o3d.ParamFloat3.prototype.applyToLocation = function(gl, location) { /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamFloat4.prototype.applyToLocation = function(gl, location) { gl.uniform4fv(location, this.value); @@ -797,6 +824,8 @@ o3d.ParamFloat4.prototype.applyToLocation = function(gl, location) { /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamMatrix4.prototype.applyToLocation = function(gl, location) { gl.uniformMatrix4fv(location, @@ -812,6 +841,8 @@ o3d.Param.texture_index_ = 0; /** * Called to specify the value of a uniform variable. + * @param {WebGLContext} gl The current context. + * @param {WebGLUniformLocation} location The location to which to apply. */ o3d.ParamSampler.prototype.applyToLocation = function(gl, location) { // When before the effect object assigns values to parameters, |