maybe I got it all wrong but is there anything wrong by dynamiclly changing my index buffer object using glBufferSubdata()?
It seems that my NVIDIA driver doesn’t copy my indices from client memory to GPU when I do this:
glBufferData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)(indices * sizeof(uint32)), (GLvoid*)NULL, GL_STREAM_DRAW);
…and later in my game I try to create my scene using indices to tell OpenGL what to render and what not.
This approach WORKS - however its slow as hell on NV hardware:
uint32* idx = NULL;
myNewIndices = (uint32*)glMapBuffer(GL_ELEMENT_ARRAY_BUFFER, GL_WRITE_ONLY);
// copy indices into buffer “myNewIndices”
And this approach messes up my geometry completely. It seems that the indices are not copied correctly to the GPU:
// copy size indices into buffer “myNewIndices”
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, size, myNewIndices);
Can anyone please give me a hint what I did wrong here?
Thanks a bunch in advance