|
本帖最后由 osger 于 2013-1-21 17:37 编辑
在earth_city中增加缓存,代码如下:但没效果。- std::string cstr = "{"$children":[{"$key":"cache","path":"cache_dir","type":"filesystem"},{"$key":"cache_policy","usage":"read_write"}],"name":"Boston Demo"}";
- osgEarth::Config conf;
- conf.fromJSON(cstr); //返回true
- optional<std::string> _path("cache_dir", "cache_dir");
- conf.addIfSet( "path", _path );
- CacheOptions copt(conf);
- copt.setDriver("filesystem");
- map->setCache(cache);
复制代码 但上面的始终没效果,无论是从JSON解析,还是通过设置,请教高人,用API如何设置缓存呢 |
|