Hello, I’m currently working on an engine, and I’ve come upon a strange issue where data in my vertex buffer gets corrupted (filled with NaN, nulled) upon posting that data with glVertexAttribPointer
I use the following code to retrieve the data, each time (except slightly adjusted due to the different scopes)
glGetBufferSubData(GL_ARRAY_BUFFER,0,Data3D.size() * sizeof(glm::vec3), &vertices);
for (int i = 0; i < Data3D.size(); i++)
{
std::cout << vertices[i] << std::endl;
}
The first time, it outputs this:
[ATTACH=CONFIG]1453[/ATTACH]
Right after the glBufferData call, it clearly shows that the data has been uploaded correctly (even if that is a small snippet of the vertices)
Right before, and after i call glVertexAttribPointer, I get something completely different, however.[ATTACH=CONFIG]1454[/ATTACH]
As you can see, the data in my VBO has become corrupted, and therefore, upon calling glDrawArrays, it completely breaks, and throws a segmentation fault.
Can I have some insight into why my vertex data would randomly corrupt itself?