#include #include // services #include #include #include #include #include #include #include const char* argv0; //class ImGuiSpeechy { //private: //SoLoud::Speech speech; //SoLoud::Sfxr sfxr; //public: //ImGuiSpeechy(void) { //speech.setText("Test text. 1. 2. 3."); //sfxr.loadPreset(SoLoud::Sfxr::COIN, 0); //} //void renderImGui(MM::Engine& engine) { //if (ImGui::Begin("Inputs")) { //auto& sound = *engine.tryGetService(); //if (ImGui::Button("play sfx")) { //sound.engine.play(sfxr); //} ////ImGui::Text("Active Voice Count: %d", sound.engine.getActiveVoiceCount()); //if (ImGui::Button("Read")) { //sound.engine.play(speech); //} //} //ImGui::End(); //} //}; TEST(imgui_widgets, basic) { MM::Engine engine; auto& sdl_ss = engine.addService(); ASSERT_TRUE(engine.enableService()); sdl_ss.createGLWindow("imgui_widget_test", 1280, 720); engine.addService(argv0, "imgui_widget_test"); ASSERT_TRUE(engine.enableService()); engine.addService(); ASSERT_TRUE(engine.enableService()); auto& rs = engine.addService(); ASSERT_TRUE(engine.enableService()); rs.addRenderTask(engine); { //ImGuiSpeechy speechy; engine.addUpdate([&](MM::Engine&) { if (ImGui::Begin("test window")) { static float knob_test = 0.f; MM::ImGuiWidgets::KnobFloat("knob1", &knob_test, 0.f, 1.f); ImGui::SameLine(); MM::ImGuiWidgets::KnobFloat("knob2", &knob_test, 0.f, 1.f, 0.f, false); } ImGui::End(); }); engine.run(); } sdl_ss.destroyWindow(); } int main(int argc, char** argv) { argv0 = argv[0]; ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }