summaryrefslogtreecommitdiff
path: root/engine/xe_model.hpp
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-09-28 09:38:25 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-09-28 09:38:25 -0400
commit9d0262e8a2cbc722e0ff01058994c4ead1dbe0e5 (patch)
treecb5bfceb20da5a9f4f11403c0dd91a1ad15908fd /engine/xe_model.hpp
parentset render distance back to 10 (diff)
downloadminecraftvulkan-9d0262e8a2cbc722e0ff01058994c4ead1dbe0e5.tar.gz
minecraftvulkan-9d0262e8a2cbc722e0ff01058994c4ead1dbe0e5.tar.bz2
minecraftvulkan-9d0262e8a2cbc722e0ff01058994c4ead1dbe0e5.zip
better model and texture cleanup
Diffstat (limited to 'engine/xe_model.hpp')
-rw-r--r--engine/xe_model.hpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/engine/xe_model.hpp b/engine/xe_model.hpp
index e331ed1..9f0a42d 100644
--- a/engine/xe_model.hpp
+++ b/engine/xe_model.hpp
@@ -34,20 +34,24 @@ class Model {
void loadModel(const std::string &filepath);
};
- Model(const Model::Builder &builder);
+ static Model* createModel(const std::string &filepath);
+ static Model* createModel(Builder& builder);
+ static void deleteModel(Model* model);
+
~Model();
Model(const Model &) = delete;
Model operator=(const Model &) = delete;
-
- static Model* createModelFromFile(const std::string &filepath);
- static void deleteModel(Model* model);
- static void submitDeleteQueue();
void bind(VkCommandBuffer commandBuffer);
void draw(VkCommandBuffer commandBuffer);
private:
+
+ static void submitDeleteQueue(bool purge);
+
+ Model(const Model::Builder &builder);
+
void createVertexBuffers(const std::vector<unsigned char> &vertexData, uint32_t vertexSize);
void createIndexBuffers(const std::vector<uint32_t> &indexData);
@@ -59,6 +63,9 @@ class Model {
bool hasIndexBuffer = false;
std::unique_ptr<Buffer> indexBuffer;
uint32_t indexCount;
+
+ friend class SwapChain;
+ friend class Engine;
};
} \ No newline at end of file