PixelBullet  0.0.1
A C++ game engine
Loading...
Searching...
No Matches
Specification.hpp
1#pragma once
2
4
5#include <cstdint>
6#include <string>
7
8namespace PixelBullet
9{
15 {
19 int Count = 0;
20
24 char** Args = nullptr;
25
32 const char* operator[](int index) const
33 {
34 ASSERT(index < Count);
35 return Args[index];
36 }
37 };
38
44 {
48 uint8_t Major;
49
53 uint8_t Minor;
54
58 uint8_t Patch;
59
65 std::string ToString() const
66 {
67 return std::to_string(Major) + "." + std::to_string(Minor) + "." + std::to_string(Patch);
68 }
69
75 uint32_t ToVulkanVersion() const;
76
83 bool operator==(const ApplicationVersion& other) const
84 {
85 return Major == other.Major && Minor == other.Minor && Patch == other.Patch;
86 }
87
94 bool operator!=(const ApplicationVersion& other) const
95 {
96 return !(*this == other);
97 }
98 };
99
108 {
109 public:
113 std::string ClientName;
114
118 uint32_t Width;
119
123 uint32_t Height;
124
128 std::string AssetBasePath;
129
134
139
150 const std::string EngineName;
151
156
158 : ClientName("PixelBullet Game")
159 , Width(1600)
160 , Height(900)
161 , AssetBasePath("")
162 , ClientVersion{ 0, 0, 1 }
163 , EngineName("PixelBullet")
164 , EngineVersion{ PB_MODULE_VERSION_MAJOR, PB_MODULE_VERSION_MINOR, PB_MODULE_VERSION_PATCH }
165 {
166 }
167 };
168
169} // namespace PixelBullet
Provides assertion and panic mechanisms with optional custom formatting.
#define ASSERT(condition,...)
Asserts that a condition is true.
Definition Assert.hpp:151
Command-line arguments passed to the application.
Definition Specification.hpp:15
const char * operator[](int index) const
Accesses an argument by index.
Definition Specification.hpp:32
int Count
The number of arguments.
Definition Specification.hpp:19
char ** Args
Pointer to an array of argument strings.
Definition Specification.hpp:24
Contains configuration options for both the game and the engine.
Definition Specification.hpp:108
ApplicationCommandLineArgs CommandLineArgs
The command-line arguments.
Definition Specification.hpp:133
std::string ClientName
The name of the game or application.
Definition Specification.hpp:113
uint32_t Height
The window height.
Definition Specification.hpp:123
const ApplicationVersion EngineVersion
The version of the engine (immutable).
Definition Specification.hpp:155
std::string AssetBasePath
The assets directory path.
Definition Specification.hpp:128
ApplicationVersion ClientVersion
The version for the game or application.
Definition Specification.hpp:138
const std::string EngineName
Default constructor that initializes default values.
Definition Specification.hpp:150
uint32_t Width
The window width.
Definition Specification.hpp:118
Represents a version number.
Definition Specification.hpp:44
uint8_t Patch
Patch version number.
Definition Specification.hpp:58
std::string ToString() const
Converts the version to a string representation.
Definition Specification.hpp:65
bool operator==(const ApplicationVersion &other) const
Compares two ApplicationVersion instances for equality.
Definition Specification.hpp:83
uint32_t ToVulkanVersion() const
Returns the Vulkan-compatible version integer.
Definition Specification.cpp:7
uint8_t Minor
Minor version number.
Definition Specification.hpp:53
bool operator!=(const ApplicationVersion &other) const
Compares two ApplicationVersion instances for inequality.
Definition Specification.hpp:94
uint8_t Major
Major version number.
Definition Specification.hpp:48