aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Config.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Config.h')
-rw-r--r--src/crepe/api/Config.h63
1 files changed, 42 insertions, 21 deletions
diff --git a/src/crepe/api/Config.h b/src/crepe/api/Config.h
index 0c9d116..ab8bb59 100644
--- a/src/crepe/api/Config.h
+++ b/src/crepe/api/Config.h
@@ -1,5 +1,8 @@
#pragma once
+#include <string>
+
+#include "../types.h"
#include "../util/Log.h"
namespace crepe {
@@ -7,26 +10,14 @@ namespace crepe {
/**
* \brief Global configuration interface
*
- * This class stores engine default settings. Properties on this class are only supposed to be
- * modified *before* execution is handed over from the game programmer to the engine (i.e. the
- * main loop is started).
+ * This struct stores both engine default settings and global configuration parameters.
*/
-class Config final {
-public:
+struct Config final {
//! Retrieve handle to global Config instance
static Config & get_instance();
-private:
- Config() = default;
- ~Config() = default;
- Config(const Config &) = default;
- Config(Config &&) = default;
- Config & operator=(const Config &) = default;
- Config & operator=(Config &&) = default;
-
-public:
//! Logging-related settings
- struct {
+ struct log { // NOLINT
/**
* \brief Log level
*
@@ -34,7 +25,7 @@ public:
*/
Log::Level level = Log::Level::INFO;
/**
- * \brief Colored log output
+ * \brief Enable colored log output
*
* Enables log coloring using ANSI escape codes.
*/
@@ -42,7 +33,7 @@ public:
} log;
//! Save manager
- struct {
+ struct savemgr { // NOLINT
/**
* \brief Save file location
*
@@ -52,18 +43,26 @@ public:
std::string location = "save.crepe.db";
} savemgr;
- //! physics-related settings
- struct {
+ //! Physics-related settings
+ struct physics { // NOLINT
/**
* \brief gravity value of physics system
*
* Gravity value of game.
*/
- double gravity = 1;
+ float gravity = 10;
} physics;
+ //! Default window settings
+ struct window_settings { // NOLINT
+ //! Default window size (in pixels)
+ ivec2 default_size = {1280, 720};
+ //! Default window title
+ std::string window_title = "crepe window";
+ } window_settings;
+
//! Asset loading options
- struct {
+ struct asset { // NOLINT
/**
* \brief Pattern to match for Asset base directory
*
@@ -75,6 +74,28 @@ public:
*/
std::string root_pattern = ".crepe-root";
} asset;
+ //! Default font options
+ struct {
+ /**
+ * \brief Default font size
+ *
+ * Using the SDL_ttf library the font size needs to be set when loading the font.
+ * This config option is the font size at which all fonts will be loaded initially.
+ *
+ */
+ unsigned int size = 100;
+ } font;
+ //! Configuration for click tolerance.
+ struct {
+ //! The maximum number of pixels the mouse can move between MouseDown and MouseUp events to be considered a click.
+ int click_tolerance = 5;
+ } input;
+
+ //! Audio system settings
+ struct {
+ //! Max amount of simultanious voices
+ unsigned int voices = 32;
+ } audio;
};
} // namespace crepe