diff options
author | Remi Papillie <remi.papillie@gmail.com> | 2013-10-10 00:05:51 +0200 |
---|---|---|
committer | Remi Papillie <remi.papillie@gmail.com> | 2013-10-13 12:41:27 +0200 |
commit | 53f960effd98267f951d6ce110c0b3fac61df059 (patch) | |
tree | c6a8f57c009f071f34684705aaa7d44de7906d93 /src/library_glut.js | |
parent | 65a494e7c7d6ed63492f4da6b49b15c98af6a722 (diff) |
Added multisampling support in GLUT
Diffstat (limited to 'src/library_glut.js')
-rw-r--r-- | src/library_glut.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/library_glut.js b/src/library_glut.js index 60dc6540..79c586c6 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -16,6 +16,7 @@ var LibraryGLUT = { modifiers: 0, initWindowWidth: 256, initWindowHeight: 256, + initDisplayMode: 0x0000 /*GLUT_RGBA*/ | 0x0002 /*GLUT_DOUBLE*/ | 0x0010 /*GLUT_DEPTH*/, // Set when going fullscreen windowX: 0, windowY: 0, @@ -398,7 +399,10 @@ var LibraryGLUT = { glutCreateWindow__deps: ['$Browser'], glutCreateWindow: function(name) { - Module.ctx = Browser.createContext(Module['canvas'], true, true); + var contextAttributes = { + antialias: ((GLUT.initDisplayMode & 0x0080 /*GLUT_MULTISAMPLE*/) != 0) + }; + Module.ctx = Browser.createContext(Module['canvas'], true, true, contextAttributes); return Module.ctx ? 1 /* a new GLUT window ID for the created context */ : 0 /* failure */; }, @@ -437,7 +441,10 @@ var LibraryGLUT = { GLUT.requestFullScreen(); }, - glutInitDisplayMode: function(mode) {}, + glutInitDisplayMode: function(mode) { + GLUT.initDisplayMode = mode; + }, + glutSwapBuffers: function() {}, glutPostRedisplay: function() { |