voxel-engine/include/chunkmanager.hpp

34 lines
808 B
C++
Raw Normal View History

#ifndef CHUNKMANAGER_H
#define CHUNKMANAGER_H
// Second to be passed outside of render distance for a chunk to be destroyed
#define UNLOAD_TIMEOUT 10
2023-04-09 21:44:17 +02:00
#include <unordered_map>
#include <thread>
2023-04-09 21:44:17 +02:00
#include "chunk.hpp"
#include "globals.hpp"
namespace chunkmanager
{
std::thread initGenThread();
std::thread initMeshThread();
2023-03-07 21:37:28 +01:00
void stopGenThread();
void stopMeshThread();
void mesh();
void generate();
2023-03-07 21:37:28 +01:00
void init();
2023-03-23 21:17:06 +01:00
void blockpick(bool place);
uint32_t calculateIndex(uint16_t i, uint16_t j, uint16_t k);
void destroy();
2023-04-09 21:44:17 +02:00
std::unordered_map<std::uint32_t, Chunk::Chunk*>& getChunks();
std::array<std::array<int, 3>, chunks_volume>& getChunksIndices();
2023-03-23 21:17:06 +01:00
void update(float deltaTime);
void updateChunk(uint32_t, uint16_t, uint16_t, uint16_t);
}
2023-03-07 21:37:28 +01:00
#endif