Hi guys - I hope you are able to help me with one of the nastiest bugs that I’ve seen so far :clue:
I’m using LWJGL and tried to implement VAO usage.
When I call glGenVertexArrays on some systems the whole jvm crashes. After some further investigation I got the following dump:
http://www.java-gaming.org/?action=pastebin&id=1505
As far as I get it, the problem is that I try accessing some wrong storage memory (?)
But I don’t get what I’m doing wrong - after all I just call glGenVertexArrays …
Here’s the code of createMesh:
private void createMesh(float[] vertexCoords, float[] vertexTexCoords, float[] vertexNormalCoords) {
vertexCount = vertexCoords.length / COORDS_PER_VERTEX;
float[] combinedData = new float[vertexCoords.length+vertexNormalCoords.length+vertexNormalCoords.length];
for(int i=0;i<vertexCoords.length; i++){
combinedData[i] = vertexCoords[i];
}
for(int i=0;i<vertexTexCoords.length; i++){
combinedData[i+vertexCoords.length] = vertexTexCoords[i];
}
for(int i=0;i<vertexNormalCoords.length; i++){
combinedData[i+vertexCoords.length+vertexTexCoords.length] = vertexNormalCoords[i];
}
texOffset = vertexCount*3;
normOffset = vertexCount*5;
vao = glGenVertexArrays();
glBindVertexArray(vao);
vbo = glGenBuffers();
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, createFloatBuffer(combinedData), GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
glVertexAttribPointer(0, COORDS_PER_VERTEX, GL_FLOAT, false, 0, 0);
glVertexAttribPointer(1, TEX_COORDS_PER_VERTEX, GL_FLOAT, false, 0, texOffset*BYTES_PER_FLOAT);
glBindVertexArray(0);
}
I hope you can help since I’m really getting nowhere with this. Every feedback or clue is highly appreciated!