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

Implement Managed Asserts for ImGui 1.88 #1656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Soreepeong
Copy link
Contributor

@Soreepeong Soreepeong commented Feb 15, 2024

Also moved hardcoded offsets into ImGuiInternalStructs from DalamudIme.

@Soreepeong Soreepeong requested a review from a team as a code owner February 15, 2024 09:38
@goaaats
Copy link
Member

goaaats commented Feb 15, 2024

I was thinking that it might be more useful to override IM_ASSERT with a trampoline that passes the line and message into managed code, and make a checkbox to enable that, rather than actually adding our own validations.

I prototyped that and it seemed to work quite well, not sure what's the better way to go. With that approach you would also get inspections for a lot of other "invalid usage" of ImGui APIs.

@Soreepeong
Copy link
Contributor Author

If IM_ASSERT has not been nop'd on our current cimgui.dll, then definitely; if we need to compile it again, then we might as well add in other duct tape changes to there.

@goaaats
Copy link
Member

goaaats commented Feb 15, 2024

Obviously if we do stuff like that, it might be more worthwhile to fix the build situation for the native stuff first... But overriding those macros is technically the "supported" way to achieve that, so I'm more inclined towards that instead of messing with the context from C#. Seems like it's getting more pressing by the minute so maybe I should invest the time to work it out.

@Soreepeong
Copy link
Contributor Author

Regardless though, ImGui asserts will check for wrong usages at a point that may be difficult to trace back to its source; having scoped asserts for stacks in addition would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants