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 = {
1484
1484
SDL_SetVideoMode__deps : [ '$GL' ] ,
1485
1485
SDL_SetVideoMode__proxy : 'sync' ,
1486
1486
SDL_SetVideoMode : ( width , height , depth , flags ) => {
1487
+ var canvas = Browser . getCanvas ( ) ;
1488
+ #if ASSERTIONS
1489
+ assert ( canvas , 'no canvas found' ) ;
1490
+ #endif
1491
+
1487
1492
[ 'touchstart' , 'touchend' , 'touchmove' ,
1488
1493
'mousedown' , 'mouseup' , 'mousemove' ,
1489
1494
'mousewheel' , 'wheel' , 'mouseout' ,
1490
1495
'DOMMouseScroll' ,
1491
- ] . forEach ( ( e ) => Browser . getCanvas ( ) . addEventListener ( e , SDL . receiveEvent , true ) ) ;
1496
+ ] . forEach ( ( e ) => canvas . addEventListener ( e , SDL . receiveEvent , true ) ) ;
1492
1497
1493
1498
// (0,0) means 'use fullscreen' in native; in Emscripten, use the current canvas size.
1494
1499
if ( width == 0 && height == 0 ) {
1495
- var canvas = Browser . getCanvas ( ) ;
1496
1500
width = canvas . width ;
1497
1501
height = canvas . height ;
1498
1502
}
You can’t perform that action at this time.
0 commit comments