File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -847,25 +847,19 @@ var LibraryGL = {
847
847
} ,
848
848
849
849
makeContextCurrent : function ( contextHandle ) {
850
- // Deactivating current context?
851
- if ( ! contextHandle ) {
852
- GLctx = Module . ctx = GL . currentContext = null ;
853
- return true ;
854
- }
855
- var context = GL . contexts [ contextHandle ] ;
856
- if ( ! context ) {
857
850
#if GL_DEBUG
851
+ if ( contextHandle && ! GL . contexts [ contextHandle ] ) {
858
852
#if USE_PTHREADS
859
853
console . error ( 'GL.makeContextCurrent() failed! WebGL context ' + contextHandle + ' does not exist, or was created on another thread!' ) ;
860
854
#else
861
855
console . error ( 'GL.makeContextCurrent() failed! WebGL context ' + contextHandle + ' does not exist!' ) ;
862
856
#endif
863
- #endif
864
- return false ;
865
857
}
866
- GLctx = Module . ctx = context . GLctx ; // Active WebGL context object.
867
- GL . currentContext = context ; // Active Emscripten GL layer context object.
868
- return true ;
858
+ #endif
859
+
860
+ GL . currentContext = GL . contexts [ contextHandle ] ; // Active Emscripten GL layer context object.
861
+ Module . ctx = GLctx = GL . currentContext && GL . currentContext . GLctx ; // Active WebGL context object.
862
+ return ! ( contextHandle && ! GLctx ) ;
869
863
} ,
870
864
871
865
getContext : function ( contextHandle ) {
You can’t perform that action at this time.
0 commit comments