PDA

View Full Version : glDrawElements() crash from time to time



_NK47
07-14-2008, 03:32 AM
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

_NK47
07-14-2008, 03:33 AM
Btw. tested on ATI and NVIDIA drivers

dletozeun
07-14-2008, 04:30 AM
Maybe you should post some code, to see how you set your arrays.

_NK47
07-14-2008, 06:34 AM
thanks! code gets fixed always when you try to get help. :)
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.

dletozeun
07-14-2008, 11:34 AM
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... :)