glEnableVertexAttribArray crashes program

Started by ste3e, February 11, 2011, 09:32:32

Previous topic - Next topic

ste3e

I have set up a VBO with sequential data of vertex, coords, normals, tangents and bitangents. The code below runs fine until I add (or uncomment) glEnableVertexAttribArray(0) whereupon the program crashes and files "A fatal error has been detected by the Java runtime environment"... the error occurs outside of the JVM. Are there any known issues, or have I done something wrong in the code below?


int tanLoc=GL20.glGetAttribLocation(Bin.mainShader, "vTan");
        if(tanLoc<1)
            System.out.println("Error setting grabbing shader vars");
        
        ARBVertexBufferObject.glBindBufferARB(ARBVertexBufferObject.GL_ARRAY_BUFFER_ARB, vboId);
        GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
        GL11.glVertexPointer(3, GL11.GL_FLOAT, 0, 0);
        GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
        GL11.glTexCoordPointer(2, GL11.GL_FLOAT, 0, coordOff);
        GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
        GL11.glNormalPointer(3, GL11.GL_FLOAT, normOff);
        GL20.glEnableVertexAttribArray(0);



Matzon

technically, crashes outside LWJGL.dll == broken drivers

Have you checked for GL version is 2.0 or greater?

Matthias

If you want help then you should upload the crash report file from hotspot.

Crashes with VBO are most likely driver bugs.
Crashes with VA are most likely application bugs where data outside the vertex array are accessed - eg by passing invalid indices to glDrawElements.
If you use VBOs and VAs in the same application then the most likely cause is that your forgot to enable/disable an array or update it's pointer - see crashes with VA above.