diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-10-16 10:42:08 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-10-16 10:42:08 -0700 |
commit | 86fe72e8bfdcf5e6518c7e615ce599d1c6c491dd (patch) | |
tree | 53e56b4bb071578fbe409e3e21383dbb8a4df3f6 /src/library_browser.js | |
parent | 9ca5fc4f2af23e78e8f44e89b5024588d0f57cf8 (diff) | |
parent | c2ace4f8473ca8851be15d1f49f3f8bc2bb76ce5 (diff) |
Merge branch 'antialiasing' of github.com:wsmind/emscripten into incoming
Conflicts:
AUTHORS
Diffstat (limited to 'src/library_browser.js')
-rw-r--r-- | src/library_browser.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index dd60a581..59d2945e 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -225,7 +225,7 @@ mergeInto(LibraryManager.library, { } }, - createContext: function(canvas, useWebGL, setInModule) { + createContext: function(canvas, useWebGL, setInModule, webGLContextAttributes) { #if !USE_TYPED_ARRAYS if (useWebGL) { Module.print('(USE_TYPED_ARRAYS needs to be enabled for WebGL)'); @@ -235,12 +235,22 @@ mergeInto(LibraryManager.library, { var ctx; try { if (useWebGL) { - ctx = canvas.getContext('experimental-webgl', { + var contextAttributes = { + antialias: false, + alpha: false + }; + + if (webGLContextAttributes) { + for (var attribute in webGLContextAttributes) { + contextAttributes[attribute] = webGLContextAttributes[attribute]; + } + } + #if GL_TESTING - preserveDrawingBuffer: true, + contextAttributes.preserveDrawingBuffer = true; #endif - alpha: false - }); + + ctx = canvas.getContext('experimental-webgl', contextAttributes); } else { ctx = canvas.getContext('2d'); } |