diff options
author | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-27 21:40:20 -0400 |
---|---|---|
committer | tylermurphy534 <tylermurphy534@gmail.com> | 2022-09-27 21:40:20 -0400 |
commit | 269263d88629c48027d71275dd778f7b01a569f1 (patch) | |
tree | 147f63e68d3941751b7bc4778a4bb745b8d88eba /engine/xe_model.cpp | |
parent | procedural chunk loading (diff) | |
download | minecraftvulkan-269263d88629c48027d71275dd778f7b01a569f1.tar.gz minecraftvulkan-269263d88629c48027d71275dd778f7b01a569f1.tar.bz2 minecraftvulkan-269263d88629c48027d71275dd778f7b01a569f1.zip |
destroy buffers on fence
Diffstat (limited to 'engine/xe_model.cpp')
-rw-r--r-- | engine/xe_model.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/engine/xe_model.cpp b/engine/xe_model.cpp index dc39584..f8001fd 100644 --- a/engine/xe_model.cpp +++ b/engine/xe_model.cpp @@ -155,4 +155,21 @@ void Model::Builder::loadModel(const std::string &filepath) { } +static std::vector<Model*> deleteQueue{}; + +void Model::deleteModel(Model* model) { + deleteQueue.push_back(model); +} + +void Model::submitDeleteQueue() { + for(Model* model : deleteQueue) { + if(model == nullptr) return; + try { + delete model; + } catch (int err) {} + } + deleteQueue.clear(); +} + + }
\ No newline at end of file |