Game Project
Loading...
Searching...
No Matches
ConfigManager.h
1#pragma once
2#include <iostream>
3#include <string>
4#include <json.hpp>
5#include <fstream>
6#include "../utils/Common.h"
7
8// Default window config.
10{
11 bool fullscreen = false;
12 bool vsync = false;
13 unsigned int width = 1280;
14 unsigned int height = 720;
15 unsigned int refresh_rate = 60;
16};
17
19{
20public:
27 bool Load(const std::string& config_location);
32 bool Save();
33
39private:
40 std::string config_path_; // Store the config path when loading for quick access later.
41 WindowConfig window_conf_; // Have the configs stored quickly in a variable
42};
Definition ConfigManager.h:19
bool Load(const std::string &config_location)
Loads the config file from a given path, and stores it in the structs of this class.
Definition ConfigManager.cpp:7
bool Save()
Saves the config stored in the current struct to the config location.
Definition ConfigManager.cpp:52
WindowConfig & GetWindowConfig()
Returns the saved config of the window.
Definition ConfigManager.cpp:90
Definition ConfigManager.h:10