File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1484,15 +1484,19 @@ var LibrarySDL = {
14841484 SDL_SetVideoMode__deps : [ '$GL' ] ,
14851485 SDL_SetVideoMode__proxy : 'sync' ,
14861486 SDL_SetVideoMode : ( width , height , depth , flags ) => {
1487+ var canvas = Browser . getCanvas ( ) ;
1488+ #if ASSERTIONS
1489+ assert ( canvas , 'no canvas found' ) ;
1490+ #endif
1491+
14871492 [ 'touchstart' , 'touchend' , 'touchmove' ,
14881493 'mousedown' , 'mouseup' , 'mousemove' ,
14891494 'mousewheel' , 'wheel' , 'mouseout' ,
14901495 'DOMMouseScroll' ,
1491- ] . forEach ( ( e ) => Browser . getCanvas ( ) . addEventListener ( e , SDL . receiveEvent , true ) ) ;
1496+ ] . forEach ( ( e ) => canvas . addEventListener ( e , SDL . receiveEvent , true ) ) ;
14921497
14931498 // (0,0) means 'use fullscreen' in native; in Emscripten, use the current canvas size.
14941499 if ( width == 0 && height == 0 ) {
1495- var canvas = Browser . getCanvas ( ) ;
14961500 width = canvas . width ;
14971501 height = canvas . height ;
14981502 }
You can’t perform that action at this time.
0 commit comments