diff options
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -1,27 +1,26 @@ +#include <memory> #include <utility> #include <raylib.h> +#include "App.h" #include "DumpSource.h" #include "Reader.h" #include "View.h" +App app; + + int main(int, char*[]) { - InitWindow(800, 600, "Derelict"); { - SetWindowState(FLAG_WINDOW_RESIZABLE); - SetTargetFPS(60); DumpSource source("sample.json"); auto [grids, timeline] = Reader::read(source); - View view(std::move(grids), std::move(timeline)); - while (!WindowShouldClose()) - { - view.update(GetFrameTime()); - view.draw(); - } + auto view = std::make_unique<View>(std::move(grids), std::move(timeline)); + app.assign(std::move(view)); } - CloseWindow(); + while (!WindowShouldClose()) + app.loop(); } |