summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTyler Murphy <tylermurphy534@gmail.com>2022-09-28 11:26:00 -0400
committerTyler Murphy <tylermurphy534@gmail.com>2022-09-28 11:26:00 -0400
commit1f4dc3aa8461e58068951fefe1cd011fd923e9dd (patch)
tree27ec0ac896dd5435d2317a35130e92ad588e6756 /src
parentdont destroy buffers until not used (diff)
downloadminecraftvulkan-1f4dc3aa8461e58068951fefe1cd011fd923e9dd.tar.gz
minecraftvulkan-1f4dc3aa8461e58068951fefe1cd011fd923e9dd.tar.bz2
minecraftvulkan-1f4dc3aa8461e58068951fefe1cd011fd923e9dd.zip
only wait for buffers once. fix chunk mesh edges
Diffstat (limited to 'src')
-rwxr-xr-xsrc/first_app.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/first_app.cpp b/src/first_app.cpp
index 43047f7..6b6a80e 100755
--- a/src/first_app.cpp
+++ b/src/first_app.cpp
@@ -79,8 +79,10 @@ void FirstApp::reloadLoadedChunks(xe::GameObject& viewer) {
if(chunk == nullptr) {
chunk = Chunk::newChunk(newGridX, newGridZ, 12345);
Chunk::createMeshAsync(chunk);
+ Chunk::createMeshAsync(Chunk::getChunk(newGridX+1, newGridZ));
Chunk::createMeshAsync(Chunk::getChunk(newGridX-1, newGridZ));
Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ+1));
+ Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ-1));
}
gameObject.model = chunk->getMesh();
gameObject.transform.translation = glm::vec3(newGridX * 16.f, 0, newGridZ * 16.f);