Struct tetanes::nes::Nes

source ·
pub struct Nes { /* private fields */ }
Expand description

Represents all the NES Emulation state.

Implementations§

source§

impl Nes

source

pub fn handle_mouse_click(&mut self, s: &mut PixState, btn: Mouse) -> bool

source

pub fn set_zapper_pos(&mut self, pos: Point<i32>)

source

pub fn handle_mouse_motion(&mut self, pos: Point<i32>) -> bool

source§

impl Nes

source

pub fn run(&mut self) -> NesResult<()>

Begins emulation by starting the game engine loop.

Errors

If engine fails to build or run, then an error is returned.

Trait Implementations§

source§

impl Debug for Nes

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PixEngine for Nes

source§

fn on_start(&mut self, s: &mut PixState) -> PixResult<()>

Called once upon engine start when Engine::run is called. Read more
source§

fn on_update(&mut self, s: &mut PixState) -> PixResult<()>

Called after PixEngine::on_start, every frame based on the target frame rate. Read more
source§

fn on_stop(&mut self, s: &mut PixState) -> PixResult<()>

Called when the engine detects a close/exit event such as calling PixState::quit or if an error is returned during program execution by any PixEngine methods. Read more
source§

fn on_key_pressed( &mut self, s: &mut PixState, event: KeyEvent ) -> PixResult<bool>

Called each time a Key is pressed with the KeyEvent indicating which key and modifiers are pressed as well as whether this is a repeat event where the key is being held down. Read more
source§

fn on_key_released( &mut self, s: &mut PixState, event: KeyEvent ) -> PixResult<bool>

Called each time a Key is pressed with the KeyEvent indicating which key and modifiers are released. Read more
source§

fn on_mouse_pressed( &mut self, s: &mut PixState, btn: Mouse, _pos: Point<i32> ) -> PixResult<bool>

Called each time a Mouse button is pressed. Read more
source§

fn on_mouse_motion( &mut self, _s: &mut PixState, pos: Point<i32>, _rel_pos: Point<i32> ) -> PixResult<bool>

Called each time the Mouse is moved with the (x, y) screen coordinates and relative (xrel, yrel) positions since last frame. Read more
source§

fn on_controller_update( &mut self, _s: &mut PixState, controller_id: ControllerId, update: ControllerUpdate ) -> PixResult<bool>

Called each time a Controller is added, removed, or remapped. Read more
source§

fn on_controller_pressed( &mut self, s: &mut PixState, event: ControllerEvent ) -> PixResult<bool>

Called each time a ControllerButton is pressed with the ControllerEvent indicating which button is pressed. Read more
source§

fn on_controller_released( &mut self, s: &mut PixState, event: ControllerEvent ) -> PixResult<bool>

Called each time a ControllerButton is pressed with the ControllerEvent indicating which key and modifiers are released. Read more
source§

fn on_controller_axis_motion( &mut self, s: &mut PixState, controller_id: ControllerId, axis: Axis, value: i32 ) -> PixResult<bool>

Called each time a Controller Axis is moved with the delta since last frame. Read more
source§

fn on_window_event( &mut self, s: &mut PixState, window_id: WindowId, event: WindowEvent ) -> PixResult<()>

Called each time a window event occurs. Read more
source§

fn on_key_typed(&mut self, s: &mut PixState, text: &str) -> Result<bool, Error>

Called each time text input is received. Read more
source§

fn on_mouse_dragged( &mut self, s: &mut PixState, pos: Point, rel_pos: Point ) -> Result<bool, Error>

Called each time the Mouse is moved while any mouse button is being held. Read more
source§

fn on_mouse_released( &mut self, s: &mut PixState, btn: Mouse, pos: Point ) -> Result<bool, Error>

Called each time a Mouse button is released. Read more
source§

fn on_mouse_clicked( &mut self, s: &mut PixState, btn: Mouse, pos: Point ) -> Result<bool, Error>

Called each time a Mouse button is clicked (a press followed by a release). Read more
source§

fn on_mouse_dbl_clicked( &mut self, s: &mut PixState, btn: Mouse, pos: Point ) -> Result<bool, Error>

Called each time a Mouse button is clicked twice within 500ms. Read more
source§

fn on_mouse_wheel( &mut self, s: &mut PixState, pos: Point ) -> Result<bool, Error>

Called each time the Mouse wheel is scrolled with the (x, y) delta since last frame. Read more
source§

fn on_event(&mut self, s: &mut PixState, event: &Event) -> Result<bool, Error>

Called for any system or user event. This is a catch-all for handling any events not covered by other PixEngine methods. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Nes

§

impl !Send for Nes

§

impl !Sync for Nes

§

impl Unpin for Nes

§

impl UnwindSafe for Nes

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V