chunk release resources on destruction
parent
ddd047e82f
commit
f3d89a2e5a
|
@ -15,7 +15,7 @@
|
||||||
#include "intervalmap.hpp"
|
#include "intervalmap.hpp"
|
||||||
#include "shader.hpp"
|
#include "shader.hpp"
|
||||||
|
|
||||||
#define CHUNK_SIZE 2
|
#define CHUNK_SIZE 8
|
||||||
#define CHUNK_VOLUME (CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE)
|
#define CHUNK_VOLUME (CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE)
|
||||||
#define CHUNK_MAX_INDEX (CHUNK_VOLUME - 1)
|
#define CHUNK_MAX_INDEX (CHUNK_VOLUME - 1)
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,12 @@ namespace Chunk
|
||||||
glDeleteBuffers(1, &(this->colorBuffer));
|
glDeleteBuffers(1, &(this->colorBuffer));
|
||||||
glDeleteBuffers(1, &(this->VBO));
|
glDeleteBuffers(1, &(this->VBO));
|
||||||
glDeleteBuffers(1, &(this->EBO));
|
glDeleteBuffers(1, &(this->EBO));
|
||||||
|
|
||||||
|
vertices.clear();
|
||||||
|
indices.clear();
|
||||||
|
colors.clear();
|
||||||
|
|
||||||
|
mutex_state.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
Block Chunk::getBlock(int x, int y, int z)
|
Block Chunk::getBlock(int x, int y, int z)
|
||||||
|
|
Loading…
Reference in New Issue