mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 22:11:51 +00:00
Saving settings
This commit is contained in:
parent
7608300750
commit
b14ef4f923
3 changed files with 6 additions and 5 deletions
|
|
@ -41,9 +41,7 @@ using std::filesystem::path;
|
||||||
using glm::vec3;
|
using glm::vec3;
|
||||||
using gui::GUI;
|
using gui::GUI;
|
||||||
|
|
||||||
Engine::Engine(const EngineSettings& settings_) {
|
Engine::Engine(EngineSettings& settings) : settings(settings) {
|
||||||
this->settings = settings_;
|
|
||||||
|
|
||||||
Window::initialize(settings.display);
|
Window::initialize(settings.display);
|
||||||
|
|
||||||
assets = new Assets();
|
assets = new Assets();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public:
|
||||||
class Engine {
|
class Engine {
|
||||||
Assets* assets;
|
Assets* assets;
|
||||||
std::shared_ptr<Screen> screen = nullptr;
|
std::shared_ptr<Screen> screen = nullptr;
|
||||||
EngineSettings settings;
|
EngineSettings& settings;
|
||||||
|
|
||||||
uint64_t frame = 0;
|
uint64_t frame = 0;
|
||||||
double lastTime = 0.0;
|
double lastTime = 0.0;
|
||||||
|
|
@ -31,7 +31,7 @@ class Engine {
|
||||||
|
|
||||||
gui::GUI* gui;
|
gui::GUI* gui;
|
||||||
public:
|
public:
|
||||||
Engine(const EngineSettings& settings);
|
Engine(EngineSettings& settings);
|
||||||
~Engine();
|
~Engine();
|
||||||
|
|
||||||
void updateTimers();
|
void updateTimers();
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ int main() {
|
||||||
}
|
}
|
||||||
Engine engine(settings);
|
Engine engine(settings);
|
||||||
engine.mainloop();
|
engine.mainloop();
|
||||||
|
|
||||||
|
std::cout << "-- saving settings" << std::endl;
|
||||||
|
files::write_string(settings_file, wrapper.write());
|
||||||
}
|
}
|
||||||
catch (const initialize_error& err) {
|
catch (const initialize_error& err) {
|
||||||
std::cerr << "could not to initialize engine" << std::endl;
|
std::cerr << "could not to initialize engine" << std::endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue