Génération de Chunks en multithreads
This commit is contained in:
@@ -16,11 +16,14 @@ bool VertexBuffer::IsValid() const {
|
||||
return m_isValid;
|
||||
}
|
||||
|
||||
std::mutex VertexBuffer::m_opgl;
|
||||
|
||||
void VertexBuffer::SetMeshData(VertexData* vd, int vertexCount) {
|
||||
const std::lock_guard<std::mutex> prout(VertexBuffer::m_opgl);
|
||||
assert(vertexCount <= USHRT_MAX);
|
||||
if(vertexCount == 0)
|
||||
return;
|
||||
|
||||
|
||||
if(!m_isValid) {
|
||||
glGenBuffers(1, &m_vertexVboId);
|
||||
glGenBuffers(1, &m_indexVboId);
|
||||
|
Reference in New Issue
Block a user