vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
project_paths.h
1#pragma once
2
3#include <filesystem>
4#include <string>
5
6namespace Vkm::Engine {
7
18namespace ProjectPaths {
19
28std::filesystem::path engineRoot();
29
38void setProjectRoot(const std::filesystem::path& path);
39
48std::filesystem::path projectRoot();
49
59std::filesystem::path userRoot();
60
69std::filesystem::path userLogs();
70
80std::filesystem::path resolveProjectPath(const std::string& path);
81
92std::string toProjectRelative(const std::string& path);
93
94// Engine-owned, read-only to a game.
95inline std::filesystem::path engineShaders() { return engineRoot() / "shaders"; }
96inline std::filesystem::path engineAssets() { return engineRoot() / "assets"; }
97inline std::filesystem::path engineFonts() { return engineAssets() / "fonts"; }
98
104inline std::filesystem::path projectBin() { return projectRoot() / "bin"; }
105
106// Project-owned: the game's own content.
107inline std::filesystem::path assets() { return projectRoot() / "assets"; }
108inline std::filesystem::path scenes() { return projectRoot() / "scenes"; }
109inline std::filesystem::path prefabs() { return projectRoot() / "prefabs"; }
110inline std::filesystem::path screenshots() { return projectRoot() / "screenshots"; }
111inline std::filesystem::path envs() { return assets() / "envs"; }
112
113// `library` holds the per-asset recipes (source of truth, version-controlled);
114// `cooked` holds what the cook derives (AssetCook::cacheKey binaries plus manifest).
115inline std::filesystem::path library() { return projectRoot() / "library"; }
116inline std::filesystem::path cooked() { return projectRoot() / "cooked"; }
117inline std::filesystem::path assetManifest() { return cooked() / "_manifest.json"; }
118
119} // namespace ProjectPaths
120
121} // namespace Vkm::Engine
Canonical on-disk locations, split by who owns them.
Definition project_paths.h:18
std::filesystem::path resolveProjectPath(const std::string &path)
Turn a stored reference into a path that can be opened.
std::filesystem::path engineRoot()
Directory holding the engine's own read-only data.
std::filesystem::path userLogs()
Directory a host writes its log to when the project cannot hold one.
void setProjectRoot(const std::filesystem::path &path)
Point the project root at path.
std::filesystem::path projectRoot()
Directory holding the project currently open.
std::filesystem::path userRoot()
Directory this user's own settings live in.
std::filesystem::path projectBin()
Directory the project keeps its built gameplay module in.
Definition project_paths.h:104
std::string toProjectRelative(const std::string &path)
The form of a path an asset should be named and recorded by.