return bool true from Init for consistency with other backends (although no other outcome is possible)

This commit is contained in:
SlowRiot 2026-09-04 12:47:34 +01:00
parent ca7b9ca3d5
commit 796b15e894
2 changed files with 4 additions and 2 deletions

View File

@ -123,7 +123,7 @@ static ImGui_ImplEmscripten_Data* ImGui_ImplEmscripten_GetBackendData()
return ImGui::GetCurrentContext() ? (ImGui_ImplEmscripten_Data*)ImGui::GetIO().BackendPlatformUserData : nullptr;
}
void ImGui_ImplEmscripten_Init()
bool ImGui_ImplEmscripten_Init()
{
// Initialise the Emscripten backend, setting input callbacks
ImGuiIO& io = ImGui::GetIO();
@ -377,6 +377,8 @@ void ImGui_ImplEmscripten_Init()
);
// TODO: Touch events
return true;
}
void ImGui_ImplEmscripten_Shutdown()

View File

@ -45,7 +45,7 @@
extern IMGUI_IMPL_API float ImGui_ImplEmscripten_TargetDevicePixelRatio;
// Initialise the Emscripten backend, setting input callbacks. This should be called after ImGui::CreateContext();
IMGUI_IMPL_API void ImGui_ImplEmscripten_Init();
IMGUI_IMPL_API bool ImGui_ImplEmscripten_Init();
// Shut down the Emscripten backend. This unsets all Emscripten input callbacks set by Init.
// Note it'll also unset any Emscripten input callbacks set elsewhere in the program!