eqPly/initData.cpp

00001 /*
00002  * Copyright (c) 2006-2009, 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  * The init data manages static, per-instance application data. In this example,
00019  * it holds the model file name, and manages the instantiation of the frame
00020  * data. The frame data is instantiated seperately for each (pipe) thread, so
00021  * that multiple pipe threads on a node can render different frames
00022  * concurrently.
00023  */
00024 
00025 #include "initData.h"
00026 
00027 using namespace eq::base;
00028 using namespace std;
00029 
00030 namespace eqPly
00031 {
00032 
00033 InitData::InitData()
00034         : _frameDataID( EQ_ID_INVALID )
00035         , _windowSystem( eq::WINDOW_SYSTEM_NONE )
00036 #ifdef Darwin
00037         , _renderMode( mesh::RENDER_MODE_BUFFER_OBJECT )
00038 #else
00039         , _renderMode( mesh::RENDER_MODE_DISPLAY_LIST )
00040 #endif
00041         , _useGLSL( false )
00042         , _invFaces( false )
00043         , _logo( true )
00044 {}
00045 
00046 InitData::~InitData()
00047 {
00048     setFrameDataID( EQ_ID_INVALID );
00049 }
00050 
00051 void InitData::getInstanceData( eq::net::DataOStream& os )
00052 {
00053     os << _frameDataID << _windowSystem << _renderMode << _useGLSL << _invFaces
00054        << _logo;
00055 }
00056 
00057 void InitData::applyInstanceData( eq::net::DataIStream& is )
00058 {
00059     is >> _frameDataID >> _windowSystem >> _renderMode >> _useGLSL >> _invFaces
00060        >> _logo;
00061 
00062     EQASSERT( _frameDataID != EQ_ID_INVALID );
00063     EQINFO << "New InitData instance" << endl;
00064 }
00065 }
Generated on Mon Aug 10 18:58:39 2009 for Equalizer 0.9 by  doxygen 1.5.8