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 bool smoke_startup = false;
56 bool start_hidden = false;
57 GraphicsDeviceSelection graphics_device_selection;
58};
59
61{
62 ApplicationCommandLineArgs command_line_args;
63 std::string binary_path;
64 ApplicationLaunchOptions launch_options;
65 ApplicationUtilityCommandKind utility_command = ApplicationUtilityCommandKind::None;
66 std::string parse_error;
67
68 [[nodiscard]] bool HasParseError() const
69 {
70 return !parse_error.empty();
71 }
72};
73
81struct ApplicationSpecification
82{
83public:
87 std::string client_name;
88
92 uint32_t width;
93
97 uint32_t height;
98
103
107 WindowFrameMode window_frame_mode;
108
112 std::string asset_base_path;
113
117 std::string icon_path;
118
123
130
134 const std::string engine_name;
135
140
141 ApplicationSpecification()
142 : client_name("PixelBullet Game")
143 , width(1600)
144 , height(900)
145 , start_maximized(false)
146 , window_frame_mode(WindowFrameMode::SystemDecorated)
147 , asset_base_path("")
148 , icon_path("")
149 , client_version{ 0, 0, 1 }
150 , engine_name("PixelBullet")
151 , engine_version{ PB_MODULE_VERSION_MAJOR, PB_MODULE_VERSION_MINOR, PB_MODULE_VERSION_PATCH }
152 {
153 }
154};
155
156} // 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:61
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:112
bool start_maximized
Whether the window should start maximized.
Definition specification.h:102
const std::string engine_name
Default constructor that initializes default values.
Definition specification.h:134
WindowFrameMode window_frame_mode
How the native window frame should be presented.
Definition specification.h:107
const Version engine_version
The version of the engine (immutable).
Definition specification.h:139
uint32_t height
The window height.
Definition specification.h:97
uint32_t width
The window width.
Definition specification.h:92
std::string client_name
The name of the game or application.
Definition specification.h:87
Version client_version
The version for the game or application.
Definition specification.h:122
std::string icon_path
Optional application icon path.
Definition specification.h:117
Definition gpu_selection.h:18
Definition version.h:10