29 const std::string& assets_path,
30 const std::vector<std::string>& arguments,
31 const std::string& aot_library_path) {
32 if (!init_succeeded_) {
33 std::cerr <<
"Could not create window; FlutterDesktopInit failed."
39 std::cerr <<
"Only one Flutter window can exist at a time." << std::endl;
44 c_window_properties.
title = window_properties.
title.c_str();
45 c_window_properties.
width = window_properties.
width;
50 c_engine_properties.
assets_path = assets_path.c_str();
53 std::vector<const char*> engine_switches;
55 arguments.begin(), arguments.end(), std::back_inserter(engine_switches),
56 [](
const std::string& arg) ->
const char* { return arg.c_str(); });
57 if (!engine_switches.empty()) {
58 c_engine_properties.
switches = &engine_switches[0];
65 std::cerr <<
"Failed to create window." << std::endl;
94 std::chrono::milliseconds timeout) {
96 std::cerr <<
"Cannot run event loop without a window window; call "
101 uint32_t timeout_milliseconds;
102 if (timeout == std::chrono::milliseconds::max()) {
104 timeout_milliseconds = 0;
105 }
else if (timeout.count() > UINT32_MAX) {
106 timeout_milliseconds = UINT32_MAX;
108 timeout_milliseconds =
static_cast<uint32_t
>(timeout.count());
111 controller_, timeout_milliseconds);
112 if (!still_running) {
115 return still_running;