File tree Expand file tree Collapse file tree
crates/lambda-platform/src/gfx Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ impl SubpassBuilder {
125125 } ;
126126 }
127127
128- pub fn use_color_attachment (
128+ pub fn with_color_attachment (
129129 mut self ,
130130 attachment_index : usize ,
131131 layout : ImageLayoutHint ,
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ pub trait RenderableComponent<E>: Component<E> {
1919 fn on_render (
2020 & mut self ,
2121 render_context : & mut super :: render:: RenderContext ,
22- last_render : & Duration ,
2322 ) -> Vec < super :: render:: command:: RenderCommand > ;
2423 fn on_renderer_detached (
2524 & mut self ,
Original file line number Diff line number Diff line change @@ -260,17 +260,19 @@ impl Runtime for GenericRuntime {
260260 current_frame = Instant :: now ( ) ;
261261 let duration = & current_frame. duration_since ( last_frame) ;
262262
263- let render_api = active_render_context. as_mut ( ) . unwrap ( ) ;
264263 // Update and render commands.
265264 for component in & mut component_stack {
266265 component. on_update ( duration) ;
267- let commands = component. on_render ( render_api, duration) ;
268- render_api. render ( commands) ;
269266 }
270267
271268 window. redraw ( ) ;
272269 }
273- WinitEvent :: RedrawRequested ( _) => { }
270+ WinitEvent :: RedrawRequested ( _) => {
271+ for component in & mut component_stack {
272+ let commands = component. on_render ( active_render_context. as_mut ( ) . unwrap ( ) ) ;
273+ active_render_context. as_mut ( ) . unwrap ( ) . render ( commands) ;
274+ }
275+ }
274276 WinitEvent :: NewEvents ( _) => { }
275277 WinitEvent :: DeviceEvent { device_id, event } => { }
276278 WinitEvent :: UserEvent ( lambda_event) => match lambda_event {
Original file line number Diff line number Diff line change @@ -136,7 +136,6 @@ impl RenderableComponent<Events> for DemoComponent {
136136 fn on_render (
137137 self : & mut DemoComponent ,
138138 _render_context : & mut lambda:: core:: render:: RenderContext ,
139- _last_render : & std:: time:: Duration ,
140139 ) -> Vec < RenderCommand > {
141140 let viewport =
142141 viewport:: ViewportBuilder :: new ( ) . build ( self . width , self . height ) ;
You can’t perform that action at this time.
0 commit comments