diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-05-30 16:44:26 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-05-30 16:44:26 -0700 |
commit | b59237ccfdc5a25d5f9ae50c0edb40b67b30b2c2 (patch) | |
tree | a3718b732a5fff8494c953f1b9f51dfb6b93e1fa /src | |
parent | 8e710656602558042f2190fbb0691da236234bb7 (diff) |
do not use gl emulation code in es2 emulation mode, to avoid confusing lack of a bound buffer between them
Diffstat (limited to 'src')
-rw-r--r-- | src/library_gl.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 5055f9e1..46055304 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -1280,10 +1280,17 @@ var LibraryGL = { hasRunInit: false, init: function() { + // Do not activate immediate/emulation code (e.g. replace glDrawElements) when in FULL_ES2 mode. + // We do not need full emulation, we instead emulate client-side arrays etc. in FULL_ES2 code in + // a straightforward manner, and avoid not having a bound buffer be ambiguous between es2 emulation + // code and legacy gl emulation code. +#if FULL_ES2 + return; +#endif + if (GLEmulation.hasRunInit) { return; } - GLEmulation.hasRunInit = true; GLEmulation.fogColor = new Float32Array(4); @@ -1983,7 +1990,10 @@ var LibraryGL = { // GL Immediate mode + // See comment in GLEmulation.init() +#if FULL_ES2 == 0 $GLImmediate__postset: 'GL.immediate.setupFuncs(); Browser.moduleContextCreatedCallbacks.push(function() { GL.immediate.init() });', +#endif $GLImmediate__deps: ['$Browser', '$GL', '$GLEmulation'], $GLImmediate: { MapTreeLib: null, |