Trait rust_chip8_opengl::interfaces::Interface

source ·
pub trait Interface {
    // Required methods
    fn update(&mut self, p: &mut Processor) -> bool;
    fn render(&mut self, p: &Processor);
    fn exit(&mut self);
}
Expand description

An interface between the user and the CHIP-8 Processor. Can be implemented for different interfaces (i.e. terminal, open-gl) and used by the same main program.

Required Methods§

source

fn update(&mut self, p: &mut Processor) -> bool

Update the inputs in the processor and the sound. Return true if the program should exit, false otherwise.

source

fn render(&mut self, p: &Processor)

Render the screen.

source

fn exit(&mut self)

Cleanup function that should be called on exit before the program quits.

Implementors§