本文整理汇总了C++中FilePath::filepath方法的典型用法代码示例。如果您正苦于以下问题:C++ FilePath::filepath方法的具体用法?C++ FilePath::filepath怎么用?C++ FilePath::filepath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FilePath
的用法示例。
在下文中一共展示了FilePath::filepath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find
std::string ResourceManager::find(std::string filename) {
FilePath fp = paths.find(filename);
std::string result = fp.filepath();
if (result == "") {
AL_WARN("al::ResourceManager: could not find: %s", filename.c_str());
return "";
} else {
return result;
}
}
示例2: main
int main (int argc, char * const argv[]) {
searchpaths.addAppPaths(argc, argv);
searchpaths.addSearchPath(searchpaths.appPath() + "../../share");
searchpaths.print();
// load in a "scene"
FilePath path = searchpaths.find("ducky.obj");
printf("reading %s\n", path.filepath().c_str());
ascene = Scene::import(path.filepath());
if (ascene==0) {
printf("error reading %s\n", path.filepath().c_str());
return -1;
} else {
ascene->getBounds(scene_min,scene_max);
scene_center = (scene_min + scene_max) / 2.f;
ascene->dump();
}
File frag_file(searchpaths.find("basicFragment.glsl"), "r", true);
File vert_file(searchpaths.find("basicVertex.glsl"), "r", true);
printf("frag_file %s\n", frag_file.path().c_str());
printf("vert_file %s\n", vert_file.path().c_str());
frag.source(frag_file.readAll(), Shader::FRAGMENT);
vert.source(vert_file.readAll(), Shader::VERTEX);
win1.add(new StandardWindowKeyControls);
win1.create(Window::Dim(640, 480));
Image img(searchpaths.find("hubble.jpg").filepath());
tex.allocate(img.array());
MainLoop::start();
return 0;
}
示例3: MyApp
MyApp() {
// search for the font in the root directory
// in this case, our font lives here: allocore/share/fonts/
SearchPaths searchPaths;
searchPaths.addSearchPath(".");
FilePath filePath = searchPaths.find("VeraMoIt.ttf");
if (!filePath.valid()) {
cerr << "Font file not found! Exiting..." << endl;
exit(1);
}
font = new Font(filePath.filepath(), 20);
mesh.primitive(Graphics::TRIANGLES);
addSphere(mesh, 1.0, 32, 32);
}
示例4: Impl
File::File(const FilePath& path, const std::string& mode, bool open_)
: mImpl(new Impl()),
mPath(path.filepath()), mMode(mode), mContent(0), mSizeBytes(0), mFP(0)
{ if(open_) open(); }
示例5: watch
void watch(FilePath f, bool immediate=true) { watch(f.filepath(), immediate); }