embedded-menu icon indicating copy to clipboard operation
embedded-menu copied to clipboard

simulator requires to re-create the display in main loop?

Open vic1707 opened this issue 1 year ago • 0 comments

in all examples we find

// setup code
'running: loop {
    let mut display = SimulatorDisplay::new(Size::new(128, 64));
    menu.update(&display);
    menu.draw(&mut display).unwrap();
    window.update(&display);
    
    // event handling logic
}
Ok(())

I tried creating the display only once, it results in afterimages of everything that was once on screen. Why do we have to re-create the simulated display, shouldn't menu.update turn of the pixel that aren't used anymore ?

Looking at the examples from embedded-graphics-simulator, it appears that they don't do that.

vic1707 avatar Feb 01 '25 20:02 vic1707