Viewports: (breaking) removed ImGuiPlatformIO::MainViewport which is now pretty much unused and duplicate (and misleading as we will evolve the concept)

Use GetMainViewport() if stuck.
This commit is contained in:
ocornut
2021-02-05 16:00:17 +01:00
parent 22d9a61b33
commit fa55b0cb60
4 changed files with 14 additions and 12 deletions

View File

@ -6575,7 +6575,7 @@ void ImGui::EndMenuBar()
bool ImGui::BeginMainMenuBar()
{
ImGuiContext& g = *GImGui;
ImGuiViewportP* viewport = g.Viewports[0];
ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport();
ImGuiWindow* menu_bar_window = FindWindowByName("##MainMenuBar");
// For the main menu bar, which cannot be moved, we honor g.Style.DisplaySafeAreaPadding to ensure text can be visible on a TV set.