| 2751 | } |
| 2752 | |
| 2753 | void ShowDemoWindow(bool* p_open) { |
| 2754 | static bool show_implot_metrics = false; |
| 2755 | static bool show_implot_style_editor = false; |
| 2756 | static bool show_imgui_metrics = false; |
| 2757 | static bool show_imgui_style_editor = false; |
| 2758 | static bool show_imgui_demo = false; |
| 2759 | |
| 2760 | if (show_implot_metrics) { |
| 2761 | ImPlot::ShowMetricsWindow(&show_implot_metrics); |
| 2762 | } |
| 2763 | if (show_implot_style_editor) { |
| 2764 | ImGui::SetNextWindowSize(ImVec2(415,762), ImGuiCond_Appearing); |
| 2765 | ImGui::Begin("Style Editor (ImPlot)", &show_implot_style_editor); |
| 2766 | ImPlot::ShowStyleEditor(); |
| 2767 | ImGui::End(); |
| 2768 | } |
| 2769 | if (show_imgui_style_editor) { |
| 2770 | ImGui::Begin("Style Editor (ImGui)", &show_imgui_style_editor); |
| 2771 | ImGui::ShowStyleEditor(); |
| 2772 | ImGui::End(); |
| 2773 | } |
| 2774 | if (show_imgui_metrics) { |
| 2775 | ImGui::ShowMetricsWindow(&show_imgui_metrics); |
| 2776 | } |
| 2777 | if (show_imgui_demo) { |
| 2778 | ImGui::ShowDemoWindow(&show_imgui_demo); |
| 2779 | } |
| 2780 | ImGui::SetNextWindowPos(ImVec2(50, 50), ImGuiCond_FirstUseEver); |
| 2781 | ImGui::SetNextWindowSize(ImVec2(600, 750), ImGuiCond_FirstUseEver); |
| 2782 | ImGui::Begin("ImPlot Demo", p_open, ImGuiWindowFlags_MenuBar); |
| 2783 | if (ImGui::BeginMenuBar()) { |
| 2784 | if (ImGui::BeginMenu("Tools")) { |
| 2785 | ImGui::MenuItem("Metrics", nullptr, &show_implot_metrics); |
| 2786 | ImGui::MenuItem("Style Editor", nullptr, &show_implot_style_editor); |
| 2787 | ImGui::Separator(); |
| 2788 | ImGui::MenuItem("ImGui Metrics", nullptr, &show_imgui_metrics); |
| 2789 | ImGui::MenuItem("ImGui Style Editor", nullptr, &show_imgui_style_editor); |
| 2790 | ImGui::MenuItem("ImGui Demo", nullptr, &show_imgui_demo); |
| 2791 | ImGui::EndMenu(); |
| 2792 | } |
| 2793 | ImGui::EndMenuBar(); |
| 2794 | } |
| 2795 | //------------------------------------------------------------------------- |
| 2796 | ImGui::Text("ImPlot says hello! (%s) (%d)", IMPLOT_VERSION, IMPLOT_VERSION_NUM); |
| 2797 | // display warning about 16-bit indices |
| 2798 | static bool showWarning = sizeof(ImDrawIdx)*8 == 16 && (ImGui::GetIO().BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset) == false; |
| 2799 | if (showWarning) { |
| 2800 | ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1,1,0,1)); |
| 2801 | ImGui::TextWrapped("WARNING: ImDrawIdx is 16-bit and ImGuiBackendFlags_RendererHasVtxOffset is false. Expect visual glitches and artifacts! See README for more information."); |
| 2802 | ImGui::PopStyleColor(); |
| 2803 | } |
| 2804 | |
| 2805 | ImGui::Spacing(); |
| 2806 | |
| 2807 | if (ImGui::BeginTabBar("ImPlotDemoTabs")) { |
| 2808 | if (ImGui::BeginTabItem("Plots")) { |
| 2809 | DemoHeader("Line Plots", Demo_LinePlots); |
| 2810 | DemoHeader("Filled Line Plots", Demo_FilledLinePlots); |
no test coverage detected