examples/eqPixelBench/configEvent.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 "configEvent.h"
00019 
00020 using namespace std;
00021 
00022 namespace eqPixelBench
00023 {
00024 std::ostream& operator << ( std::ostream& os, const ConfigEvent* event )
00025 {
00026     switch( event->data.type )
00027     {
00028         case ConfigEvent::READBACK:
00029             os  << "readback";
00030             break;
00031 
00032         case ConfigEvent::READBACK_PBO:
00033             os  << "read PBO";
00034             break;
00035 
00036         case ConfigEvent::ASSEMBLE:
00037             os  << "assemble";
00038             break;
00039 
00040         case ConfigEvent::START_LATENCY:
00041             os  << "        ";
00042             break;
00043 
00044         default:
00045             os << static_cast< const eq::ConfigEvent* >( event );
00046             return os;
00047     }
00048 
00049     os << " \"" << event->data.user.data << "\" " << event->formatType
00050        << string( 50-strlen( event->formatType ), ' ' ) << event->area << ": ";
00051 
00052     if( event->msec < 0.0f )
00053         os << "error 0x" << hex << static_cast< int >( -event->msec ) << dec;
00054     else
00055         os << static_cast< uint32_t >( event->area.x() * event->area.y() / 
00056                                        event->msec  / 1048.576f )
00057            << "MPix/sec (" << event->msec << "ms, " << 1000.0f / event->msec
00058            << "FPS)";
00059     return os;
00060 }
00061 }
Generated on Mon Aug 10 18:58:32 2009 for Equalizer 0.9 by  doxygen 1.5.8