]> git.localhorst.tv Git - blank.git/blobdiff - src/app.hpp
add chunk inspect button (C)
[blank.git] / src / app.hpp
index 9534da7ec1d6f3a0677dda703e2dfea4bb19d63d..23dcd0cef9cf7b3a21bf143f6204d5c836dc5641 100644 (file)
@@ -1,13 +1,10 @@
 #ifndef BLANK_APP_HPP_
 #define BLANK_APP_HPP_
 
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-
 #include "camera.hpp"
 #include "controller.hpp"
 #include "init.hpp"
-#include "model.hpp"
+#include "interface.hpp"
 #include "shader.hpp"
 #include "world.hpp"
 
@@ -17,18 +14,37 @@ namespace blank {
 class Application {
 
 public:
-       Application();
+       struct Config {
+               bool vsync = true;
+               bool doublebuf = true;
+               int multisampling = 1;
+
+               Interface::Config interface = Interface::Config();
+               World::Config world = World::Config();
+       };
+
+       explicit Application(const Config &);
 
        Application(const Application &) = delete;
        Application &operator =(const Application &) = delete;
 
+       /// run until user quits
        void Run();
        void Loop(int dt);
 
+       /// run for n frames
+       void RunN(size_t n);
+       /// run for t milliseconds
+       void RunT(size_t t);
+       /// run for n frames, assuming t milliseconds for each
+       void RunS(size_t n, size_t t);
+
        void HandleEvents();
        void Update(int dt);
        void Render();
 
+       static Entity &MakeTestEntity(World &);
+
 private:
        InitSDL init_sdl;
        InitIMG init_img;
@@ -38,25 +54,14 @@ private:
        InitGLEW init_glew;
        DirectionalLighting program;
 
-       float move_velocity;
-       float pitch_sensitivity;
-       float yaw_sensitivity;
-
        Camera cam;
        World world;
-       OutlineModel outline;
+       Interface interface;
 
-       bool outline_visible;
-       glm::mat4 outline_transform;
+       RandomWalk test_controller;
 
        bool running;
 
-       bool front, back, left, right, up, down;
-       bool place, remove, pick;
-
-       int remove_id;
-       int place_id;
-
 };
 
 }