glDrawElements segfault
glDrawElements crashes with segfault on large vertex/index arrays.
If I have a vertex array of 28000 vertices and the first triangle
indices are 5 7055 20969, I get a segfault.
glEnableClientState(GL_INDEX_ARRAY);
glVertexPointer(4, GL_FLOAT, 0, pvertex);
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, pindex); // -> crashes here
I tried it with GL1.2 on several video cards, but the result is the same.
However it works fine on with small vertex indices for the first tirangle (e.g 0, 1, 2)
Are there any known limitations of the array/sizes, or index gaps?
Thanks.
Just a guess, try:
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(4, GL_FLOAT, 0, pvertex);
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, pindex);
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(4, GL_FLOAT, 0, pvertex);
glDrawElements(GL_TRIANGLES, 3, GL_UNSIGNED_SHORT, pindex);
Oops, sorry, originally it was GL_VERTEX_ARRAY in the code I try :)
Just a copy/paste error when I typed the post.
Thanks.
Just a copy/paste error when I typed the post.
Thanks.
Are you able to extract coordinates yourself without it crashing?
pvertex[pindex[0]]
pvertex[pindex[1]]
pvertex[pindex[2]]
..
..
pvertex[pindex[0]]
pvertex[pindex[1]]
pvertex[pindex[2]]
..
..
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement