Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for event handling #67
Conversation
nchashch
added some commits
Jul 10, 2016
kvark
reviewed
Jul 18, 2016
| + /// Return a vector containing clones of all published entities | ||
| + pub fn poll(&self) -> Vec<Entity> { | ||
| + let entities = self.world.entities(); | ||
| + let _entities: Vec<Entity> = entities.iter().map(|e| e.clone()).collect(); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kvark
Jul 18, 2016
Member
should probably keep that vector owned, re-use it, and return &[Entity] instead, to avoid re-allocations
kvark
Jul 18, 2016
Member
should probably keep that vector owned, re-use it, and return &[Entity] instead, to avoid re-allocations
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Looks good to me. @ebkalderon ? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Solid work, @nchashch! Thank you. I think this can be merged. |
ebkalderon
merged commit cb367b5
into
amethyst:develop
Jul 18, 2016
1 check passed
Emilgardis
reviewed
Jul 18, 2016
| + #[cfg(windows)] | ||
| + VideoContext::Direct3D { } => { | ||
| + // stub | ||
| + let event = EngineEvent::new(Event::Closed); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Emilgardis
Jul 18, 2016
Contributor
Event is not defined. New to amethyst, but I imagine it should be glutin::Event. How did travis not pick this up?
Emilgardis
Jul 18, 2016
•
Contributor
Event is not defined. New to amethyst, but I imagine it should be glutin::Event. How did travis not pick this up?
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nchashch
Jul 18, 2016
Member
It is guarded with #[cfg(windows)], so that is probably why it is accepted by Travis, and why I missed it (I built it only on linux).
nchashch
Jul 18, 2016
•
Member
It is guarded with #[cfg(windows)], so that is probably why it is accepted by Travis, and why I missed it (I built it only on linux).
added a commit
to Emilgardis/amethyst
that referenced
this pull request
Jul 18, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Emilgardis
Jul 18, 2016
Contributor
Used githubs provided web-interface for making pull-requests, bad mistake. Anyway, e04fbc6 should be fixed by either appending glutin:: to Event::Closed or making glutin::Event in scope via use glutin::Event.
|
Used githubs provided web-interface for making pull-requests, bad mistake. Anyway, e04fbc6 should be fixed by either appending |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nchashch
Jul 18, 2016
Member
It would be better to import event::Event instead of glutin::Event. Because glutin::Event is reexported in amethyst_context::event module, also extern crate glutin; in amethyst_context module is unnecessary.
|
It would be better to import |
nchashch commentedJul 16, 2016
Changes:
Broadcasterstruct which allows publishing specs entities. An instance ofBroadcasteris owned byContext.EngineEventcomponent. At the begining of everyApplication::advance_frame()events of this type are polled from theContextand published usingBroadcaster.Note:
EngineEventis a wraper aroundglutin::Event. Andamethyst_context::eventmodule reexports all event structs and enums from glutin.Context::poll_engine_events()method. It polls platform specific events, translates them toEngneEvents and returns them.VideoContext::Nullbackend.It should close #46