Hello,
I’m using VAOs with glew to render stuff. I didn’t noticed first but I get an handled (!) not-interrupting exception on (only) my first call of glDrawElements:
First-chance exception at 0x027AFD84 (ig7icd32.dll) in MyApp.exe: 0xC0000005: Access violation reading location 0x00000000.
It’s listed under “Win32 Memory Violation Excetion” in VS. As I said it doesn’t crash or stop my app but I wonder why it get’s thrown in the first place.
Just few checks,
are you binding vertexarray before uploading data in array buffer? Also, where are BindVertexArrayPointer and EnableVertexattribPointer call?
Few things to mention:
if you are not passing any other data into index buffer than indices, your last parameter should be 0 offset it will state the starting point. Same applies to glVertexAttribPointer, the last parameter should be 0 and stride as well as I dont see you are passing texture coordinate or normal or any other data in array buffer.
here you should be passing array buffer attribute not index buffer. Data in AttribPointer should be of array buffer. In addition make sure that you are calling bindbuffer and enableattribpointer calls in a sequence to match them to particular buffer.
[QUOTE=debonair;1254724]Binding vertex array means :
Few things to mention:
if you are not passing any other data into index buffer than indices, your last parameter should be 0 offset it will state the starting point.
[/QUOTE]
I use offsets into the index-buffer to change shader-programs. e.g. I have 2 triangles in my indexbuffer, drawing one with offset 0, the other with 3 * sizeof(GLushort) and change shader inbetween.
as well as I dont see you are passing texture coordinate or normal or any other data in array buffer.
I interleave vertex attributes in one vbo. Thats where the offset and stride come from
here you should be passing array buffer attribute not index buffer. Data in AttribPointer should be of array buffer. In addition make sure that you are calling bindbuffer and enableattribpointer calls in a sequence to match them to particular buffer.
> Exception is handled and doesn’t crash the program
> Exception lists the intel driver dll (ig7icd32.dll) (I use an Intel HD4000)
> Exception only occurs on the very first call of glDrawElements
> I can’t detect errors in my OpenGL state at that very moment