summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl
diff options
context:
space:
mode:
authorkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 01:28:22 +0000
committerkbr@google.com <kbr@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-28 01:28:22 +0000
commitf21b7281948a5d3c9899c72c81a6c0a6a37d59df (patch)
tree9ad8981afcab0692b3658269bc1cf3b98ceadc24 /o3d/samples/o3d-webgl
parentdb5291012d45956754c57e263c58b79845185302 (diff)
downloadchromium_src-f21b7281948a5d3c9899c72c81a6c0a6a37d59df.zip
chromium_src-f21b7281948a5d3c9899c72c81a6c0a6a37d59df.tar.gz
chromium_src-f21b7281948a5d3c9899c72c81a6c0a6a37d59df.tar.bz2
Thanks to gman, fixed o3d.webgl.createClient and o3d-webgl Client to handle
resizing of div containing O3D element. Added simpleviewer sample. BUG=none TEST=ran simpleviewer sample Review URL: http://codereview.chromium.org/1798006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45770 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/o3d-webgl')
-rw-r--r--o3d/samples/o3d-webgl/client.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/o3d/samples/o3d-webgl/client.js b/o3d/samples/o3d-webgl/client.js
index fb54b79..5d91416 100644
--- a/o3d/samples/o3d-webgl/client.js
+++ b/o3d/samples/o3d-webgl/client.js
@@ -103,6 +103,7 @@ o3d.Renderer.renderClients = function() {
renderEvent.elapsedTime = 0.0;
else
renderEvent.elapsedTime = now - client.then_;
+ client.updateDisplayInfo_();
if (client.render_callback) {
client.render_callback(renderEvent);
}
@@ -538,8 +539,7 @@ o3d.Client.prototype.initWithCanvas = function(canvas) {
this.gl = gl;
gl.client = this;
- gl.displayInfo = {width: canvas.width,
- height: canvas.height};
+ this.updateDisplayInfo_();
};
@@ -890,3 +890,11 @@ o3d.Client.prototype.clientId = 0;
o3d.Client.prototype.canvas = null;
+/**
+ * Updates the display information attached to the GL.
+ * @private
+ */
+o3d.Client.prototype.updateDisplayInfo_ = function() {
+ this.gl.displayInfo = {width: this.width,
+ height: this.height};
+};