Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImGui's only error-reporting mechanism is to throw an AccessViolationException and take down the entire editor / engine / runtime. #815

Open
bryanedds opened this issue May 15, 2024 · 2 comments
Labels
gaia issue relating to Gaia game editor imgui issue originating from imgui*

Comments

@bryanedds
Copy link
Owner

Issue filed with ImGui.NET here -

ImGuiNET/ImGui.NET#477

@bryanedds bryanedds added bug imgui issue originating from imgui* labels May 15, 2024
@bryanedds bryanedds added the gaia issue relating to Gaia game editor label Jul 20, 2024
@bryanedds
Copy link
Owner Author

Via mellinoe on discord - "What you are talking about sounds like ocornut/imgui#1651"

bryanedds — Today at 12:05 PM
reading over this doc that was linked to from that discussion - https://github.com/ocornut/imgui/wiki/Error-Handling
it looks like I can for the most part simply avoid a runtime crash with this - io.ConfigErrorRecoveryEnableAssert <- false
which i think solves the biggest problem with the issue for the most part
one of the prescribed error recovery patterns doesn't work in .NET, tho -

ImGuiErrorRecoveryState state;
ImGui::ErrorRecoveryStoreState(&state);
try
{
    .... run code
}
catch
{
    ImGui::ErrorRecoveryTryToRecoverState(&state);
}

In .NET, you cannot catch an AccessViolationException or an EngineExecutionException and also
ImGui.NET appears to not provide the API for ErrorRecoveryStoreState
(which may make sense because the above pattern is not implementable anyways)
so the only thing we can really do in .NET is avoid the asserts in the first place
which, i think is fine for now, but still, I think there's utility in having a callback when people want to leave ImGui asserts on.

@bryanedds
Copy link
Owner Author

Removed bug label since this should rarely be an issue due to commit 022a799.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gaia issue relating to Gaia game editor imgui issue originating from imgui*
Projects
None yet
Development

No branches or pull requests

1 participant