Document run_event_loop() and quit_event_loop()

The C++ versions were there before, but undocumented. The Rust version
for quit() was missing.
This commit is contained in:
Simon Hausmann 2021-06-29 16:12:00 +02:00
parent 032a158615
commit 5d58d34e84
3 changed files with 17 additions and 1 deletions

View file

@ -263,6 +263,14 @@ pub fn run_event_loop() {
.run_event_loop(sixtyfps_corelib::backend::EventLoopQuitBehavior::QuitOnLastWindowClosed);
}
/// Schedules the main event loop for termination. This function is meant
/// to be called from callbacks triggered by the UI. After calling the function,
/// it will return immediately and once control is passed back to the event loop,
/// the initial call to [`run_event_loop()`] will return.
pub fn quit_event_loop() {
sixtyfps_rendering_backend_default::backend().quit_event_loop();
}
/// Adds the specified function to an internal queue, notifies the event loop to wake up.
/// Once woken up, any queued up functors will be invoked.
///