diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-10-10 06:53:27 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-10-10 18:07:17 +0300 |
commit | 6bc33bac2af91afdc5ada75232131e319fb298f2 (patch) | |
tree | b96e97699ec606b6c82d3e8614bc5d7e20224cc1 /src | |
parent | 12918ccc0a3f754f56349e82c680a9df405c4731 (diff) |
Advertise all GL extensions both with and without the "GL_" prefix that desktop has, to match feature parity on existing codebases so that they don't have to manually work around the extension strings for both WebGL and GLES2.
Diffstat (limited to 'src')
-rw-r--r-- | src/library_gl.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js index 4f3e0efd..91bb74de 100644 --- a/src/library_gl.js +++ b/src/library_gl.js @@ -503,7 +503,13 @@ var LibraryGL = { case 0x1F02 /* GL_VERSION */: return allocate(intArrayFromString(Module.ctx.getParameter(name_)), 'i8', ALLOC_NORMAL); case 0x1F03 /* GL_EXTENSIONS */: - return allocate(intArrayFromString(Module.ctx.getSupportedExtensions().join(' ')), 'i8', ALLOC_NORMAL); + var exts = Module.ctx.getSupportedExtensions(); + var gl_exts = []; + for (i in exts) { + gl_exts.push(exts[i]); + gl_exts.push("GL_" + exts[i]); + } + return allocate(intArrayFromString(gl_exts.join(' ')), 'i8', ALLOC_NORMAL); // XXX this leaks! TODO: Cache all results like this in library_gl.js to be clean and nice and avoid leaking. case 0x8B8C /* GL_SHADING_LANGUAGE_VERSION */: return allocate(intArrayFromString('OpenGL ES GLSL 1.00 (WebGL)'), 'i8', ALLOC_NORMAL); default: |