examples/eqPixelBench/config.cpp

00001 
00002 /* Copyright (c) 2007-2008, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #include "config.h"
00019 #include "configEvent.h"
00020 
00021 using namespace std;
00022 
00023 namespace eqPixelBench
00024 {
00025 Config::Config( eq::base::RefPtr< eq::Server > parent )
00026         : eq::Config( parent )
00027         , _clock(0)
00028 {
00029 }
00030 
00031 Config::~Config()
00032 {
00033     delete _clock;
00034     _clock = 0;
00035 }
00036 
00037 uint32_t Config::startFrame( const uint32_t frameID )
00038 {
00039     if( !_clock )
00040         _clock = new eq::base::Clock;
00041 
00042     _clock->reset();
00043     return eq::Config::startFrame( frameID );
00044 }
00045 
00046 bool Config::handleEvent( const eq::ConfigEvent* event )
00047 {
00048     switch( event->data.type )
00049     {
00050         case ConfigEvent::READBACK:
00051         case ConfigEvent::READBACK_PBO:
00052         case ConfigEvent::ASSEMBLE:
00053         case ConfigEvent::START_LATENCY:
00054             cout << static_cast< const ConfigEvent* >( event ) << endl;
00055             return true;
00056 
00057         default:
00058             return eq::Config::handleEvent( event );
00059     }
00060 }
00061 }
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8