33 #include "localInitData.h"
42 static const std::string _help(
43 std::string(
"eqPly - Equalizer polygonal rendering example\n" ) +
44 std::string(
"\tRun-time commands:\n" ) +
45 std::string(
"\t\tLeft Mouse Button: Rotate model\n" ) +
46 std::string(
"\t\tMiddle Mouse Button: Move model in X, Y\n" ) +
47 std::string(
"\t\tRight Mouse Button: Move model in Z\n" ) +
48 std::string(
"\t\t<Cursor Keys>: Move head in X,Y plane\n" )+
49 std::string(
"\t\t<Page Up,Down>: Move head in Z\n" )+
50 std::string(
"\t\t<Esc>, All Mouse Buttons: Exit program\n" ) +
51 std::string(
"\t\t<Space>: Reset camera (twice for Immersive Setup)\n" ) +
52 std::string(
"\t\tF1, h: Toggle help overlay\n" ) +
53 std::string(
"\t\to: Toggle perspective/orthographic\n"
55 std::string(
"\t\ts: Toggle statistics overlay\n" ) +
56 std::string(
"\t\tw: Toggle wireframe mode\n" ) +
57 std::string(
"\t\td: Toggle color demo mode\n" ) +
58 std::string(
"\t\ti: Toggle usage of idle anti-aliasing\n" ) +
59 std::string(
"\t\tq, Q: Adjust non-idle image quality\n" ) +
60 std::string(
"\t\tn: Toggle navigation mode (trackball, walk)\n" ) +
61 std::string(
"\t\tr: Switch rendering mode (display list, VBO, immediate)\n" ) +
62 std::string(
"\t\tu: Toggle image compression\n" ) +
63 std::string(
"\t\tc: Switch active canvas\n" ) +
64 std::string(
"\t\tv: Switch active view\n" ) +
65 std::string(
"\t\tm: Switch model for active view\n" ) +
66 std::string(
"\t\tl: Switch layout for active canvas\n" ) +
67 std::string(
"\t\ta: Add active stereo window\n" ) +
68 std::string(
"\t\tp: Add passive stereo window\n" ) +
69 std::string(
"\t\tx: Remove window\n" ) +
70 std::string(
"\t\ty, Y: Adjust model unit\n" ) +
71 std::string(
"\t\tz, Z: Adjust eye base\n" ));
80 : _initData( initData )
89 LBERROR <<
"Can't open server" << std::endl;
95 Config* config =
static_cast<Config*
>(server->chooseConfig( configParams ));
99 LBERROR <<
"No matching config on server" << std::endl;
105 lunchbox::Clock clock;
107 config->setInitData( _initData );
108 if( !config->
init( ))
110 LBWARN <<
"Error during initialization: " << config->
getError()
112 server->releaseConfig( config );
117 LBWARN <<
"Error during initialization: " << config->
getError()
120 LBLOG( LOG_STATS ) <<
"Config init took " << clock.getTimef() <<
" ms"
124 uint32_t maxFrames = _initData.getMaxFrames();
128 while( config->
isRunning( ) && maxFrames-- )
132 LBWARN <<
"Error during frame start: " << config->
getError()
138 const float time = clock.resetTimef();
142 LBLOG( LOG_STATS ) << time <<
" ms for " << nFrames <<
" frames @ "
143 << ( nFrames / time * 1000.f) <<
" FPS)"
158 LBVERB <<
"Unhandled " << event << std::endl;
164 const float time = clock.resetTimef();
165 const size_t nFrames = frame - lastFrame;
166 LBLOG( LOG_STATS ) << time <<
" ms for " << nFrames <<
" frames @ "
167 << ( nFrames / time * 1000.f) <<
" FPS)" << std::endl;
172 LBLOG( LOG_STATS ) <<
"Exit took " << clock.getTimef() <<
" ms" <<std::endl;
175 server->releaseConfig( config );
177 LBERROR <<
"Client::disconnectServer failed" << std::endl;
187 LBINFO <<
"Configuration run successfully executed" << std::endl;
189 while( _initData.isResident( ));
virtual uint32_t startFrame()
virtual uint32_t finishAllFrames()
Finish rendering all pending frames.
A command specialization for config events.
eq::fabric::Error getError() const
uint32_t getAnimationFrame()
virtual void handleEvents()
Handle all config events.
virtual void clientLoop()
bool connectServer(ServerPtr server)
Open and connect an Equalizer server to the local client.
Proxy object for the connection to an Equalizer server.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
virtual bool handleEvent(const eq::ConfigEvent *event)
virtual uint32_t finishFrame()
Finish the rendering of a frame.
virtual void clientLoop()
Implements the processing loop for render clients.
void processCommand(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Get and process one pending command from the node command queue.
EventICommand getNextEvent(const uint32_t timeout=LB_TIMEOUT_INDEFINITE) const
Get the next event.
uint32_t getFinishedFrame() const
int run()
Run an eqPly instance.
Manages the argument parsing and non-distributed part of the initialization data. ...
bool disconnectServer(ServerPtr server)
Disconnect and close the connection to an Equalizer server.
static const std::string & getHelp()
Parameters for running a configuration.
The configuration, run be the EqPly application.