Closed tom-seddon closed 6 years ago
Yes, good point.
As far as I remember, I've already tried to remove most stuff that was not compatible with IMGUI_DISABLE_OBSOLETE_FUNCTIONS
once (I don't remember the precise commit now), but I've left out ImGui::Begin
, because it was more difficult to replace (it was not always a simple signature change).
Sooner or later we should replace them all...
Thanks for you PR.
These is still an issue with imguitoolbar.h: // Old deprecated version:
const bool dontSkip = inWindowMode || ImGui::Begin(name,NULL,toolbarWindowSize,0,flags);
// This PR:
bool dontSkip;
if (inWindowMode) {
dontSkip = true;
} else {
ImGui::SetNextWindowSize(toolbarWindowSize, ImGuiCond_FirstUseEver);
dontSkip = ImGui::Begin(name,NULL,flags);
}
Basically the background is no more transparent.
This is probably related to this issue: https://github.com/ocornut/imgui/issues/1568
I'll see if I can understand how to make the code work exactly the same way... (I knew ImGui::Begin
was difficult to port).
OK, it seems an easy fix.
This works (because the fourth argument of the deprecated Begin was the alpha value):
if (inWindowMode) {
dontSkip = true;
} else {
ImGui::SetNextWindowSize(toolbarWindowSize, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowBgAlpha(0.0f);
dontSkip = ImGui::Begin(name,NULL,flags);
}
Fixed.
Added the same fix to imguidock.cpp (even if I can see no visual changes).
ImGui::Begin
has different overloads whenIMGUI_DISABLE_OBSOLETE_FUNCTIONS
is defined. This seemed like an easy fix for imguidock.cpp so I fixed that. I also fixed up imguitoolbar.h, though my code doesn't use that, and I'm working on Windows at the moment, so while it does build as part of my project, it's untested...Anyway, even if you don't want this specific PR: it would be useful for the addons code to build with
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
, especially when it looks like it wouldn't be all that much work.Thanks,
--Tom