demo_implot.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Part of ImGui Bundle - MIT License - Copyright (c) 2022-2026 Pascal Thomet - https://github.com/pthom/imgui_bundle
  2. #if defined(IMGUI_BUNDLE_WITH_IMPLOT) && defined(IMGUI_BUNDLE_WITH_IMPLOT3D)
  3. #include "implot/implot.h"
  4. #include "implot3d/implot3d.h"
  5. #include "immapp/immapp.h"
  6. #ifdef IMGUI_BUNDLE_WITH_IMGUI_EXPLORER_LIB
  7. #include "imgui_explorer.h"
  8. #endif
  9. void demo_implot()
  10. {
  11. ImGuiMd::RenderUnindented(R"(
  12. [Implot](https://github.com/epezent/implot) and [Implot3D](https://github.com/brenocq/implot3d) are fast and efficient libraries which provide immediate Mode Plotting.
  13. )");
  14. if (ImGui::CollapsingHeader("ImPlot: Full Demo"))
  15. {
  16. #ifdef IMGUI_BUNDLE_WITH_IMGUI_EXPLORER_LIB
  17. ImGui::PushID("ImPlotDemo");
  18. ShowImGuiExplorerGui_Cpp(ImGuiExplorerLibrary::ImPlot);
  19. ImGui::PopID();
  20. #else
  21. ImPlot::ShowDemoWindow_MaybeDocked(false);
  22. #endif
  23. }
  24. if (ImGui::CollapsingHeader("ImPlot3D: Full Demo"))
  25. {
  26. #ifdef IMGUI_BUNDLE_WITH_IMGUI_EXPLORER_LIB
  27. ImGui::PushID("ImPlot3DDemo");
  28. ShowImGuiExplorerGui_Cpp(ImGuiExplorerLibrary::ImPlot3D);
  29. ImGui::PopID();
  30. #else
  31. ImPlot3D::ShowAllDemos();
  32. #endif
  33. }
  34. }
  35. #else // defined(IMGUI_BUNDLE_WITH_IMPLOT) && defined(IMGUI_BUNDLE_WITH_IMPLOT3D)
  36. #include "imgui.h"
  37. void demo_implot() { ImGui::Text("Dear ImGui Bundle was compiled without support for both ImPlot and ImPlot3D"); }
  38. #endif