nannou-org / nannou

A Creative Coding Framework for Rust.
https://nannou.cc/
6.04k stars 305 forks source link

set_title seems to interfere with LoopMode::NTimes #973

Open shroom00 opened 4 months ago

shroom00 commented 4 months ago

When setting a window's title, the app doesn't process the specified number of updates. I'm unsure if this is specifically due to set_title or if it's the fault of some other underlying issue. I usually reach about 60% of the expected number of updates, although this may vary between devices.

Here's a minimal reproducible example:

use nannou::prelude::*;

struct Model {}

fn main() {
    nannou::app(model).simple_window(view).loop_mode(LoopMode::loop_ntimes(100)).run();
}

fn model(_app: &App) -> Model {
    Model {}
}

fn view(app: &App, _model: &Model, frame: Frame) {
        println!("{}", frame.nth());
        app.main_window().set_title(&format!("{}", frame.nth()));
}