From 3a6ce0217a0bff7fffe267e7058ca8817f2f9f1c Mon Sep 17 00:00:00 2001 From: "matthias@arch" Date: Fri, 21 Oct 2022 21:59:35 +0200 Subject: [PATCH] changed rect order --- src/main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cb57428..02f00ba 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,8 @@ #include "shape.hpp" #include "vulkan_instance.hpp" #include "renderer2D.hpp" +#include "renderer3D.hpp" + #include #include #include @@ -31,15 +33,15 @@ namespace gz::vk { log("Startup complete. Drawing shapes"); + Rectangle rect9(-200, -400, 200, 200, { 0.0f, 1.0f, 0.0f}, "entities/sheep.png"); Rectangle rect1( 90, 91, 92, 93, { 1.0f, 0.9f, 0.8f}, "blocks/leaves.png"); Rectangle rect2( 190, 191, 192, 193, { 0.7f, 0.6f, 0.5f}, "blocks/crate.png"); Rectangle rect3( 32, 120, 400, 400, { 0.0f, 0.0f, 1.0f}, "blocks/dirt.png"); - Rectangle rect4(-600, -600, 800, 400, { 1.0f, 0.0f, 0.0f}, "blocks/ice.png"); Rectangle rect5( 90, 91, 92, 93, { 1.0f, 0.9f, 0.8f}, "items/sword.png"); Rectangle rect6( 190, 191, 192, 193, { 0.7f, 0.6f, 0.5f}, "items/crossbow.png"); + Rectangle rect4(-600, -600, 800, 400, { 1.0f, 0.0f, 0.0f}, "blocks/ice.png"); Rectangle rect7( 32, 120, 400, 400, { 0.0f, 0.0f, 1.0f}, "special/hotbar.png"); Rectangle rect8(-600, -600, 800, 400, { 1.0f, 0.0f, 0.0f}, "special/func_nocol.png"); - Rectangle rect9(-200, -400, 200, 200, { 0.0f, 1.0f, 0.0f}, "entities/sheep.png"); Rectangle rect10(-400, -400, 800, 800, { 0.0f, 1.0f, 0.0f}, "atlas"); r2D.drawShape(&rect1); r2D.drawShape(&rect2); @@ -54,6 +56,8 @@ namespace gz::vk { log("Drawing complete. Filling r2D with shapes."); r2D.fillVertexBufferWithShapes(); r2D.fillIndexBufferWithShapes(); + + Renderer3D r3D(vulkanInstance, textureManager); /* gz::FontManager fm("fonts"); */ /* fm.loadFont("menu.ttf"); */ /* /1* fm.getFaces().at("menu.ttf"). *1/ */ @@ -64,6 +68,7 @@ namespace gz::vk { glfwPollEvents(); imageIndex = vulkanInstance.beginFrameDraw(); r2D.drawFrame(imageIndex); + r3D.drawFrame(imageIndex); vulkanInstance.endFrameDraw(imageIndex); auto SLEEP_TIME = std::chrono::milliseconds(1000 / vulkanInstance.settings.get("framerate")); std::this_thread::sleep_for(SLEEP_TIME);