summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/object_base.js
diff options
context:
space:
mode:
authorpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 21:00:00 +0000
committerpetersont@google.com <petersont@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 21:00:00 +0000
commite512583b79e366db399a6566964412bb6e5af823 (patch)
treee15e3c05e273a0366caf2fcbc5689ae377b3e877 /o3d/samples/o3d-webgl/object_base.js
parenta37a999f87eed77b08e7e1b6bdb86d406f31ea9b (diff)
downloadchromium_src-e512583b79e366db399a6566964412bb6e5af823.zip
chromium_src-e512583b79e366db399a6566964412bb6e5af823.tar.gz
chromium_src-e512583b79e366db399a6566964412bb6e5af823.tar.bz2
Added textures, texture samplers and render targets to o3d-webgl. Also fixed bugs, added calls to parent class constructor to classes that didn't have them before, added a few demos to exhibit/test textures and render surfaces.
Review URL: http://codereview.chromium.org/856004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41482 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl/object_base.js')
-rw-r--r--o3d/samples/o3d-webgl/object_base.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/o3d/samples/o3d-webgl/object_base.js b/o3d/samples/o3d-webgl/object_base.js
index 42931eb..a0f81b9 100644
--- a/o3d/samples/o3d-webgl/object_base.js
+++ b/o3d/samples/o3d-webgl/object_base.js
@@ -54,14 +54,16 @@ o3d.ObjectBase.prototype.superClass = null;
/**
* Traverses the current object's class and all its superclasses and
* determines if any of them are of the given name.
- * returns {bool}
+ * @param {string} className The name of a class.
+ * @return {boolean} Whether this is counts as a className.
*/
-o3d.ObjectBase.isAClassName = function(o, className) {
- while (o != undefined) {
- if (o.className == 'className') {
+o3d.ObjectBase.prototype.isAClassName = function(className) {
+ var object = this;
+ while (object != undefined) {
+ if (object.className == className) {
return true;
}
- o = o.superClass.prototype;
+ object = object.superClass && object.superClass.prototype;
}
return false;
};