hi Serge,

thanks for your hints.

>Have you looked to osgDB::Registry::setReadFileCallback ?

unfortunately, osgDB::Registry::setReadFileCallback does not the job. it passes 
the file name down to the loading mechanism chain, i.e. the actual file access 
is still managed in individual plugins using istream.

>This way you can even pass to the OSG plugin a custom std::stream which can 
>read into your pack system.

well, i fear this won't work as well, as plugins expect a file name, no stream 
object.

i have to admit, the mentioned feature would have an impact on exsiting 
plugins, as they would need an extention for using a forein stream object, if 
it exists, which is set by a callback, instead of creating an own stream out of 
a given file name.


cheers
boto

>Hi Boto,

>Have you looked to osgDB::Registry::setReadFileCallback ? Another way to
>achieve what you want can be to make a plugin for your packed file and use
>encoded strings as files names to know wich file to get from your pack, ie :
>cow.osg|mypack.pack
>With such a file name, your plugin will know that it needs the pack
>"mypack.pack", and that it needs to load the cow.osg file from it. This way
>you can even pass to the OSG plugin a custom std::stream which can read into
>your pack system.
>
>Hopes this helps !
>Cheers,

>On Mon, Aug 11, 2008 at 3:20 PM, Botorabi <[EMAIL PROTECTED]> wrote:

> i am searching for a way which allows having all necessary data files
> packed into a single file -- such as pak files of typical games -- and let
> osg read the image and scene files from that pack file. there is physfs
> which can provide a virtual files system given it a compressed archive file,
> e.g. a zip file.
>
> however, i could not see a central place in osgDB for placing an
> appropriate hook, in order to avoid plugins taking a file name and using std
> streams on their own for accessing the files.
>
> it would be great to set a sort of callback object for accessing the
> content of files and osg would take from that callback object either a data
> buffer for processing or a std stream.
>
> what do you think about this idea?
>
>
> cheers
> boto
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to