File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11pub mod component;
22pub mod events;
3- pub mod kernel;
43pub mod render;
4+ pub mod runtime;
55pub mod window;
Original file line number Diff line number Diff line change 1+ pub trait Runtime {
2+ fn on_start ( & mut self ) ;
3+ fn on_stop ( & mut self ) ;
4+ fn run ( self ) ;
5+ }
6+
7+ /// Builds & executes a runtime all in one good. It's a good idea to use this if you
8+ /// don't need to execute any code in between the building & execution stage of
9+ /// the runnable, but will not impact or modify the runtime in any way.
10+ pub fn build_and_start_kernel < T : Default + Runtime > ( ) {
11+ let runtime = T :: default ( ) ;
12+ start_runtime ( runtime) ;
13+ }
14+
15+ /// Simple function for starting any prebuilt Runnable.
16+ pub fn start_runtime < T : Runtime > ( mut runtime : T ) {
17+ runtime. on_start ( ) ;
18+ runtime. run ( ) ;
19+ }
Original file line number Diff line number Diff line change 11pub mod components;
22pub mod core;
3- pub mod kernels ;
3+ pub mod runtimes ;
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ use crate::core::{
1818 RuntimeEvent ,
1919 WindowEvent ,
2020 } ,
21- kernel:: Runtime ,
2221 render:: {
2322 window:: {
2423 Window ,
@@ -27,6 +26,7 @@ use crate::core::{
2726 RenderContext ,
2827 RenderContextBuilder ,
2928 } ,
29+ runtime:: Runtime ,
3030} ;
3131
3232pub struct GenericRuntimeBuilder {
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ use lambda::{
77 RenderableComponent ,
88 } ,
99 events:: Events ,
10- kernel:: start_runtime,
1110 render:: {
1211 command:: RenderCommand ,
1312 pipeline:: {
@@ -26,8 +25,9 @@ use lambda::{
2625 } ,
2726 viewport,
2827 } ,
28+ runtime:: start_runtime,
2929 } ,
30- kernels :: GenericRuntimeBuilder ,
30+ runtimes :: GenericRuntimeBuilder ,
3131} ;
3232
3333pub struct DemoComponent {
You can’t perform that action at this time.
0 commit comments