32 #include "localInitData.h"
39 static const std::string _help(
40 std::string(
"eVolve - Equalizer volume rendering example\n" ) +
41 std::string(
"\tRun-time commands:\n" ) +
42 std::string(
"\t\tLeft Mouse Button: Rotate model\n" ) +
43 std::string(
"\t\tMiddle Mouse Button: Move model in X, Y\n" ) +
44 std::string(
"\t\tRight Mouse Button: Move model in Z\n" ) +
45 std::string(
"\t\t<Esc>, All Mouse Buttons: Exit program\n" ) +
46 std::string(
"\t\t<Space>, r: Reset camera\n" ) +
47 std::string(
"\t\td: Toggle demo color mode\n" ) +
48 std::string(
"\t\tb: Toggle background color\n" ) +
49 std::string(
"\t\tn: Toggle normals Quality mode (raw data only)\n" ) +
50 std::string(
"\t\to: Toggle " ) +
51 std::string(
"perspective/orthographic\n" ) +
52 std::string(
"\t\ts: Toggle statistics " ) +
53 std::string(
"overlay\n" ) +
54 std::string(
"\t\tl: Switch layout for active canvas\n")+
55 std::string(
"\t\tF1, h: Toggle help overlay\n" )
58 const std::string& EVolve::getHelp()
63 EVolve::EVolve(
const LocalInitData& initData )
64 : _initData( initData )
71 if( !connectServer( server ))
73 LBERROR <<
"Can't open server" << std::endl;
79 Config* config =
static_cast<Config*
>(server->chooseConfig( configParams ));
83 LBERROR <<
"No matching config on server" << std::endl;
84 disconnectServer( server );
89 lunchbox::Clock clock;
91 config->setInitData( _initData );
94 server->releaseConfig( config );
95 disconnectServer( server );
98 LBLOG(
LOG_STATS ) <<
"Config init took " << clock.getTimef() <<
" ms"
102 uint32_t maxFrames = _initData.getMaxFrames();
105 while( config->
isRunning( ) && maxFrames-- )
111 const float time = clock.getTimef();
112 LBLOG(
LOG_STATS ) <<
"Rendering took " << time <<
" ms (" << frame
113 <<
" frames @ " << ( frame / time * 1000.f) <<
" FPS)"
119 LBLOG(
LOG_STATS ) <<
"Exit took " << clock.getTimef() <<
" ms" <<std::endl;
122 server->releaseConfig( config );
123 if( !disconnectServer( server ))
124 LBERROR <<
"Client::disconnectServer failed" << std::endl;
130 void EVolve::clientLoop()
135 LBINFO <<
"Configuration run successfully executed" << std::endl;
137 while( _initData.isResident( ));
Parameters for running a configuration.
EQ_API bool isRunning() const
Proxy object for the connection to an Equalizer server.
virtual EQ_API uint32_t finishFrame()
Finish the rendering of a frame.
virtual EQ_API uint32_t finishAllFrames()
Finish rendering all pending frames.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
virtual uint32_t startFrame()
virtual EQ_API void clientLoop()
Implements the processing loop for render clients.