-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Backends: Allegro: Brough back al_draw_indexed_prim. #5937
Conversation
Hello, cheers, |
Why did you add the |
Regarding the check Using ImGui::OpenPopup("some dialog");
if(ImGui::BeginPopupModal("some dialog", &is_open)) {
node_is_open = ImGui::TreeNode("asda");
if(node_is_open) {
ImGui::TreePop();
}
ImGui::EndPopup();
} So right now, with Dear ImGui >= a5f3596 and Allegro >= 5.2.5, the program will crash whenever the user creates a modal with a TreeNode inside, because Dear ImGui is sending Allegro a Would it make sense to continue investigating this |
Very interesting! I’ll investigate that, from my pov it seems like a bug in core dear imgui but it is interesting that no other backends got affected by that. Will fix one way or another soon :) |
Awesome! I've tested a bunch and I can't get any crash at all. Looks like everything is fine now. Thanks! |
Context:
Some time back, Allegro's DirectX implementation of al_draw_indexed_prim broke. This originated commit 185b4dd in Dear ImGui. Some time later though, version 5.2.5 (February 2019) of Allegro ended up fixing this problem.
My changes:
I brought back the indexed primitive logic from that Dear ImGui commit, and updated it to today's code. Not only is this more optimized since it makes use of indexing, but it also removes an annoying compilation warning
("variable ‘indices’ set but not used [-Wunused-but-set-variable]")
consideringindices
is no longer unused. One thing to note: al_draw_indexed_prim doesn't seem to like it when the num_vtx argument is 0, which Dear ImGui sometimes does. I figured if'ing that case and skipping was the best solution.I admit I'm not 100% familiar with how that code works, but I'm confident enough to submit this PR. Basically, only the latest commit matters. But if this PR ends up being an unwanted change for some reason, then I instead propose using the first commit of the branch, which just removes the unused bit of code with the
indices
variable. Functionally, it's the same as before my PR, but with fewer compilation warnings. (That commit was made some hours ago before I realized Allegro had fixed the problem, and that I should probably try my hand at updating the backend. Oops.)Testing:
I've tried running the Dear ImGui demo with my PR's branch and found absolutely no problems. Tested on my Lubuntu machine, tested DirectX on a dinky Windows 7 virtual machine, and tested OpenGL and DirectX on a Windows 10 64-bit machine.