I'm trying to transfer data to vbo. However, with the current setup, it is slower than reinitializing the vbo with new data.
m_vertexBuffer is a std::vector<float> container, and I'm working on win32 platform.
glBindBuffer(GL_ARRAY_BUFFER, m_vertexBuffer);GLfloat* vertexPtr = (GLfloat*)glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);if(vertexPtr){ memcpy(vertexPtr, &m_renderingData[0], sizeof(float)*m_renderingData.size()); glUnmapBuffer(GL_ARRAY_BUFFER);}glBindBuffer(GL_ARRAY_BUFFER, 0);
Perhaps anyone had faced this problem and has a solution? Google had failed me this time.