diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-31 10:58:25 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-31 10:58:25 -0700 |
commit | 695e06078d78489d731306b713baebdc91e5f695 (patch) | |
tree | e837f2a6a10e7d236b128a2bcb5e446bc8c527db | |
parent | f842201acec3c1edafb2916a76a8eb8d75474c2b (diff) |
do not do GL immediate mode emulation if a 2D context is being used, even if compiled with emulation
-rw-r--r-- | src/library_browser.js | 1 | ||||
-rw-r--r-- | src/library_gl.js | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/library_browser.js b/src/library_browser.js index d49c4103..e9860742 100644 --- a/src/library_browser.js +++ b/src/library_browser.js @@ -77,6 +77,7 @@ mergeInto(LibraryManager.library, { } if (setInModule) { Module.ctx = ctx; + Module.useWebGL = useWebGL; Browser.moduleContextCreatedCallbacks.forEach(function(callback) { callback() }); } return ctx; diff --git a/src/library_gl.js b/src/library_gl.js index 3eba76d0..2be48ba1 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1517,6 +1517,8 @@ var LibraryGL = { Module.printErr('WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports'); GL.immediate.initted = true; + if (!Module.useWebGL) return; // a 2D canvas may be currently used TODO: make sure we are actually called in that case + this.matrixStack['m'] = []; this.matrixStack['p'] = []; for (var i = 0; i < GL.immediate.MAX_TEXTURES; i++) { |