Sorry Michael, I suggested the code off the top of my head without
double checking the constructors to ReaderWriter::Options, it doesn't
take CacheHintOptions enum on the constructor, so you'll need to
construct the options object then set the cache ObjectCacheHint via:
osgDB::ReaderWriter::Options* options = new osgDB::ReaderWriter::Options();
options->setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL);
osgDB::Registry::instance()->setOptions(options);
On 5/19/07, Michael Bosse' <[EMAIL PROTECTED]> wrote:
When I use the following code in my project, I get a variety of errors. Let
me say that I am using Microsoft Visual Studio .net 2003 stock; on the last
stable release of OSG and no customizations to the OSG sources.
osgDB::Registry::instance()->setOptions(new
osgDB::ReaderWriter::Options(osgDB::ReaderWriter::Options::CACHE_ALL));
Errors range from:
error C2664: 'osgDB::ReaderWriter::Options::Options(const
std::string &)' : cannot convert parameter 1 from
'osgDB::ReaderWriter::Options::CacheHintOptions' to 'const
std::string &'
Reason: cannot convert from
'osgDB::ReaderWriter::Options::CacheHintOptions' to 'const
std::string'
For the above exact code, which stems from ambiguous overloading of the
options constructor. When I clear the ambiguous call, with
osgDB::Registry::instance()->setOptions(new
osgDB::ReaderWriter::Options(osgDB::ReaderWriter::Options::CACHE_ALL,
osg::CopyOp::SHALLOW_COPY));
I get the following error message. I have tried several different ways
around this issue and each seems to cause more errors as I go along.
error C2664: 'osgDB::ReaderWriter::Options::Options(const
osgDB::ReaderWriter::Options &,const osg::CopyOp)' : cannot convert
parameter 1 from
'osgDB::ReaderWriter::Options::CacheHintOptions' to 'const
osgDB::ReaderWriter::Options &'
Reason: cannot convert from
'osgDB::ReaderWriter::Options::CacheHintOptions' to 'const
osgDB::ReaderWriter::Options'
No constructor could take the source type, or constructor overload
resolution was ambiguous
Sorry for the newbie questions here.
On 5/19/07, Robert Osfield <[EMAIL PROTECTED]> wrote:
> Hi Michel,
>
> osgDB::Registry::instance()->
> setOptions(new
ReaderWriter::Options(ReaderWriter::Options::CACHE_ALL));
>
> or
>
> pass the Options on each readNodeFile call.
>
> On 5/19/07, Bosse, Michael A @ Link < [EMAIL PROTECTED]> wrote:
> >
> >
> > I am trying to get osgDB::readObjectFile("filename") to
> > cache the models as they are loaded instead of reloading from file each
> > time. I am unfamiliar with the syntax that the other overload of this
> > function requires. Could someone point me to an example that can help me
> > understand this? Thanks a lot.
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> > http://openscenegraph.net/mailman/listinfo/osg-users
> > http://www.openscenegraph.org/
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
--
"It is only necessary to make war with five things: with the maladies of the
body, with the ignorances of the mind, with the passions of the body, with
the seditions of the city, with the discords of families." - Tacitus
"The desire for safety stands against every great and noble enterprise." -
Tacitus
"Those who would give up essential liberty to purchase a little temporary
safety deserve neither liberty nor safety." - Benjamin Franklin
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/