X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FRuntime.hpp;h=ee438537a345ef43e0f884f24ca799588b15ba4a;hb=dbfcb12348b80e2582f710acb1e4ed0011889ba2;hp=ee0b4a023737ef1f4d6fea40d7723ab621e10667;hpb=6f94235a5b7c140852703e60c8a74760b8b61d99;p=blank.git diff --git a/src/app/Runtime.hpp b/src/app/Runtime.hpp index ee0b4a0..ee43853 100644 --- a/src/app/Runtime.hpp +++ b/src/app/Runtime.hpp @@ -1,13 +1,19 @@ #ifndef BLANK_RUNTIME_HPP_ #define BLANK_RUNTIME_HPP_ -#include "Application.hpp" +#include "../net/Client.hpp" +#include "../net/Server.hpp" +#include "../ui/Interface.hpp" +#include "../world/World.hpp" #include +#include namespace blank { +class HeadlessApplication; + /// Parse and interpret arguemnts, then set up the environment and execute. class Runtime { @@ -25,18 +31,47 @@ public: ERROR, }; + enum Target { + STANDALONE, + SERVER, + CLIENT, + }; + + struct Config { + bool vsync = true; + bool doublebuf = true; + int multisampling = 1; + + std::string asset_path; + std::string save_path; + std::string world_name = "default"; + + Client::Config client = Client::Config(); + Interface::Config interface = Interface::Config(); + Server::Config server = Server::Config(); + World::Config world = World::Config(); + }; + Runtime() noexcept; void ReadArgs(int argc, const char *const *argv); int Execute(); +private: + void RunStandalone(); + void RunServer(); + void RunClient(); + + void Run(HeadlessApplication &); + private: const char *name; Mode mode; + Target target; std::size_t n; std::size_t t; - Application::Config config; + Config config; };