]> git.localhorst.tv Git - blank.git/blobdiff - src/app/Runtime.hpp
state management and control
[blank.git] / src / app / Runtime.hpp
index 2fdf2e5b0ba2880db1af94f2da8d9560d9db52c8..036b8dbfc635ef9078454036113626b2b79266b0 100644 (file)
@@ -1,24 +1,40 @@
 #ifndef BLANK_RUNTIME_HPP_
 #define BLANK_RUNTIME_HPP_
 
-#include "Application.hpp"
+#include "../ui/Interface.hpp"
+#include "../world/World.hpp"
 
 #include <cstddef>
 
 
 namespace blank {
 
+/// Parse and interpret arguemnts, then set up the environment and execute.
 class Runtime {
 
 public:
        enum Mode {
+               /// default behaviour: run until user quits, dynamic timesteps
                NORMAL,
+               /// quit after n frames
                FRAME_LIMIT,
+               /// quit after n milliseconds
                TIME_LIMIT,
+               /// quit after n frames, use fixed timestap
                FIXED_FRAME_LIMIT,
+               /// display error message and quit with failure
                ERROR,
        };
 
+       struct Config {
+               bool vsync = true;
+               bool doublebuf = true;
+               int multisampling = 1;
+
+               Interface::Config interface = Interface::Config();
+               World::Config world = World::Config();
+       };
+
        Runtime() noexcept;
 
        void ReadArgs(int argc, const char *const *argv);
@@ -30,7 +46,7 @@ private:
        Mode mode;
        std::size_t n;
        std::size_t t;
-       Application::Config config;
+       Config config;
 
 };