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 );
99 LBWARN <<
"Error during initialization: " << config->
getError()
102 LBLOG(
LOG_STATS ) <<
"Config init took " << clock.getTimef() <<
" ms"
106 uint32_t maxFrames = _initData.getMaxFrames();
109 while( config->
isRunning( ) && maxFrames-- )
113 LBWARN <<
"Error during frame start: " << config->
getError()
118 const float time = clock.getTimef();
119 LBLOG(
LOG_STATS ) <<
"Rendering took " << time <<
" ms (" << frame
120 <<
" frames @ " << ( frame / time * 1000.f) <<
" FPS)"
126 LBLOG(
LOG_STATS ) <<
"Exit took " << clock.getTimef() <<
" ms" <<std::endl;
129 server->releaseConfig( config );
130 if( !disconnectServer( server ))
131 LBERROR <<
"Client::disconnectServer failed" << std::endl;
137 void EVolve::clientLoop()
142 LBINFO <<
"Configuration run successfully executed" << std::endl;
144 while( _initData.isResident( ));
virtual uint32_t finishAllFrames()
Finish rendering all pending frames.
eq::fabric::Error getError() const
Proxy object for the connection to an Equalizer server.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
virtual uint32_t startFrame()
virtual uint32_t finishFrame()
Finish the rendering of a frame.
virtual void clientLoop()
Implements the processing loop for render clients.
Parameters for running a configuration.