File tree Expand file tree Collapse file tree
crates/lambda-platform/src/winit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,7 +39,11 @@ pub mod winit_exports {
3939pub struct LoopBuilder ;
4040
4141impl LoopBuilder {
42- pub fn build < Events : ' static + std:: fmt:: Debug > ( ) -> Loop < Events > {
42+ pub fn new ( ) -> Self {
43+ return Self ;
44+ }
45+
46+ pub fn build < Events : ' static + std:: fmt:: Debug > ( self ) -> Loop < Events > {
4347 let event_loop = EventLoop :: < Events > :: with_user_event ( ) ;
4448 return Loop { event_loop } ;
4549 }
@@ -182,15 +186,11 @@ fn construct_window_size(
182186 } ;
183187}
184188
189+ /// Event loop publisher wrapper for pushing events into a winit event loop.
185190pub struct LoopPublisher < E : ' static > {
186191 winit_proxy : EventLoopProxy < E > ,
187192}
188193
189- #[ derive( Clone , Debug ) ]
190- pub struct EventLoopPublisher < E : ' static + std:: fmt:: Debug > {
191- winit_proxy : EventLoopProxy < E > ,
192- }
193-
194194impl < E : ' static + std:: fmt:: Debug > LoopPublisher < E > {
195195 /// Instantiate a new EventLoopPublisher from an event loop proxy.
196196 #[ inline]
@@ -238,7 +238,7 @@ impl<E: 'static + std::fmt::Debug> Loop<E> {
238238 }
239239 }
240240
241- /// Uses the winit event loop to run forever.
241+ /// Uses the winit event loop to run forever
242242 pub fn run_forever < Callback > ( self , callback : Callback )
243243 where
244244 Callback : ' static
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ use lambda_platform::winit::{
88 WindowEvent as WinitWindowEvent ,
99 } ,
1010 Loop ,
11+ LoopBuilder ,
1112} ;
1213
1314use crate :: core:: {
@@ -82,7 +83,7 @@ impl GenericRuntimeBuilder {
8283 /// Kernel to receive events & render access.
8384 pub fn build ( self ) -> GenericRuntime {
8485 let name = self . app_name ;
85- let mut event_loop = create_event_loop :: < Events > ( ) ;
86+ let mut event_loop = LoopBuilder :: new ( ) . build ( ) ;
8687 let ( width, height) = self . window_size ;
8788
8889 let window = WindowBuilder :: new ( )
You can’t perform that action at this time.
0 commit comments