Skip to content

[cpp,c++] std::filesystem and nirtcpp/(irrlicht) file system

Nirtcpp forks from irrlicht.

#include <utxcpp/core.hpp>
#include <nirtcpp.hpp>
#include <filesystem>

namespace fs = std::filesystem;

int main(int argc, char * argv[])
    if (argc != 2)
        throw std::runtime_error{"prog <search path>"};
    const fs::path search = argv[1];

    nirt::NirtcppDevice * device = nirt::createDevice(
        nirt::video::EDT_NULL, nirt::core::dimension2du{2560, 1600},
        32, false, true, true, nullptr);
    utx::rt_assert(device != nullptr);
    nirt::io::IFileSystem * nfs = device->getFileSystem();
    for (const auto & entry: fs::recursive_directory_iterator{search})
        const fs::file_status & status = entry.status();
        if (
            && entry.is_regular_file()
            && entry.path().extension() == ".pk3"
            if (nfs->addFileArchive(entry.path().string().data()))
                utx::print(entry, "added");
    nirt::scene::ISceneManager * smgr = device->getSceneManager();

    nirt::scene::IAnimatedMesh * map_mesh = smgr->getMesh("q3dm6ish.bsp");
catch (std::exception & e)
    utx::printe("[std::exception]", e.what());
    return 1;


No Trackbacks


Display comments as Linear | Threaded

No comments

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.

Form options

Submitted comments will be subject to moderation before being displayed.