summaryrefslogtreecommitdiffhomepage
path: root/main.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-05-21 15:31:39 +0200
committerAki <please@ignore.pl>2022-05-21 15:31:56 +0200
commit15ba7976d44eefb5db43db95c99c868b1f119636 (patch)
treeeab188cc49f50cdf6da5905baa5f543ea2afc5b6 /main.cpp
parenta26e53c7aa39d0b2ab8ef7b80bdf663563aed91c (diff)
downloadderelict-15ba7976d44eefb5db43db95c99c868b1f119636.zip
derelict-15ba7976d44eefb5db43db95c99c868b1f119636.tar.gz
derelict-15ba7976d44eefb5db43db95c99c868b1f119636.tar.bz2
Moved view and window management to App class
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/main.cpp b/main.cpp
index b419c2e..a0c4285 100644
--- a/main.cpp
+++ b/main.cpp
@@ -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();
}