aboutsummaryrefslogtreecommitdiff
path: root/src/library_glut.js
diff options
context:
space:
mode:
authorLCID Fire <lcid-fire@gmx.net>2012-09-22 13:23:50 +0200
committerLCID Fire <lcid-fire@gmx.net>2012-09-26 01:24:17 +0200
commit074279c9f43bbc7d4b847c826722d38b76baeb44 (patch)
treeaad0164c4a78edcfed8ee9b6d17980f0456d181a /src/library_glut.js
parentac36f1a7237e1e804d7f07bed4226a3f5a3320d8 (diff)
Implemented Browser.setCanvasSize to have a central point for resizing <canvas>
Diffstat (limited to 'src/library_glut.js')
-rw-r--r--src/library_glut.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/library_glut.js b/src/library_glut.js
index d33f8436..b146cf47 100644
--- a/src/library_glut.js
+++ b/src/library_glut.js
@@ -237,8 +237,7 @@ var LibraryGLUT = {
document.removeEventListener('mozfullscreenchange', GLUT.onFullScreenEventChange, true);
document.removeEventListener('webkitfullscreenchange', GLUT.onFullScreenEventChange, true);
}
- Module['canvas'].width = width;
- Module['canvas'].height = height;
+ Browser.setCanvasSize(width, height);
/* Can't call _glutReshapeWindow as that requests cancelling fullscreen. */
if (GLUT.reshapeFunc) {
// console.log("GLUT.reshapeFunc (from FS): " + width + ", " + height);
@@ -274,8 +273,8 @@ var LibraryGLUT = {
},
glutInitWindowSize: function(width, height) {
- Module['canvas'].width = GLUT.initWindowWidth = width;
- Module['canvas'].height = GLUT.initWindowHeight = height;
+ Browser.setCanvasSize( GLUT.initWindowWidth = width,
+ GLUT.initWindowHeight = height );
},
glutInitWindowPosition: function(x, y) {
@@ -371,8 +370,7 @@ var LibraryGLUT = {
glutReshapeWindow: function(width, height) {
GLUT.cancelFullScreen();
// console.log("glutReshapeWindow: " + width + ", " + height);
- Module['canvas'].width = width;
- Module['canvas'].height = height;
+ Browser.setCanvasSize(width, height);
if (GLUT.reshapeFunc) {
// console.log("GLUT.reshapeFunc: " + width + ", " + height);
FUNCTION_TABLE[GLUT.reshapeFunc](width, height);