Jump to content
  • Advertisement
Sign in to follow this  
Cribs

Vertex Array problem

This topic is 4080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
haha, that fixed it. Thanks man, iv been trying to figure this out for 2 days :P

Thanks a ton!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!