Skip to content

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

@vic1707

Description

@vic1707

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions