#include #include #include #include TEST(simple_sdl_renderer, basic) { srand(1); MM::Engine engine; // sdl dep { engine.addService(); ASSERT_TRUE(engine.enableService()); } auto& ren = engine.addService(); ASSERT_TRUE(engine.enableService()); ren.processors.emplace_back([](auto& r, auto&) { r.targets["display"].set(r.renderer); SDL_Rect rect { rand() % 700, rand() % 500, 100, 100 }; SDL_SetRenderDrawColor(r.renderer, 255, 0, 0, 255); SDL_RenderFillRect(r.renderer, &rect); } ); engine.run(); } int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); }