#include #include #include #include #include #include #include #include using namespace entt::literals; TEST(imgui_render_task, demowindow) { MM::Engine engine; engine.addService(); ASSERT_TRUE(engine.enableService()); auto& rs = engine.addService(); ASSERT_TRUE(engine.enableService()); // needs a open window (and opengl context) which the OpenGLRenderer creates in this case engine.addService(); ASSERT_TRUE(engine.enableService()); class ImGuiDemoWindowService : public MM::Services::Service { public: const char* name(void) override { return "ImGuiDemoWindowService"; } bool enable(MM::Engine&, std::vector& task_array) override { task_array.push_back( MM::UpdateStrategies::TaskInfo{"ImGuiDemoWindow"} .fn([](MM::Engine&) { ImGui::ShowDemoWindow(); }) ); return true; } void disable(MM::Engine&) override {} }; engine.addService(); ASSERT_TRUE(engine.enableService()); rs.addRenderTask(engine); #ifdef MM_AUTOTEST engine.addService(50); // 50 frames ASSERT_TRUE(engine.enableService()); #endif engine.run(); } int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }