#include #include #include int main(int argc, char* argv[]) { std::filesystem::path resourceDir = "assets"; if (!std::filesystem::is_directory(resourceDir) && std::filesystem::is_directory("../.." / resourceDir)) resourceDir = "../.." / resourceDir; Nz::Application app(argc, argv); auto& windowing = app.AddComponent(); auto& fs = app.AddComponent(); fs.Mount("game:/", resourceDir); auto& catalog = app.AddComponent(); catalog.AddFolder("game:/"); // Load an asset from its path Nz::Asset music = Nz::Asset::LoadFromFile("game:/examples/Audio/file_example_MP3_700KB.nzasset"); // or by its name music = catalog.Load("file_example_MP3_700KB"); music->Play(); Nz::Asset sound = catalog.Load("examples/Audio/siren"); sound->Play(); app.AddUpdaterFunc([&] { if (!music->IsPlaying()) app.Quit(); std::this_thread::sleep_for(std::chrono::milliseconds(100)); }); return app.Run(); }