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 server->releaseConfig( config );
114 LBLOG( LOG_STATS ) <<
"Config init took " << clock.getTimef() <<
" ms"
118 uint32_t maxFrames = _initData.getMaxFrames();
122 while( config->
isRunning( ) && maxFrames-- )
129 const float time = clock.resetTimef();
133 LBLOG( LOG_STATS ) << time <<
" ms for " << nFrames <<
" frames @ "
134 << ( nFrames / time * 1000.f) <<
" FPS)"
149 LBVERB <<
"Unhandled " << event << std::endl;
155 const float time = clock.resetTimef();
156 const size_t nFrames = frame - lastFrame;
157 LBLOG( LOG_STATS ) << time <<
" ms for " << nFrames <<
" frames @ "
158 << ( nFrames / time * 1000.f) <<
" FPS)" << std::endl;
163 LBLOG( LOG_STATS ) <<
"Exit took " << clock.getTimef() <<
" ms" <<std::endl;
166 server->releaseConfig( config );
168 LBERROR <<
"Client::disconnectServer failed" << std::endl;
178 LBINFO <<
"Configuration run successfully executed" << std::endl;
180 while( _initData.isResident( ));
Parameters for running a configuration.
EQ_API bool isRunning() const
Proxy object for the connection to an Equalizer server.
EQ_API EventICommand getNextEvent(const uint32_t timeout=LB_TIMEOUT_INDEFINITE) const
Get the next event.
virtual EQ_API uint32_t finishFrame()
Finish the rendering of a frame.
EQ_API uint32_t getFinishedFrame() const
uint32_t getAnimationFrame()
virtual bool handleEvent(const eq::ConfigEvent *event)
virtual uint32_t startFrame()
virtual EQ_API uint32_t finishAllFrames()
Finish rendering all pending frames.
lunchbox::RefPtr< Server > ServerPtr
A reference-counted pointer to an eq::Server.
A command specialization for config events.
EQFABRIC_API void processCommand(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Get and process one pending command from the node command queue.
int run()
Run an eqPly instance.
virtual void clientLoop()
EQ_API bool disconnectServer(ServerPtr server)
Disconnect and close the connection to an Equalizer server.
EQ_API bool hasCommands()
static const std::string & getHelp()
EQ_API bool connectServer(ServerPtr server)
Open and connect an Equalizer server to the local client.
Manages the argument parsing and non-distributed part of the initialization data. ...
virtual EQ_API void clientLoop()
Implements the processing loop for render clients.
The configuration, run be the EqPly application.
virtual EQ_API void handleEvents()
Handle all config events.