MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / create_render_window_from_stream

Function create_render_window_from_stream

draw/src/render_window.rs:26–39  ·  view source on GitHub ↗

Creates a window that renders a stream of actions

(render_stream: RenderStream, properties: TProperties)

Source from the content-addressed store, hash-verified

24/// Creates a window that renders a stream of actions
25///
26pub 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}

Callers 1

create_render_windowFunction · 0.85

Calls 2

glutin_threadFunction · 0.85
send_eventMethod · 0.80

Tested by

no test coverage detected