chunk_manager.h (675B)
1 #ifndef CHUNK_MANAGER_H 2 #define CHUNK_MANAGER_H 3 4 #include "camera.h" 5 #include "chunk.h" 6 #include "threadpool.h" 7 #include "types.h" 8 9 typedef struct { 10 IVec3 origin; 11 i32 radius; 12 13 SDF f; 14 f32 isolevel; 15 16 u32 chunk_count; 17 IVec3 *offsets; 18 Chunk *chunks; 19 20 b8 *is_new_offset; 21 b8 *is_old_chunk; 22 23 ThreadPool *pool; 24 25 } ChunkManager; 26 27 ChunkManager ChunkManager_create( 28 const Vec3 target, 29 i32 radius, 30 SDF f, 31 f32 isolevel 32 ); 33 34 void ChunkManager_free(ChunkManager *cm); 35 36 void ChunkManager_recenter(ChunkManager *cm, const Vec3 target); 37 38 void ChunkManager_drawChunks(const ChunkManager *cm, const Camera *camera); 39 40 #endif