@@ -33,7 +33,8 @@ use crate::core::{
3333
3434pub struct GenericRuntimeBuilder {
3535 app_name : String ,
36- render_api : RenderContextBuilder ,
36+ render_context_builder : RenderContextBuilder ,
37+ window_builder : WindowBuilder ,
3738 window_size : ( u32 , u32 ) ,
3839 components : Vec < Box < dyn RenderableComponent < Events > > > ,
3940}
@@ -42,7 +43,8 @@ impl GenericRuntimeBuilder {
4243 pub fn new ( app_name : & str ) -> Self {
4344 return Self {
4445 app_name : app_name. to_string ( ) ,
45- render_api : RenderContextBuilder :: new ( app_name) ,
46+ render_context_builder : RenderContextBuilder :: new ( app_name) ,
47+ window_builder : WindowBuilder :: new ( ) ,
4648 window_size : ( 800 , 600 ) ,
4749 components : Vec :: new ( ) ,
4850 } ;
@@ -54,20 +56,29 @@ impl GenericRuntimeBuilder {
5456 return self ;
5557 }
5658
57- pub fn with_window_size ( mut self , width : u32 , height : u32 ) -> Self {
58- self . window_size = ( width, height) ;
59+ /// Configures the `RenderAPIBuilder` before the `RenderContext` is built
60+ /// using a callback provided by the user. The renderer in it's default
61+ /// state will be good enough for most applications, but if you need to
62+ /// customize the renderer you can do so here.
63+ pub fn with_renderer_configured_as (
64+ mut self ,
65+ configuration : impl FnOnce ( RenderContextBuilder ) -> RenderContextBuilder ,
66+ ) -> Self {
67+ self . render_context_builder = configuration ( self . render_context_builder ) ;
5968 return self ;
6069 }
6170
62- /// Configures the RenderAPIBuilder before the RenderingAPI is built using a
63- /// callback provided by the user.
64- pub fn with_renderer (
71+ /// Configures the WindowBuilder before the Window is built using a callback
72+ /// provided by the user. If you need to customize the window you can do so
73+ /// here.
74+ pub fn with_window_configured_as (
6575 mut self ,
66- configure : impl FnOnce ( RenderContextBuilder ) -> RenderContextBuilder ,
76+ configuration : impl FnOnce ( WindowBuilder ) -> WindowBuilder ,
6777 ) -> Self {
68- self . render_api = configure ( self . render_api ) ;
78+ self . window_builder = configuration ( self . window_builder ) ;
6979 return self ;
7080 }
81+
7182 /// Attach a component to the current runnable.
7283 pub fn with_component < T : Default + RenderableComponent < Events > + ' static > (
7384 self ,
@@ -92,7 +103,7 @@ impl GenericRuntimeBuilder {
92103 . with_dimensions ( width, height)
93104 . build ( & mut event_loop) ;
94105 let component_stack = self . components ;
95- let render_api = self . render_api . build ( & window) ;
106+ let render_api = self . render_context_builder . build ( & window) ;
96107
97108 return GenericRuntime {
98109 name,
@@ -271,7 +282,7 @@ impl Runtime for GenericRuntime {
271282 WinitEvent :: UserEvent ( lambda_event) => match lambda_event {
272283 Events :: Runtime { event, issued_at } => match event {
273284 RuntimeEvent :: Initialized => {
274- println ! ( "Starting the kernel {}" , name) ;
285+ println ! ( "[INFO] Initializing all of the components for the runtime: {}" , name) ;
275286 for component in & mut component_stack {
276287 component. on_attach ( ) ;
277288 component
0 commit comments