diff options
Diffstat (limited to 'src/library_glut.js')
-rw-r--r-- | src/library_glut.js | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/library_glut.js b/src/library_glut.js index 0de0ce6a..d33f8436 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; }, @@ -286,6 +278,10 @@ var LibraryGLUT = { Module['canvas'].height = GLUT.initWindowHeight = height; }, + glutInitWindowPosition: function(x, y) { + // Ignore for now + }, + glutGet: function(type) { switch (type) { case 100: /* GLUT_WINDOW_X */ @@ -367,16 +363,18 @@ var LibraryGLUT = { glutCreateWindow__deps: ['$Browser'], glutCreateWindow: function(name) { - Module.ctx = Browser.createContext(Module['canvas'], true); + Module.ctx = Browser.createContext(Module['canvas'], true, true); return 1; }, 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(); @@ -406,7 +404,7 @@ var LibraryGLUT = { glutPostRedisplay: function() { if (GLUT.displayFunc) { - GLUT.requestAnimationFrame(FUNCTION_TABLE[GLUT.displayFunc]); + Browser.requestAnimationFrame(FUNCTION_TABLE[GLUT.displayFunc]); } }, |