diff --git a/src/glview/VertexArray.cc b/src/glview/VertexArray.cc index 0dca7936c7..78ae05b346 100644 --- a/src/glview/VertexArray.cc +++ b/src/glview/VertexArray.cc @@ -11,27 +11,6 @@ void addAttributeValues(IAttributeData&) {} -void VertexData::fillInterleavedBuffer(GLbyte *interleaved_buffer) const -{ - // All attribute vectors need to be the same size to interleave - if (attributes_.size()) { - size_t last_size = attributes_[0]->size() / attributes_[0]->count(); - - GLbyte *dst_start = interleaved_buffer; - for (const auto& data : attributes_) { - size_t size = data->sizeofAttribute(); - GLbyte *dst = dst_start; - const GLbyte *src = data->toBytes(); - for (size_t i = 0; i < last_size; ++i) { - std::memcpy((void *)dst, (void *)src, size); - src += size; - dst += stride_; - } - dst_start += size; - } - } -} - void VertexData::getLastVertex(std::vector& interleaved_buffer) const { GLbyte *dst_start = interleaved_buffer.data(); @@ -51,27 +30,6 @@ void VertexData::remove(size_t count) } } -// void VertexData::createInterleavedVBO(GLuint& vbo) const -// { -// size_t total_bytes = this->sizeInBytes(); -// if (total_bytes) { -// std::vector interleaved_buffer; -// interleaved_buffer.resize(total_bytes); -// fillInterleavedBuffer(interleaved_buffer.data()); - -// if (vbo == 0) { -// glGenBuffers(1, &vbo); -// } - -// GL_TRACE("glBindBuffer(GL_ARRAY_BUFFER, %d)", vbo); -// GL_CHECKD(glBindBuffer(GL_ARRAY_BUFFER, vbo)); -// GL_TRACE("glBufferData(GL_ARRAY_BUFFER, %d, %p, GL_STATIC_DRAW)", total_bytes % (void *)interleaved_buffer.data()); -// GL_CHECKD(glBufferData(GL_ARRAY_BUFFER, total_bytes, interleaved_buffer.data(), GL_STATIC_DRAW)); -// GL_TRACE0("glBindBuffer(GL_ARRAY_BUFFER, 0)"); -// GL_CHECKD(glBindBuffer(GL_ARRAY_BUFFER, 0)); -// } -// } - void VertexData::append(const VertexData& data) { size_t i = 0; for (auto& a : attributes_) { @@ -216,20 +174,6 @@ void VertexArray::createVertex(const std::array& points, } } -void VertexArray::fillInterleavedBuffer(std::vector& interleaved_buffer) const -{ - size_t total_bytes = this->sizeInBytes(); - if (total_bytes) { - interleaved_buffer.resize(total_bytes); - GLbyte *dst = interleaved_buffer.data(); - - for (const auto& data : vertices_) { - data->fillInterleavedBuffer(dst); - dst += data->sizeInBytes(); - } - } -} - void VertexArray::createInterleavedVBOs() { for (const auto& state : states_) { diff --git a/src/glview/VertexArray.h b/src/glview/VertexArray.h index e2ed9f1d31..b04a5ef778 100644 --- a/src/glview/VertexArray.h +++ b/src/glview/VertexArray.h @@ -213,8 +213,6 @@ class VertexData void allocateBuffers(size_t num_vertices); - // Create an interleaved buffer and return it as GLbyte array pointer - void fillInterleavedBuffer(GLbyte *interleaved_buffer) const; // Get the last interleaved vertex void getLastVertex(std::vector& interleaved_buffer) const; // Create an interleaved buffer in the provided vbo. @@ -332,9 +330,6 @@ class VertexArray void allocateBuffers(size_t num_vertices); - // Create an interleaved buffer and return it as GLbyte array pointer - void fillInterleavedBuffer(std::vector& interleaved_buffer) const; - // Create an interleaved VBO from the VertexData in the array. void createInterleavedVBOs();