X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp.hpp;h=23dcd0cef9cf7b3a21bf143f6204d5c836dc5641;hb=e52e3c500b679ab7bae9cfdda3fb0d630a2584ad;hp=0443942108906b14e59dcaf87b10ff17fae1a376;hpb=753be639d7d04f9f7415db9fc2721485c531f0a1;p=blank.git diff --git a/src/app.hpp b/src/app.hpp index 0443942..23dcd0c 100644 --- a/src/app.hpp +++ b/src/app.hpp @@ -1,14 +1,10 @@ #ifndef BLANK_APP_HPP_ #define BLANK_APP_HPP_ -#include -#include - #include "camera.hpp" #include "controller.hpp" -#include "hud.hpp" #include "init.hpp" -#include "model.hpp" +#include "interface.hpp" #include "shader.hpp" #include "world.hpp" @@ -18,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; @@ -40,20 +55,13 @@ private: DirectionalLighting program; Camera cam; - HUD hud; World world; + Interface interface; - OutlineModel outline; - bool outline_visible; - glm::mat4 outline_transform; + RandomWalk test_controller; bool running; - bool place, remove, pick; - - int remove_id; - int place_id; - }; }