#include #include #include #include static bool checkImages( const osg::Texture2DArray& tex ) { return tex.getNumImages()>0; } static bool readImages( osgDB::InputStream& is, osg::Texture2DArray& tex ) { unsigned int size = 0; is >> size >> is.BEGIN_BRACKET; for ( unsigned int i=0; i image = is.readImage(); if ( image ) tex.setImage( i, image ); } is >> is.END_BRACKET; return true; } static bool writeImages( osgDB::OutputStream& os, const osg::Texture2DArray& tex ) { unsigned int size = tex.getNumImages(); os << size << os.BEGIN_BRACKET << std::endl; for ( unsigned int i=0; i