@@ -674,6 +674,14 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
674
674
// GLFW will emit an error which will often be printed by the app, so we temporarily disable error reporting.
675
675
// Missing cursors will return nullptr and our _UpdateMouseCursor() function will use the Arrow cursor instead.)
676
676
GLFWerrorfun prev_error_callback = glfwSetErrorCallback (nullptr );
677
+
678
+ // axmol spec: Fix wasm64 javascript exception
679
+ // Note: The WASM actually not support glfwCreateStandardCursor until emsdk-4.0.1 Jan.17 2025
680
+ // Uncaught TypeError: Cannot convert undefined to a BigInt
681
+ // at BigInt (<anonymous>)
682
+ // at _glfwCreateStandardCursor (http://localhost:6931/cpp-tests.js:16617:12)
683
+ // at cpp-tests.wasm.ImGui_ImplGlfw_Init(GLFWwindow*, bool, GlfwClientApi)
684
+ #ifndef __EMSCRIPTEN__
677
685
bd->MouseCursors [ImGuiMouseCursor_Arrow] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR);
678
686
bd->MouseCursors [ImGuiMouseCursor_TextInput] = glfwCreateStandardCursor (GLFW_IBEAM_CURSOR);
679
687
bd->MouseCursors [ImGuiMouseCursor_ResizeNS] = glfwCreateStandardCursor (GLFW_VRESIZE_CURSOR);
@@ -689,6 +697,7 @@ static bool ImGui_ImplGlfw_Init(GLFWwindow* window, bool install_callbacks, Glfw
689
697
bd->MouseCursors [ImGuiMouseCursor_ResizeNESW] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR);
690
698
bd->MouseCursors [ImGuiMouseCursor_ResizeNWSE] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR);
691
699
bd->MouseCursors [ImGuiMouseCursor_NotAllowed] = glfwCreateStandardCursor (GLFW_ARROW_CURSOR);
700
+ #endif
692
701
#endif
693
702
glfwSetErrorCallback (prev_error_callback);
694
703
#if GLFW_HAS_GETERROR && !defined(__EMSCRIPTEN__) // Eat errors (see #5908)
@@ -1098,7 +1107,7 @@ struct ImGui_ImplGlfw_ViewportData
1098
1107
WNDPROC PrevWndProc;
1099
1108
#endif
1100
1109
1101
- ImGui_ImplGlfw_ViewportData () { memset (this , 0 , sizeof (*this )); IgnoreWindowSizeEventFrame = IgnoreWindowPosEventFrame = -1 ; }
1110
+ ImGui_ImplGlfw_ViewportData () { memset (( void *) this , 0 , sizeof (*this )); IgnoreWindowSizeEventFrame = IgnoreWindowPosEventFrame = -1 ; }
1102
1111
~ImGui_ImplGlfw_ViewportData () { IM_ASSERT (Window == nullptr ); }
1103
1112
};
1104
1113
0 commit comments