memory corruption inside glutMainLoop()?

Go To StackoverFlow.com

0

I'm having some trouble with VBO's with my project. note: The code worked perfectly before trying to use VBO's.

Here's the error: http://pastebin.com/6x7YWtgc

Here's the gdb backtrace: http://pastebin.com/zn3aN43b

My glut+glew initialization code and some relevant code and data structures: http://pastebin.com/xEEUc0ix

ps: A valgrind output is enormous because of fglrx code.

2012-04-04 16:52
by Victor
Alas, with memory corruption, cause and effect can be as far apart as Mercury and Pluto. I'd recommend going back through previous commits until the problem disappears. Then maybe update the question with the questionable code - Thomas 2012-04-04 17:24
Post a SSCCE that reproduces the problem - genpfault 2012-04-04 18:26
@Thomas I know, and the relevant code section is the new part. That's everything that changed from one commit to another. I can't remove just part of the new code, since it introduces a whole new way of rendering objects - Victor 2012-04-04 19:26
@genpfault I'm trying to create one, but none of the SSCCE I created so far reproduces the problem... = - Victor 2012-04-04 19:26


3

From what I can see within your code, you have enabled a vertex, normal, and texture coordinate array:

glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_NORMAL_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);

However, you only set a pointer to the vertex array:

glVertexPointer(3, GL_FLOAT, sizeof(GPoint), 0);

Whenever I do this, my programs crash as well. Try commenting out the normal and texture coordinate arrays and try it again.

2012-04-05 02:54
by Nyatra
So simple, yet so distant solution... Thank you very much. Btw, I had to change the order of the includes too! I had to include GL/glew.h as the first included file and comment out the unused arrays - Victor 2012-04-05 12:16
Ads