voxel-engine/include/chunkmanager.hpp

29 lines
662 B
C++
Raw Normal View History

#ifndef CHUNKMANAGER_H
#define CHUNKMANAGER_H
// Seconds to be passed outside of render distance for a chunk to be destroyed
#define UNLOAD_TIMEOUT 10
#include <thread>
#include <oneapi/tbb/concurrent_queue.h>
2023-04-09 21:44:17 +02:00
#include "chunk.hpp"
#include "globals.hpp"
namespace chunkmanager
{
std::thread 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 stop();
2023-03-23 21:17:06 +01:00
void destroy();
oneapi::tbb::concurrent_queue<Chunk::Chunk*>& getDeleteVector();
2023-04-09 21:44:17 +02:00
std::array<std::array<int, 3>, chunks_volume>& getChunksIndices();
Block getBlockAtPos(int x, int y, int z);
void update();
}
2023-03-07 21:37:28 +01:00
#endif