00001 00002 /* 00003 * Copyright (c) 2006-2009, Stefan Eilemann <eile@equalizergraphics.com> 00004 * 00005 * This library is free software; you can redistribute it and/or modify it under 00006 * the terms of the GNU Lesser General Public License version 2.1 as published 00007 * by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, but WITHOUT 00010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00012 * details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public License 00015 * along with this library; if not, write to the Free Software Foundation, Inc., 00016 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00017 00018 */ 00019 00020 #include "pipe.h" 00021 00022 #include "config.h" 00023 #include <eq/eq.h> 00024 00025 using namespace eq::base; 00026 using namespace std; 00027 00028 namespace eqPly 00029 { 00030 eq::WindowSystem Pipe::selectWindowSystem() const 00031 { 00032 const Config* config = static_cast<const Config*>( getConfig( )); 00033 const InitData& initData = config->getInitData(); 00034 const eq::WindowSystem ws = initData.getWindowSystem(); 00035 00036 if( ws == eq::WINDOW_SYSTEM_NONE ) 00037 return eq::Pipe::selectWindowSystem(); 00038 if( !supportsWindowSystem( ws )) 00039 { 00040 EQWARN << "Window system " << ws 00041 << " not supported, using default window system" << endl; 00042 return eq::Pipe::selectWindowSystem(); 00043 } 00044 00045 return ws; 00046 } 00047 00048 bool Pipe::configInit( const uint32_t initID ) 00049 { 00050 if( !eq::Pipe::configInit( initID )) 00051 return false; 00052 00053 Config* config = static_cast<Config*>( getConfig( )); 00054 const InitData& initData = config->getInitData(); 00055 const uint32_t frameDataID = initData.getFrameDataID(); 00056 00057 const bool mapped = config->mapObject( &_frameData, frameDataID ); 00058 EQASSERT( mapped ); 00059 return mapped; 00060 } 00061 00062 bool Pipe::configExit() 00063 { 00064 eq::Config* config = getConfig(); 00065 config->unmapObject( &_frameData ); 00066 00067 return eq::Pipe::configExit(); 00068 } 00069 00070 void Pipe::frameStart( const uint32_t frameID, const uint32_t frameNumber ) 00071 { 00072 eq::Pipe::frameStart( frameID, frameNumber ); 00073 _frameData.sync( frameID ); 00074 } 00075 }
0.9 by
1.5.8