@@ -62,23 +62,23 @@ var LibraryGLFW = {
62
62
this . domKeys = new Array ( ) ;
63
63
this . shouldClose = 0 ;
64
64
this . title = null ;
65
- this . windowPosFunc = null ; // GLFWwindowposfun
66
- this . windowSizeFunc = null ; // GLFWwindowsizefun
67
- this . windowCloseFunc = null ; // GLFWwindowclosefun
68
- this . windowRefreshFunc = null ; // GLFWwindowrefreshfun
69
- this . windowFocusFunc = null ; // GLFWwindowfocusfun
70
- this . windowIconifyFunc = null ; // GLFWwindowiconifyfun
71
- this . windowMaximizeFunc = null ; // GLFWwindowmaximizefun
72
- this . framebufferSizeFunc = null ; // GLFWframebuffersizefun
73
- this . windowContentScaleFunc = null ; // GLFWwindowcontentscalefun
74
- this . mouseButtonFunc = null ; // GLFWmousebuttonfun
75
- this . cursorPosFunc = null ; // GLFWcursorposfun
76
- this . cursorEnterFunc = null ; // GLFWcursorenterfun
77
- this . scrollFunc = null ; // GLFWscrollfun
78
- this . dropFunc = null ; // GLFWdropfun
79
- this . keyFunc = null ; // GLFWkeyfun
80
- this . charFunc = null ; // GLFWcharfun
81
- this . userptr = null ;
65
+ this . windowPosFunc = 0 ; // GLFWwindowposfun
66
+ this . windowSizeFunc = 0 ; // GLFWwindowsizefun
67
+ this . windowCloseFunc = 0 ; // GLFWwindowclosefun
68
+ this . windowRefreshFunc = 0 ; // GLFWwindowrefreshfun
69
+ this . windowFocusFunc = 0 ; // GLFWwindowfocusfun
70
+ this . windowIconifyFunc = 0 ; // GLFWwindowiconifyfun
71
+ this . windowMaximizeFunc = 0 ; // GLFWwindowmaximizefun
72
+ this . framebufferSizeFunc = 0 ; // GLFWframebuffersizefun
73
+ this . windowContentScaleFunc = 0 ; // GLFWwindowcontentscalefun
74
+ this . mouseButtonFunc = 0 ; // GLFWmousebuttonfun
75
+ this . cursorPosFunc = 0 ; // GLFWcursorposfun
76
+ this . cursorEnterFunc = 0 ; // GLFWcursorenterfun
77
+ this . scrollFunc = 0 ; // GLFWscrollfun
78
+ this . dropFunc = 0 ; // GLFWdropfun
79
+ this . keyFunc = 0 ; // GLFWkeyfun
80
+ this . charFunc = 0 ; // GLFWcharfun
81
+ this . userptr = 0 ;
82
82
} ,
83
83
84
84
$GLFW__deps : [ 'emscripten_get_now' , '$GL' , '$Browser' , '$GLFW_Window' ,
@@ -94,9 +94,9 @@ var LibraryGLFW = {
94
94
return GLFW . windows [ id - 1 ] ;
95
95
} ,
96
96
97
- joystickFunc : null , // GLFWjoystickfun
98
- errorFunc : null , // GLFWerrorfun
99
- monitorFunc : null , // GLFWmonitorfun
97
+ joystickFunc : 0 , // GLFWjoystickfun
98
+ errorFunc : 0 , // GLFWerrorfun
99
+ monitorFunc : 0 , // GLFWmonitorfun
100
100
active : null , // active window
101
101
scale : null ,
102
102
windows : null ,
@@ -372,7 +372,7 @@ var LibraryGLFW = {
372
372
{ { { makeDynCall ( 'vii' , 'GLFW.active.charFunc' ) } } } ( charCode , 1 ) ;
373
373
#endif
374
374
#if USE_GLFW == 3
375
- { { { makeDynCall ( 'vii ' , 'GLFW.active.charFunc' ) } } } ( GLFW . active . id , charCode ) ;
375
+ { { { makeDynCall ( 'vpi ' , 'GLFW.active.charFunc' ) } } } ( GLFW . active . id , charCode ) ;
376
376
#endif
377
377
} ,
378
378
@@ -394,7 +394,7 @@ var LibraryGLFW = {
394
394
#endif
395
395
#if USE_GLFW == 3
396
396
if ( repeat ) status = 2 ; // GLFW_REPEAT
397
- { { { makeDynCall ( 'viiiii ' , 'GLFW.active.keyFunc' ) } } } ( GLFW . active . id , key , keyCode , status , GLFW . getModBits ( GLFW . active ) ) ;
397
+ { { { makeDynCall ( 'vpiiii ' , 'GLFW.active.keyFunc' ) } } } ( GLFW . active . id , key , keyCode , status , GLFW . getModBits ( GLFW . active ) ) ;
398
398
#endif
399
399
}
400
400
} ,
@@ -510,7 +510,7 @@ var LibraryGLFW = {
510
510
{ { { makeDynCall ( 'vii' , 'GLFW.active.mouseButtonFunc' ) } } } ( eventButton , status ) ;
511
511
#endif
512
512
#if USE_GLFW == 3
513
- { { { makeDynCall ( 'viiii ' , 'GLFW.active.mouseButtonFunc' ) } } } ( GLFW . active . id , eventButton , status , GLFW . getModBits ( GLFW . active ) ) ;
513
+ { { { makeDynCall ( 'vpiii ' , 'GLFW.active.mouseButtonFunc' ) } } } ( GLFW . active . id , eventButton , status , GLFW . getModBits ( GLFW . active ) ) ;
514
514
#endif
515
515
}
516
516
} ,
@@ -601,7 +601,7 @@ var LibraryGLFW = {
601
601
{ { { makeDynCall ( 'vii' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . width , GLFW . active . height ) ;
602
602
#endif
603
603
#if USE_GLFW == 3
604
- { { { makeDynCall ( 'viii ' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
604
+ { { { makeDynCall ( 'vpii ' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
605
605
#endif
606
606
}
607
607
} ,
@@ -611,7 +611,7 @@ var LibraryGLFW = {
611
611
612
612
#if USE_GLFW == 3
613
613
if ( GLFW . active . framebufferSizeFunc ) {
614
- { { { makeDynCall ( 'viii ' , 'GLFW.active.framebufferSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
614
+ { { { makeDynCall ( 'vpii ' , 'GLFW.active.framebufferSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
615
615
}
616
616
#endif
617
617
} ,
@@ -642,8 +642,10 @@ var LibraryGLFW = {
642
642
} ,
643
643
644
644
setJoystickCallback : ( cbfun ) => {
645
+ var prevcbfun = GLFW . joystickFunc ;
645
646
GLFW . joystickFunc = cbfun ;
646
647
GLFW . refreshJoysticks ( ) ;
648
+ return prevcbfun ;
647
649
} ,
648
650
649
651
joys : { } , // glfw joystick data
@@ -780,7 +782,7 @@ var LibraryGLFW = {
780
782
var data = e . target . result ;
781
783
FS . writeFile ( path , new Uint8Array ( data ) ) ;
782
784
if ( ++ written === count ) {
783
- { { { makeDynCall ( 'viii ' , 'GLFW.active.dropFunc' ) } } } ( GLFW . active . id , count , filenames ) ;
785
+ { { { makeDynCall ( 'vpii ' , 'GLFW.active.dropFunc' ) } } } ( GLFW . active . id , count , filenames ) ;
784
786
785
787
for ( var i = 0 ; i < filenamesArray . length ; ++ i ) {
786
788
_free ( filenamesArray [ i ] ) ;
@@ -994,7 +996,7 @@ var LibraryGLFW = {
994
996
{ { { makeDynCall ( 'vii' , 'win.windowSizeFunc' ) } } } ( width , height ) ;
995
997
#endif
996
998
#if USE_GLFW == 3
997
- { { { makeDynCall ( 'viii ' , 'win.windowSizeFunc' ) } } } ( win . id , width , height ) ;
999
+ { { { makeDynCall ( 'vpii ' , 'win.windowSizeFunc' ) } } } ( win . id , width , height ) ;
998
1000
#endif
999
1001
}
1000
1002
} ,
@@ -1064,7 +1066,7 @@ var LibraryGLFW = {
1064
1066
1065
1067
#if USE_GLFW == 3
1066
1068
if ( win . windowCloseFunc ) {
1067
- { { { makeDynCall ( 'vi ' , 'win.windowCloseFunc' ) } } } ( win . id ) ;
1069
+ { { { makeDynCall ( 'vp ' , 'win.windowCloseFunc' ) } } } ( win . id ) ;
1068
1070
}
1069
1071
#endif
1070
1072
@@ -1220,7 +1222,7 @@ var LibraryGLFW = {
1220
1222
glfwExtensionSupported__deps : [ 'glGetString' ] ,
1221
1223
glfwExtensionSupported : ( extension ) => {
1222
1224
if ( ! GLFW . extensions ) {
1223
- GLFW . extensions = UTF8ToString ( _glGetString ( 0x1F03 ) ) . split ( ' ' ) ;
1225
+ GLFW . extensions = GL . getExtensions ( ) ;
1224
1226
}
1225
1227
1226
1228
if ( GLFW . extensions . includes ( extension ) ) return 1 ;
@@ -1758,7 +1760,7 @@ var LibraryGLFW = {
1758
1760
} ,
1759
1761
1760
1762
glfwCreateThread : ( fun , arg ) => {
1761
- { { { makeDynCall ( 'vi ' , 'fun' ) } } } ( arg ) ;
1763
+ { { { makeDynCall ( 'vp ' , 'fun' ) } } } ( arg ) ;
1762
1764
// One single thread
1763
1765
return 0 ;
1764
1766
} ,
0 commit comments