Re: [osg-users] osgDB loader question
Hi Sean, As Wang Rui pointed out the osgDB::ReaderWriter's have a readNode/writeNode(std::istream,Options*) interface that a number of plugins support. The easiest way to use it in the case of a byte buffer is to create a std::stringstream, populate this than pass it in. Have a look at the src/osgPlugin/curl for an example of this in action. Robert. On Tue, Nov 4, 2008 at 10:28 PM, Sean Spicer [EMAIL PROTECTED] wrote: Is there a way to load files from a byte-buffer? I'd like to be able to store certain shape-files as resources and load them with something similar to: osgDB::readNodeFile(shapeFile) something like: osgDb::readFromByteBuffer(char *buffer, size_t size); I can't find anything like this in the API, does it exist? cheers, sean ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgDB loader question
Is there a way to load files from a byte-buffer? I'd like to be able to store certain shape-files as resources and load them with something similar to: osgDB::readNodeFile(shapeFile) something like: osgDb::readFromByteBuffer(char *buffer, size_t size); I can't find anything like this in the API, does it exist? cheers, sean ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgDB loader question
Hi Sean, Try this: osgDB::ReaderWriter::readNode(std::istream, const Options* =NULL) You should obtain the ReaderWriter plugin first: osgDB::Registry::instance()-getReaderWriterForExtension( osgDB::getLowerCaseFileExtension(filename) ); It supports .osg files. Wang Rui 2008/11/5 Sean Spicer [EMAIL PROTECTED] Is there a way to load files from a byte-buffer? I'd like to be able to store certain shape-files as resources and load them with something similar to: osgDB::readNodeFile(shapeFile) something like: osgDb::readFromByteBuffer(char *buffer, size_t size); I can't find anything like this in the API, does it exist? cheers, sean ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org