| 14 | extern "C" { |
| 15 | #ifdef _WIN32 |
| 16 | __declspec(dllexport) |
| 17 | #else |
| 18 | __attribute__((visibility("default"))) |
| 19 | #endif |
| 20 | int run_example(int argc, const char** argv) { |
| 21 | (void)argc; // Suppress unused parameter warning |
| 22 | (void)argv; // Examples don't typically use command-line args |
| 23 | |
| 24 | // Scoped cleanup - destructor calls EngineEvents::onExit() automatically |
| 25 | fl::stub_main::ScopedEngineCleanup cleanup; |
| 26 | |
| 27 | // Run setup() once, then loop() until next_loop() returns false |
| 28 | fl::stub_main::setup(); |
| 29 | while (fl::stub_main::next_loop()) { |
| 30 | // Loop continues based on FASTLED_STUB_MAIN_FAST_EXIT |
| 31 | } |
| 32 | |
| 33 | return 0; // cleanup destructor called here |
| 34 | } |
| 35 | } |