Creates a window that renders a stream of actions
(render_stream: RenderStream, properties: TProperties)
| 24 | /// Creates a window that renders a stream of actions |
| 25 | /// |
| 26 | pub fn create_render_window_from_stream<'a, RenderStream: 'static+Send+Stream<Item=Vec<RenderAction>>, TProperties: 'a+FloWindowProperties>(render_stream: RenderStream, properties: TProperties) -> impl Clone+Send+Stream<Item=DrawEvent> { |
| 27 | // Create the publisher to send the render actions to the stream |
| 28 | let window_properties = WindowProperties::from(&properties); |
| 29 | let mut event_publisher = Publisher::new(1000); |
| 30 | |
| 31 | let event_subscriber = event_publisher.subscribe(); |
| 32 | |
| 33 | // Create a window that subscribes to the publisher |
| 34 | let glutin_thread = glutin_thread(); |
| 35 | glutin_thread.send_event(GlutinThreadEvent::CreateRenderWindow(render_stream.boxed(), event_publisher, window_properties)); |
| 36 | |
| 37 | // Result is the events for the new window |
| 38 | event_subscriber |
| 39 | } |
no test coverage detected