vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
project.h
1#pragma once
2
3#include <cstdint>
4#include <filesystem>
5#include <string>
6#include <vector>
7
8#include "core/engine_config.h"
9#include "system/render/render_settings.h"
10
11namespace Vkm::Engine {
12
19 std::string image;
20 float seconds = 1.5f;
21};
22
26struct FontEntry {
27 std::string name;
28 std::string file;
29};
30
37struct Project {
38 std::string name;
39 std::string description;
40 std::string version;
41 std::string engineVersion;
42 std::string entryScene;
43 uint32_t tickRate = Config::DEFAULT_TICK_RATE;
44
51 uint32_t maxPlayers = 10;
52
58 uint16_t netPort = 27750;
59
61 std::vector<SplashEntry> splash;
62
64 std::vector<FontEntry> fonts;
65
73};
74
86bool loadProject(const std::filesystem::path& projectRoot, Project& out);
87
99[[nodiscard]] bool saveProject(const std::filesystem::path& projectRoot, const Project& project);
100
111bool compatibleEngine(const std::string& engineVersion);
112
122std::filesystem::path findProjectRoot(const std::filesystem::path& start);
123
124} // namespace Vkm::Engine
A font a project draws its UI text in, beside the engine's own: a UIText names it.
Definition project.h:26
std::string name
The FontAsset's name, as UIText::font names it.
Definition project.h:27
std::string file
The .ttf, relative to the project root.
Definition project.h:28
What a project.json says about the game it describes.
Definition project.h:37
RenderSettings render
What the game looks like, as the author left it.
Definition project.h:72
uint32_t tickRate
Simulation ticks per second.
Definition project.h:43
std::string entryScene
Scene to boot, relative to the project root.
Definition project.h:42
uint32_t maxPlayers
How many players this game is for.
Definition project.h:51
std::string engineVersion
Engine version this was authored against.
Definition project.h:41
std::string name
Display name; titles the window. See loadProject.
Definition project.h:38
std::string description
One line on what it is, for the editor's start screen.
Definition project.h:39
std::string version
The game's own, which its packages are named by.
Definition project.h:40
std::vector< SplashEntry > splash
Logos shown after the engine's own, in the order listed. Usually empty.
Definition project.h:61
std::vector< FontEntry > fonts
Fonts of the game's own, baked as the runtime starts and as the editor opens it. Usually empty.
Definition project.h:64
uint16_t netPort
The port this game is served on unless a run says otherwise.
Definition project.h:58
Editable render tuning: pass toggles + per-effect parameters.
Definition render_settings.h:101
One logo a project shows at startup, and how long for.
Definition project.h:18
std::string image
Image to show, relative to the project root.
Definition project.h:19
float seconds
Time held at full opacity.
Definition project.h:20