chunk: mesh data is managed by the rendering thread now

EmaMaker 2023-10-04 12:55:16 +02:00
parent 3da0231629
commit 1d36a84f93
2 changed files with 0 additions and 19 deletions

View File

@ -52,9 +52,6 @@ namespace Chunk
~Chunk();
public:
void createBuffers();
void deleteBuffers();
glm::vec3 getPosition() { return this->position; }
void setState(chunk_state_t nstate, bool value);
bool getState(chunk_state_t n) { return (this->state & n) == n; }
@ -72,7 +69,6 @@ namespace Chunk
std::unique_ptr<Block[]> getBlocksArray(int* len) { return (this->blocks.toArray(len)); }
public:
GLuint VAO{0}, VBO{0}, extentsBuffer{0}, texinfoBuffer{0}, numVertices{0};
std::atomic<float> unload_timer{0};
chunk_index_t getIndex(){ return this->index; }

View File

@ -36,21 +36,6 @@ namespace Chunk
{
}
void Chunk::createBuffers(){
glGenVertexArrays(1, &(this->VAO));
glGenBuffers(1, &(this->VBO));
glGenBuffers(1, &(this->extentsBuffer));
glGenBuffers(1, &(this->texinfoBuffer));
}
void Chunk::deleteBuffers(){
glDeleteBuffers(1, &(this->VBO));
glDeleteBuffers(1, &(this->extentsBuffer));
glDeleteBuffers(1, &(this->texinfoBuffer));
glDeleteVertexArrays(1, &(this->VAO));
}
Block Chunk::getBlock(int x, int y, int z)
{
if(x < 0 || y < 0 || z < 0 || x > CHUNK_SIZE -1 || y > CHUNK_SIZE -1 || z > CHUNK_SIZE-1 ||