PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
specification.h
1#pragma once
2
4#include "pixelbullet/core/version.h"
5#include "pixelbullet/graphics/gpu_selection.h"
6#include "pixelbullet/window/window_chrome.h"
7
8#include <cstdint>
9#include <filesystem>
10#include <string>
11
12namespace pixelbullet
13{
19{
23 int count = 0;
24
28 char** args = nullptr;
29
36 const char* operator[](int index) const
37 {
38 ASSERT(index < count);
39 return args[index];
40 }
41};
42
43enum class ApplicationUtilityCommandKind
44{
45 None,
46 Help,
47 ListGpus,
48 SaveGpuDefault,
49 ClearGpuDefault
50};
51
53{
54 std::filesystem::path log_directory_override;
55 std::filesystem::path asset_base_path_override;
56 bool smoke_startup = false;
57 bool start_hidden = false;
58 uint32_t smoke_startup_timeout_seconds = 5;
59 GraphicsDeviceSelection graphics_device_selection;
60};
61
63{
64 ApplicationCommandLineArgs command_line_args;
65 std::string binary_path;
66 ApplicationLaunchOptions launch_options;
67 ApplicationUtilityCommandKind utility_command = ApplicationUtilityCommandKind::None;
68 std::string parse_error;
69
70 [[nodiscard]] bool HasParseError() const
71 {
72 return !parse_error.empty();
73 }
74};
75
83struct ApplicationSpecification
84{
85public:
89 std::string client_name;
90
94 uint32_t width;
95
99 uint32_t height;
100
105
109 WindowFrameMode window_frame_mode;
110
114 std::string asset_base_path;
115
119 std::string icon_path;
120
125
132
136 const std::string engine_name;
137
142
143 ApplicationSpecification()
144 : client_name("PixelBullet Game")
145 , width(1600)
146 , height(900)
147 , start_maximized(false)
148 , window_frame_mode(WindowFrameMode::SystemDecorated)
149 , asset_base_path("")
150 , icon_path("")
151 , client_version{ 0, 0, 1 }
152 , engine_name("PixelBullet")
153 , engine_version{ PB_MODULE_VERSION_MAJOR, PB_MODULE_VERSION_MINOR, PB_MODULE_VERSION_PATCH }
154 {
155 }
156};
157
158} // namespace pixelbullet
Provides assertion and panic mechanisms with optional custom formatting.
#define ASSERT(condition,...)
Asserts that a condition is true.
Definition assert.h:142
Definition specification.h:63
Command-line arguments passed to the application.
Definition specification.h:19
char ** args
Pointer to an array of argument strings.
Definition specification.h:28
int count
The number of arguments.
Definition specification.h:23
const char * operator[](int index) const
Accesses an argument by index.
Definition specification.h:36
Definition specification.h:53
std::string asset_base_path
The assets directory path.
Definition specification.h:114
bool start_maximized
Whether the window should start maximized.
Definition specification.h:104
const std::string engine_name
Default constructor that initializes default values.
Definition specification.h:136
WindowFrameMode window_frame_mode
How the native window frame should be presented.
Definition specification.h:109
const Version engine_version
The version of the engine (immutable).
Definition specification.h:141
uint32_t height
The window height.
Definition specification.h:99
uint32_t width
The window width.
Definition specification.h:94
std::string client_name
The name of the game or application.
Definition specification.h:89
Version client_version
The version for the game or application.
Definition specification.h:124
std::string icon_path
Optional application icon path.
Definition specification.h:119
Definition gpu_selection.h:18
Definition version.h:10