运行界面:
对应:
ImGui::Begin("Hello, world!");
ImGui::End();
对应:
ImGui::Text("This is some useful text.");
对应:
ImGui::Checkbox("Demo Window", &show_demo_window);
show_demo_window为true
ImGui::Checkbox("Another Window", &show_another_window);
show_another_window为flase
对应:
ImGui::SliderFloat("float", &f, 0.0f, 1.0f);
对应:
ImGui::ColorEdit3("clear color", (float*)&clear_color);
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
对应:
if (ImGui::Button("Button"))
counter++;
ImGui::SameLine();作用为保持下行内容在同一行。