diff options
| author | Aaditya Dhruv <[email protected]> | 2026-01-30 00:42:50 -0600 |
|---|---|---|
| committer | Aaditya Dhruv <[email protected]> | 2026-01-30 00:42:50 -0600 |
| commit | 839e04c5b583b51726207fc2508dce5c3afb3f04 (patch) | |
| tree | 70da713f51c513b47ece6b8db1b9bfb28e0b3da8 /src/chunk.h | |
| parent | 8150b91d4076d15f8df5cd66acc1b8076a2ee1a9 (diff) | |
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
Diffstat (limited to 'src/chunk.h')
| -rw-r--r-- | src/chunk.h | 3 |
1 files changed, 2 insertions, 1 deletions
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 */ |
