Vertex Array problem
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
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.
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.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement