🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Vertex Array problem

Started by
1 comment, last by Cribs 17 years, 3 months ago
Im having a problem getting Vertex Arrays working. When i compile the program, it compiles fine. When i run it i get a runtime error that says im trying to access memory from 0x00000000. When i try debugging it breaks at glDrawElements. Right now I have the program just trying to draw a simple triangle to the screen. Im using SDL to do handle my window and opengl. Iv read an entire chapter from OpenGL Superbible about vertex arrays and I have looked at several samples that have all run without a problem. Here is my entire program. I have an extention header and a vec3d header but im sure the problem isnt in those, so this should suffice. Here is the code for my test program: http://cpp.sourceforge.net/?show=33399 Thanks in advance! Cribs
Advertisement
The code looks ok at first glance but i see that you have these lines

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

now if you enable any of these without supplying a pointer, then it will use the default 0x00000000 as a pointer, and that's bad, so just delete these 3 lines, you don't need them there anyway.
haha, that fixed it. Thanks man, iv been trying to figure this out for 2 days :P

Thanks a ton!

This topic is closed to new replies.

Advertisement