18 explicit KeyValues(
const std::string & aKey);
30 explicit Config(
const std::vector<std::string> & argv);
48 ArgumentInfo(
const std::string & aname,
const std::string & ashort,
const std::string & adetails,
49 const std::vector<std::string> & avalues);
60 const std::vector<KeyValues> &
arguments()
const;
74 void registerArgument(
const std::string & longName,
const std::string & shortName,
const std::string & details,
const std::vector<std::string> & params = {});
83 void registerArgument(
const std::string & longName,
const std::string & shortName,
const std::string & details,
const std::string & param);
Contains configurable elements as attributes, populated from the command line, a configuration file o...
Definition: Config.hpp:25
static void parseFromFile(const std::string &filePath, std::vector< KeyValues > &arguments)
Definition: Config.cpp:79
const std::vector< KeyValues > & arguments() const
Definition: Config.cpp:63
bool _showHelp
Should the help be displayed.
Definition: Config.hpp:106
bool showHelp()
Definition: Config.cpp:148
static void parseFromArgs(const std::vector< std::string > &argv, std::vector< KeyValues > &arguments)
Definition: Config.cpp:124
void registerSection(const std::string &name)
Definition: Config.cpp:67
std::vector< ArgumentInfo > _infos
Store informations about each argument, for displaying the help message.
Definition: Config.hpp:104
void registerArgument(const std::string &longName, const std::string &shortName, const std::string &details, const std::vector< std::string > ¶ms={})
Definition: Config.cpp:71
std::vector< KeyValues > _rawArguments
Store the internal parsed (keys, [values]) extracted from a file or the command-line.
Definition: Config.hpp:101
Configuration containing parameters for windows and renderers.
Definition: Config.hpp:113
const size_t version
The configuration version number (unused).
Definition: Config.hpp:126
std::string resourcesPath
Extra resources directory.
Definition: Config.hpp:157
int rate
Prefered framerate.
Definition: Config.hpp:132
bool trackDebug
Should resource tracking and monitoring be enabled.
Definition: Config.hpp:160
glm::vec2 renderingResolution()
Definition: Config.cpp:233
bool vsync
Toggle V-Sync.
Definition: Config.hpp:129
glm::vec2 screenResolution
Size of the window in raw pixels, updated at launch based on screen density.
Definition: Config.hpp:151
int internalVerticalResolution
Internal vertical rendering resolution.
Definition: Config.hpp:145
unsigned int initialWidth
Initial width of the window in relative pixels.
Definition: Config.hpp:138
bool forceAspectRatio
Should the aspect ratio of the window be constrained.
Definition: Config.hpp:148
unsigned int initialHeight
Initial height of the window in relative pixels.
Definition: Config.hpp:141
bool fullscreen
Toggle fullscreen window.
Definition: Config.hpp:135
glm::ivec4 windowFrame
The last recorded window position and size on screen.
Definition: Config.hpp:154
Informations about an argument.
Definition: Config.hpp:40
std::string nameShort
The short argument name.
Definition: Config.hpp:52
std::string nameLong
The main argument name.
Definition: Config.hpp:51
std::string details
Argument description.
Definition: Config.hpp:53
std::vector< std::string > values
Zero, one or multiple argument parameters.
Definition: Config.hpp:54
Represent a key-values tuple.
Definition: Config.hpp:9
std::vector< std::string > values
A vector of values.
Definition: Config.hpp:12
std::string key
The key.
Definition: Config.hpp:11
std::vector< KeyValues > elements
A vector of child elements.
Definition: Config.hpp:13