aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-07-03 11:37:48 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-07-03 11:37:48 -0700
commit80b4a4b910a7310266131de926086013249febc6 (patch)
tree8c50e416d52a2f6ce159a17ee5b71a38384ae794 /src
parent9612d140e733e2304e1eede62c83a3e6f17085f9 (diff)
support non-GL_UNSIGNED_BYTE texture pixel styles
Diffstat (limited to 'src')
-rw-r--r--src/library_gl.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_gl.js b/src/library_gl.js
index 53e587de..0d7d58d5 100644
--- a/src/library_gl.js
+++ b/src/library_gl.js
@@ -343,7 +343,11 @@ var LibraryGL = {
throw 'Invalid type (' + type + ') passed to glTexImage2D';
}
var bytes = GL.computeImageSize(width, height, sizePerPixel, GL.unpackAlignment);
- pixels = {{{ makeHEAPView('U8', 'pixels', 'pixels+bytes') }}};
+ if (type == 0x1401 /* GL_UNSIGNED_BYTE */) {
+ pixels = {{{ makeHEAPView('U8', 'pixels', 'pixels+bytes') }}};
+ } else {
+ pixels = {{{ makeHEAPView('U16', 'pixels', 'pixels+bytes') }}};
+ }
} else {
pixels = null;
}