From c6952a66c88a2abc9b2f620fee46168e0a984a24 Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 6 Aug 2024 21:27:26 -0400 Subject: [PATCH] ignore NewMasterFrame on iOS --- src/app/core/controller.cc | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/app/core/controller.cc b/src/app/core/controller.cc index 4ba4bbc9..54e2cdbb 100644 --- a/src/app/core/controller.cc +++ b/src/app/core/controller.cc @@ -39,7 +39,6 @@ constexpr ImGuiWindowFlags kMainEditorFlags = ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoTitleBar; -using ::ImVec2; using ImGui::Begin; using ImGui::End; using ImGui::GetIO; @@ -352,8 +351,17 @@ absl::Status Controller::OnLoad() { if (master_editor_.quit()) { active_ = false; } - NewMasterFrame(); +#if TARGET_OS_IPHONE != 1 + if (platform_ != Platform::kiOS) { + NewMasterFrame(); + } +#endif RETURN_IF_ERROR(master_editor_.Update()); +#if TARGET_OS_IPHONE != 1 + if (platform_ != Platform::kiOS) { + End(); + } +#endif return absl::OkStatus(); } @@ -365,25 +373,13 @@ void Controller::DoRender() const { } void Controller::OnExit() { - ImGui::DestroyContext(); if (flags()->kLoadAudioDevice) { SDL_PauseAudioDevice(audio_device_, 1); SDL_CloseAudioDevice(audio_device_); delete audio_buffer_; } - switch (platform_) { - case Platform::kMacOS: - case Platform::kWindows: - case Platform::kLinux: - ImGui_ImplSDLRenderer2_Shutdown(); - ImGui_ImplSDL2_Shutdown(); - break; - case Platform::kiOS: - // Deferred - break; - default: - break; - } + ImGui_ImplSDLRenderer2_Shutdown(); + ImGui_ImplSDL2_Shutdown(); ImGui::DestroyContext(); SDL_Quit(); }