summaryrefslogtreecommitdiff
path: root/engine/xe_engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engine/xe_engine.cpp')
-rw-r--r--engine/xe_engine.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engine/xe_engine.cpp b/engine/xe_engine.cpp
index ea54bb4..6a971c9 100644
--- a/engine/xe_engine.cpp
+++ b/engine/xe_engine.cpp
@@ -1,4 +1,5 @@
#include "xe_engine.hpp"
+#include "xe_image.hpp"
#include <chrono>
namespace xe {
@@ -7,18 +8,15 @@ XeEngine::XeEngine(int width, int height, std::string name) : xeWindow{width, he
xeDevice{xeWindow},
xeRenderer{xeWindow, xeDevice},
xeCamera{} {
- loadDescriptors();
+ loadDescriptorPool();
};
-void XeEngine::loadDescriptors() {
+void XeEngine::loadDescriptorPool() {
xeDescriptorPool = XeDescriptorPool::Builder(xeDevice)
.setMaxSets(XeSwapChain::MAX_FRAMES_IN_FLIGHT)
.addPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, XeSwapChain::MAX_FRAMES_IN_FLIGHT)
.addPoolSize(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, XeSwapChain::MAX_FRAMES_IN_FLIGHT)
- .build();
-
- xeDescriptorSetLayout = XeDescriptorSetLayout::Builder(xeDevice)
- .addBinding(0, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT)
+ .addPoolSize(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, XeSwapChain::MAX_FRAMES_IN_FLIGHT)
.build();
}
@@ -35,6 +33,10 @@ std::shared_ptr<XeModel> XeEngine::loadModelFromData(std::vector<XeModel::Vertex
return std::make_shared<XeModel>(xeDevice, builder);
}
+std::shared_ptr<XeImage> XeEngine::loadImage(const std::string &filename) {
+ return std::make_shared<XeImage>(xeDevice, filename);
+}
+
bool XeEngine::poll() {
glfwPollEvents();
auto newTime = std::chrono::high_resolution_clock::now();