Skip to content

Commit

Permalink
fix: events signal not firing
Browse files Browse the repository at this point in the history
BREAKING: events signal renamed to device_events and now only provides &DeviceEvent
  • Loading branch information
ElhamAryanpur committed Aug 14, 2024
1 parent 5f2a7cb commit 31b53f9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

All notable changes to this project will be documented in this file.

## [0.5.16] - 2024-08-12

### Features

- Added window functions that goes to effect during update_loop initialization ([4061da7](https://github.com/AryanpurTech/BlueEngine/commit/4061da79430c058cc58562e717de804248ca0e6b))
- More sane setter functions ([1913327](https://github.com/AryanpurTech/BlueEngine/commit/191332702b9c5cd52ccdc261acb7c9ce47dd8dda))

### Miscellaneous Tasks

- Fix: #68 - updated dependencies to latest version ([f13bcf8](https://github.com/AryanpurTech/BlueEngine/commit/f13bcf8f7ed69cb057dbb4efa36629d6524de8a1))

## [0.5.10] - 2024-06-06

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blue_engine"
version = "0.5.16"
version = "0.5.17"
authors = ["Elham Aryanpur <elhamaryanpur5@gmail.com>"]
edition = "2021"
description = "General-Purpose, Easy-to-use, Fast, and Portable graphics engine"
Expand Down
4 changes: 2 additions & 2 deletions src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,12 +563,12 @@ pub struct Instance {
pub trait Signal: Any {
/// This is ran before any of the render events, it's generally used to capture raw input.
#[allow(clippy::too_many_arguments)]
fn events(
fn device_events(
&mut self,
_renderer: &mut crate::Renderer,
_window: &crate::Window,
_objects: &mut ObjectStorage,
_events: &crate::Event<()>,
_events: &crate::DeviceEvent,
_input: &crate::InputHelper,
_camera: &mut crate::CameraContainer,
) {
Expand Down
15 changes: 14 additions & 1 deletion src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,20 @@ impl ApplicationHandler for Engine {
_device_id: winit::event::DeviceId,
event: DeviceEvent,
) {
self.input_events.process_device_event(&event);
let Self {
ref mut camera,
ref mut renderer,
ref mut window,
ref mut objects,
input_events,
signals,
..
} = self;

input_events.process_device_event(&event);
signals.events.iter_mut().for_each(|i| {
i.1.device_events(renderer, window, objects, &event, input_events, camera);
});
}

fn window_event(
Expand Down

0 comments on commit 31b53f9

Please sign in to comment.