summaryrefslogtreecommitdiff
path: root/src/first_app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/first_app.cpp')
-rwxr-xr-xsrc/first_app.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/first_app.cpp b/src/first_app.cpp
index 04272ba..2319670 100755
--- a/src/first_app.cpp
+++ b/src/first_app.cpp
@@ -3,20 +3,17 @@
namespace app {
-FirstApp::FirstApp() : xeEngine{WIDTH, HEIGHT, "Xenon Vulkan Engine"} {
- loadGameObjects();
-}
+FirstApp::FirstApp() : xeEngine{WIDTH, HEIGHT, "Xenon Vulkan Engine"} {};
FirstApp::~FirstApp() {}
void FirstApp::run() {
- std::shared_ptr<xe::Image> dirt = xeEngine.loadImageFromFile("res/image/dirt.jpg");
- std::shared_ptr<xe::Image> grass = xeEngine.loadImageFromFile("res/image/grass.png");
+ Chunk::load();
- std::vector<xe::Image*> images = {dirt.get(), grass.get()};
+ loadGameObjects();
- SimpleRenderer renderer{xeEngine, images};
+ SimpleRenderer renderer{xeEngine, Chunk::getTextures()};
xe::Sound sound{"res/sound/when_the_world_ends.wav"};
sound.setLooping(true);
@@ -41,10 +38,10 @@ void FirstApp::run() {
}
- Chunk::reset();
-
xeEngine.close();
+ Chunk::unload();
+
}
void FirstApp::loadGameObjects() {