glDrawElements() crash from time to time

Hi everybody,

I have a very weird problem. Im using QT and OpenGL in one project and draw geometry with glDrawElements(). Now this works fine for some time but after a time glDrawElements() call crash with unhandled exception reading out memory on 0x00000000. Im not new to GL but never experienced this before. That is one time it works another time not. All states are set properly, vertex array pointer + client state and other arrays are simply disabled (all) and vertex/index data is valid as well as the count of elements.

Is there any other state affecting the glDrawElements() call i don’t know about? QT might set its own states, that was my first idea.

Thanks a lot in advance

Btw. tested on ATI and NVIDIA drivers

Maybe you should post some code, to see how you set your arrays.

thanks! code gets fixed always when you try to get help. :slight_smile:
checked the gl calls trace and noticed that somewhere before my glDrawElements() call a glNewList() is called (not in my code) without closing the list. so its trying to put all that into a list. just checking now if a list is in creation. if so i ignore the rendering.

Yes, this works for me too, I often find the solution when I am about to posting. Maybe it is because I have to read carefully my code to know which part I should paste here… :slight_smile: