Trait Signal

Source
pub trait Signal: Any {
    // Provided methods
    fn init(
        &mut self,
        _renderer: &mut Renderer,
        _window: &Window,
        _objects: &mut ObjectStorage,
        _camera: &mut CameraContainer,
    ) { ... }
    fn device_events(
        &mut self,
        _renderer: &mut Renderer,
        _window: &Window,
        _objects: &mut ObjectStorage,
        _events: &DeviceEvent,
        _input: &WinitInputHelper,
        _camera: &mut CameraContainer,
    ) { ... }
    fn window_events(
        &mut self,
        _renderer: &mut Renderer,
        _window: &Window,
        _objects: &mut ObjectStorage,
        _events: &WindowEvent,
        _input: &WinitInputHelper,
        _camera: &mut CameraContainer,
    ) { ... }
    fn frame(
        &mut self,
        _renderer: &mut Renderer,
        _window: &Window,
        _objects: &mut ObjectStorage,
        _camera: &mut CameraContainer,
        _input: &WinitInputHelper,
        _encoder: &mut CommandEncoder,
        _view: &TextureView,
    ) { ... }
}
Expand description

Allows all events to be fetched directly, making it easier to add custom additions to the engine.

Provided Methods§

Source

fn init( &mut self, _renderer: &mut Renderer, _window: &Window, _objects: &mut ObjectStorage, _camera: &mut CameraContainer, )

This is ran as soon as the engine is properly initialized and all components are ready

Source

fn device_events( &mut self, _renderer: &mut Renderer, _window: &Window, _objects: &mut ObjectStorage, _events: &DeviceEvent, _input: &WinitInputHelper, _camera: &mut CameraContainer, )

This is ran at the device events when available

Source

fn window_events( &mut self, _renderer: &mut Renderer, _window: &Window, _objects: &mut ObjectStorage, _events: &WindowEvent, _input: &WinitInputHelper, _camera: &mut CameraContainer, )

This is ran at the window events when available

Source

fn frame( &mut self, _renderer: &mut Renderer, _window: &Window, _objects: &mut ObjectStorage, _camera: &mut CameraContainer, _input: &WinitInputHelper, _encoder: &mut CommandEncoder, _view: &TextureView, )

ran before the frame is rendered

Implementations§

Source§

impl dyn Signal

Source

pub fn is<_T>(&self) -> bool
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_ref<_T>(&self) -> Result<&_T, TypeMismatch>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_mut<_T>(&mut self) -> Result<&mut _T, TypeMismatch>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast<_T>( self: Box<dyn Signal>, ) -> Result<Box<_T>, DowncastError<Box<dyn Signal>>>
where _T: Any, dyn Signal: Downcast<_T>,

Source

pub fn downcast_rc<_T>( self: Rc<dyn Signal>, ) -> Result<Rc<_T>, DowncastError<Rc<dyn Signal>>>
where _T: Any, dyn Signal: Downcast<_T>,

Trait Implementations§

Source§

impl<_T> Downcast<_T> for dyn Signal
where _T: Any,

Implementors§