aboutsummaryrefslogtreecommitdiff
path: root/src/library_glut.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-05-24 10:13:42 +0200
committerAlon Zakai <alonzakai@gmail.com>2012-05-24 10:13:42 +0200
commita6d312ccb942b50287777fc22dc69de926ea3412 (patch)
tree0acabef2e78a97e7cd1742b9d98acb2a1b496e72 /src/library_glut.js
parentc3570e254952ba0593038993674473e900ada9e0 (diff)
parentb7ce870dd4b1352e308e212e77cd6161c1ec904e (diff)
Merge branch 'master' into llvmsvn
Diffstat (limited to 'src/library_glut.js')
-rw-r--r--src/library_glut.js20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/library_glut.js b/src/library_glut.js
index e4b2d138..b0308acf 100644
--- a/src/library_glut.js
+++ b/src/library_glut.js
@@ -226,13 +226,13 @@ var LibraryGLUT = {
onFullScreenEventChange: function(event){
var width;
var height;
- if (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen) {
+ if (document["fullScreen"] || document["mozFullScreen"] || document["webkitIsFullScreen"]) {
width = screen["width"];
height = screen["height"];
} else {
width = GLUT.windowWidth;
height = GLUT.windowHeight;
- // TODO set position
+ // TODO set position
document.removeEventListener('fullscreenchange', GLUT.onFullScreenEventChange, true);
document.removeEventListener('mozfullscreenchange', GLUT.onFullScreenEventChange, true);
document.removeEventListener('webkitfullscreenchange', GLUT.onFullScreenEventChange, true);
@@ -241,6 +241,7 @@ var LibraryGLUT = {
Module['canvas'].height = height;
/* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */
if (GLUT.reshapeFunc) {
+ // console.log("GLUT.reshapeFunc (from FS): " + width + ", " + height);
FUNCTION_TABLE[GLUT.reshapeFunc](width, height);
}
_glutPostRedisplay();
@@ -262,16 +263,7 @@ var LibraryGLUT = {
document['webkitCancelFullScreen'] ||
(function() {});
CFS.apply(document, []);
- },
-
- requestAnimationFrame: function(func) {
- var RAF = window['requestAnimationFrame'] ||
- window['mozRequestAnimationFrame'] ||
- window['webkitRequestAnimationFrame'] ||
- window['msRequestAnimationFrame'] ||
- window['setTimeout'];
- RAF.apply(window, [func]);
- },
+ }
},
glutGetModifiers: function() { return GLUT.modifiers; },
@@ -378,9 +370,11 @@ var LibraryGLUT = {
glutReshapeWindow__deps: ['$GLUT', 'glutPostRedisplay'],
glutReshapeWindow: function(width, height) {
GLUT.cancelFullScreen();
+ // console.log("glutReshapeWindow: " + width + ", " + height);
Module['canvas'].width = width;
Module['canvas'].height = height;
if (GLUT.reshapeFunc) {
+ // console.log("GLUT.reshapeFunc: " + width + ", " + height);
FUNCTION_TABLE[GLUT.reshapeFunc](width, height);
}
_glutPostRedisplay();
@@ -410,7 +404,7 @@ var LibraryGLUT = {
glutPostRedisplay: function() {
if (GLUT.displayFunc) {
- GLUT.requestAnimationFrame(FUNCTION_TABLE[GLUT.displayFunc]);
+ Browser.requestAnimationFrame(FUNCTION_TABLE[GLUT.displayFunc]);
}
},