diff --git a/src/state.h b/src/state.h new file mode 100644 index 0000000..653e225 --- /dev/null +++ b/src/state.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include +#include +#include "project.h" + +struct Config { + static Config from_file(std::string path) { + auto manifest = cpptoml::parse_file(path); + return Config::from_toml(manifest); + } + static Config from_toml(std::shared_ptr manifest) { + auto config = Config(); + config.stylepath = manifest->get_as("style").value_or(""); + + return config; + } + + std::string stylepath; +}; + +struct DemoState { + DemoState(std::shared_ptr config) + : running(true), current_project(nullptr), + config(config) {} + + int width, height; float ratio; + + std::shared_ptr current_project; + std::shared_ptr config; + + bool running; +}; \ No newline at end of file