9#include <ImReflect.hpp>
10#include <nlohmann/json.hpp>
17enum class WindowType { Windowed = 0, Borderless = 1, ExclusiveFullscreen = 2 };
20enum class DistributionCompressionLevel { VeryLow = 0, Low = 1, Medium = 2, High = 3, VeryHigh = 4, Extreme = 5 };
25inline void to_json(nlohmann::json& j,
const DistributionCompressionLevel& level) {
26 j =
static_cast<int>(level);
29inline void from_json(
const nlohmann::json& j, DistributionCompressionLevel& level) {
34 level =
static_cast<DistributionCompressionLevel
>(value);
47 j = std::to_string(v.major) +
"." + std::to_string(v.minor) +
"." + std::to_string(v.patch);
52 if (j.is_string()) s = j.get<std::string>();
53 else if (j.is_number()) s = std::to_string(j.get<
int>());
55 v.major = 0; v.minor = 0; v.patch = 0;
56 if (s.empty())
return;
58 std::stringstream ss(s);
60 int parts[3] = {0, 0, 0};
63 while (std::getline(ss, token,
'.') && i < 3) {
64 try { parts[i] = std::stoi(token); }
65 catch (...) { parts[i] = 0; }
66 if (parts[i] < 0) parts[i] = 0;
69 v.major = parts[0]; v.minor = parts[1]; v.patch = parts[2];
74 std::string project_name =
"NewVexProject";
75 std::string main_scene =
"Assets/scenes/main.json";
76 std::string icon_path =
"";
79 WindowType window_type = WindowType::Windowed;
82 DistributionCompressionLevel distribution_compression = DistributionCompressionLevel::High;
87IMGUI_REFLECT(
ProjectProperties, project_name, main_scene, icon_path, version, window_type, resolution_mode, vsync, distribution_compression);
88NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT(
ProjectProperties, project_name, main_scene, icon_path, version, window_type, resolution_mode, vsync, distribution_compression);
This file defines ResolutionManager class and ResolutionMode struct.
ResolutionMode
Enumeration representing different resolution modes.
@ NATIVE
Use window resolution.
Structure to hold all configurable project settings and properties.