diff --git a/examples/osgcluster/osgcluster.cpp b/examples/osgcluster/osgcluster.cpp index 3d005becf..6a0f7aa9f 100644 --- a/examples/osgcluster/osgcluster.cpp +++ b/examples/osgcluster/osgcluster.cpp @@ -88,6 +88,11 @@ class DataConverter bool _swapBytes; char* _currentPtr; + + void reset() + { + _currentPtr = _startPtr; + } inline void write1(char* ptr) { @@ -330,7 +335,11 @@ class DataConverter void read(CameraPacket& cameraPacket) { cameraPacket._byte_order = readUInt(); - if (cameraPacket._byte_order != SWAP_BYTES_COMPARE) _swapBytes = !_swapBytes; + if (cameraPacket._byte_order != SWAP_BYTES_COMPARE) + { + std::cout<<"Need to do swap bytes"<copyEventQueue(_events); osg::notify(osg::INFO)<<"written events = "<<_events.size()<readEventQueue(viewer); + scratchPad.reset(); scratchPad.write(*cp); bc.setBuffer(scratchPad._startPtr, scratchPad._numBytes); @@ -508,10 +520,13 @@ int main( int argc, char **argv ) rc.setBuffer(scratchPad._startPtr, scratchPad._numBytes); - osg::notify(osg::INFO) << "rc.sync()"<writeEventQueue(viewer);