@@ -21,7 +21,7 @@ New view enum in deflect/types.h:
2121The ImageWrapper takes an additional View parameter.
2222
2323API changes to the Stream class:
24- * asyncSend is deprecated but work as before, but only for mono views
24+ * asyncSend is renamed to sendAndFinish, asyncSend forwards and is deprecated
2525* send and finish are now asynchronous and return a future instead of bool
2626
2727The send operation sends one tile of one eye pass to the server. The finishFrame
@@ -31,8 +31,8 @@ finishFrame is analogous to a swap buffer call, with the extension that all
3131client's finish is synchronized by the server.
3232
3333On the server side, no changes to the Server API (except some cleanups). Each
34- Frame dispatched now contains the View information. A frame is considered
35- complete when all connected clients did send a finish.
34+ Segment dispatched now with a Frame contains the View information. A frame is
35+ considered complete when all connected clients have send a finish.
3636
3737
3838## Protocol
@@ -72,25 +72,27 @@ Example of a stereo 3D client application using the asynchronous operations:
7272 deflect::Stream stream( ... );
7373
7474 /** ...synchronize start with other render clients (network barrier)... */
75-
75+ std::vector< std::future< bool >> futures;
7676 renderLoop()
7777 {
78- if( !leftFuture.valid() || !leftFuture.get( ))
79- return;
78+ for( auto& future : futures )
79+ if( !future.get( ))
80+ return;
81+ futures.clear();
8082
8183 /** ...render left image... */
8284
8385 deflect::ImageWrapper leftImage( leftData, width, height, deflect::RGBA );
8486 leftImage.view = deflect::View::left_eye;
85- auto leftFuture = deflectStream->send( leftImage );
87+ futures.emplace_back( deflectStream->send( leftImage ) );
8688
8789 /** ...render right image... */
8890
8991 deflect::ImageWrapper rightImage( rightData, width, height, deflect::RGBA );
9092 rightImage.view = deflect::View::right_eye;
91- auto rightFuture = deflectStream->send( rightImage );
93+ futures.emplace_back( deflectStream->send( rightImage ) );
9294
93- deflectStream->finishFrame();
95+ futures.emplace_back( deflectStream->finishFrame( ) );
9496
9597 /** ...synchronize with other render clients (network barrier)... */
9698 }
0 commit comments