From 5a08c9c8e230fd952311f29bc02b22c7635d0178 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Mon, 26 Sep 2022 20:57:53 -0400 Subject: vertex buffer is not a byte vector, multi texture loading --- src/first_app.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/first_app.cpp') 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 dirt = xeEngine.loadImageFromFile("res/image/dirt.jpg"); - std::shared_ptr grass = xeEngine.loadImageFromFile("res/image/grass.png"); + Chunk::load(); - std::vector 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() { -- cgit v1.2.3-freya