diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-08-08 23:32:21 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-08-08 23:43:35 +0300 |
commit | 75760c7bffe20a62219fdb9ade9864b5f15ec58e (patch) | |
tree | f209fc7a67bf24ed5ea26427c2836f5770d9a156 /src/library_glut.js | |
parent | d92a3ab59d8446d3e2fc7e38a7090f097bc5af82 (diff) |
If WebGL context creation fails, return 0 in glutCreateWindow and EGL_NO_CONTEXT in eglCreateContext to allow the user to detect whether WebGL support is enabled in the browser or not.
Diffstat (limited to 'src/library_glut.js')
-rw-r--r-- | src/library_glut.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library_glut.js b/src/library_glut.js index 36d47787..29957e6f 100644 --- a/src/library_glut.js +++ b/src/library_glut.js @@ -385,7 +385,7 @@ var LibraryGLUT = { glutCreateWindow__deps: ['$Browser'], glutCreateWindow: function(name) { Module.ctx = Browser.createContext(Module['canvas'], true, true); - return 1; + return Module.ctx ? 1 /* a new GLUT window ID for the created context */ : 0 /* failure */; }, glutDestroyWindow__deps: ['$Browser'], |