|
| 1 | +#include "AboutWindow.h" |
| 2 | + |
| 3 | +#include "ProjectMGUI.h" |
| 4 | +#include "SystemBrowser.h" |
| 5 | + |
| 6 | +#include "ProjectMSDLApplication.h" |
| 7 | +#include "ProjectMWrapper.h" |
| 8 | + |
| 9 | +#include <imgui.h> |
| 10 | + |
| 11 | +#include <Poco/Util/Application.h> |
| 12 | + |
| 13 | +AboutWindow::AboutWindow(ProjectMGUI& gui) |
| 14 | + : _gui(gui) |
| 15 | + , _application(ProjectMSDLApplication::instance()) |
| 16 | + , _projectMWrapper(Poco::Util::Application::instance().getSubsystem<ProjectMWrapper>()) |
| 17 | +{ |
| 18 | +} |
| 19 | + |
| 20 | +void AboutWindow::Show() |
| 21 | +{ |
| 22 | + _visible = true; |
| 23 | +} |
| 24 | + |
| 25 | +void AboutWindow::Draw() |
| 26 | +{ |
| 27 | + if (!_visible) |
| 28 | + { |
| 29 | + return; |
| 30 | + } |
| 31 | + |
| 32 | + ImGui::SetNextWindowSize(ImVec2(750, 600), ImGuiCond_FirstUseEver); |
| 33 | + if (ImGui::Begin("About the projectM SDL Frontend", &_visible, ImGuiWindowFlags_NoCollapse)) |
| 34 | + { |
| 35 | + _gui.PushToastFont(); |
| 36 | + ImGui::TextUnformatted("projectM SDL Frontend"); |
| 37 | + _gui.PopFont(); |
| 38 | + ImGui::Dummy({.0f, 10.0f}); |
| 39 | + ImGui::Text("Version: %s", PROJECTMSDL_VERSION); |
| 40 | + ImGui::Text("libprojectM: %s (built with %s)", _projectMWrapper.ProjectMRuntimeVersion().c_str(), _projectMWrapper.ProjectMBuildVersion().c_str()); |
| 41 | + ImGui::Dummy({.0f, 20.0f}); |
| 42 | + ImGui::TextUnformatted("Brought to you by the projectM Team and contributors!"); |
| 43 | + ImGui::Dummy({.0f, 10.0f}); |
| 44 | + ImGui::Separator(); |
| 45 | + ImGui::Dummy({.0f, 10.0f}); |
| 46 | + ImGui::TextWrapped("The projectM SDL frontend is open-source software licensed under the GNU General Public License, version 3."); |
| 47 | + ImGui::Dummy({.0f, 10.0f}); |
| 48 | + ImGui::TextWrapped("Get the source code on GitHub or report an issue with the SDL frontend:"); |
| 49 | + if (ImGui::SmallButton("https://github.com/projectM-visualizer/frontend-sdl2")) |
| 50 | + { |
| 51 | + SystemBrowser::OpenURL("https://github.com/projectM-visualizer/frontend-sdl2"); |
| 52 | + } |
| 53 | + ImGui::Dummy({.0f, 10.0f}); |
| 54 | + if (ImGui::CollapsingHeader("Open-Source Software Used in this Application")) |
| 55 | + { |
| 56 | + ImGui::TextUnformatted("Used in projectM SDL:"); |
| 57 | + ImGui::BulletText("libprojectM by The projectM Team (GNU LGPL v2.1)"); |
| 58 | + ImGui::BulletText("Simple DirectMedia Layer 2 (SDL) (zlib License)"); |
| 59 | + ImGui::BulletText("Dear ImGui by Omar Cornut and contributors (MIT)"); |
| 60 | + ImGui::BulletText("The POCO C++ Framework by Applied Informatics GmbH (MIT)"); |
| 61 | + ImGui::BulletText("FreeType 2 (FreeType License / GNU GPL v2)"); |
| 62 | + |
| 63 | + ImGui::Dummy({.0f, 10.0f}); |
| 64 | + ImGui::TextUnformatted("Via libprojectM:"); |
| 65 | + ImGui::BulletText("projectm-eval by The projectM Team (MIT)"); |
| 66 | + ImGui::BulletText("SOIL2 by Martín Lucas Golini (MIT-0)"); |
| 67 | + ImGui::BulletText("hlslparser by Unknown Worlds Entertainment, Inc. (MIT)"); |
| 68 | + ImGui::BulletText("OpenGL Mathematics (GLM) by G-Truc Creation (The Happy Bunny License)"); |
| 69 | + } |
| 70 | + } |
| 71 | + ImGui::End(); |
| 72 | +} |
0 commit comments