From 839e04c5b583b51726207fc2508dce5c3afb3f04 Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Fri, 30 Jan 2026 00:42:50 -0600 Subject: Add chunk_unloading on chunk Changes If we change a chunk, unload all chunks. This removes block GPU data (vbo, ebo, vao). We anyways redraw so we don't lose anything --- src/chunk.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/chunk.h') diff --git a/src/chunk.h b/src/chunk.h index ac24a2d..0122cf9 100644 --- a/src/chunk.h +++ b/src/chunk.h @@ -20,6 +20,7 @@ struct chunk { struct block* blocks[CHUNK_WIDTH][CHUNK_LENGTH][CHUNK_HEIGHT]; enum biome biome; vec2 coord; + int loaded; }; /** @@ -38,7 +39,7 @@ int chunk_gen(struct world* wld, vec2 coord, struct chunk** chunk); */ void chunk_load(struct chunk* chunk, int coord[2]); /** - * Unload a chunk. Delete GPU data, not the chunk data itself + * Unload a chunk. Delete block GPU and memory data, not the chunk data itself * * @param chunk Chunk to load */ -- cgit