I just tried running my game on a friend's laptop, but for some reason it crashes. The exported .jar runs fine on my machine, and some others too. I can see that is has something to do with the glDrawArrays function, that is this code:


glTranslatef(pos.x*world.chunkSize.x, 0.0f, pos.y*world.chunkSize.z);

glBindBuffer(GL_ARRAY_BUFFER, vao_id);

glVertexAttribPointer(world.game.positionAtt, 3, GL_FLOAT, false, 36, 0);
glVertexAttribPointer(world.game.normalAtt, 3, GL_FLOAT, false, 36, 12);
glVertexAttribPointer(world.game.texCoordAtt, 2, GL_FLOAT, false, 36, 24);
glVertexAttribPointer(world.game.lightAtt, 1, GL_FLOAT, false, 36, 32);

glDrawArrays(GL_TRIANGLES, 0, arraySize / 9);

glBindBuffer(GL_ARRAY_BUFFER, 0);


As said, the exact same .jar runs fine on my system, and some more I have tried it on.

My friend's pc has Intel HD Graphics 3000, with GLSL version 1.40 and OpenGL 3.1.0.

Crash dump: http://pastebin.com/X8x4xX8j

Thanks in advance.

  • \$\begingroup\$ This question on SO might be able to help you. \$\endgroup\$
    – Polar
    Mar 22, 2013 at 14:36
  • \$\begingroup\$ Some drivers are more forgiving that others. You'll need to ensure you're correctly formatting your data, setting up the pointers correctly and correctly buffering the data. \$\endgroup\$
    – House
    Mar 22, 2013 at 16:06
  • \$\begingroup\$ What about the GLSL 2.0 problem? Edit: you said GLSL 1.4 isnt compaitable with glVertexAttribPointer, but you meant OpenGL 1.4 right? So it should be able to run this? \$\endgroup\$
    – Basaa
    Mar 22, 2013 at 16:13
  • \$\begingroup\$ You're binding vao_id as your vertex buffer - can you confirm that this is intentional and shouldn't be something like "vbo_id" instead? (i.e. you're not using glBindVertexArray/etc anywhere?) \$\endgroup\$ Mar 22, 2013 at 17:04
  • \$\begingroup\$ Yep, my answer was wrong, mh01 pointed that out. Henk should be able to run Age of Blocks on their laptop. \$\endgroup\$
    – House
    Mar 22, 2013 at 17:08

2 Answers 2


Ok, found it. It was a problem in the fragment shader. I passed a vec3 in a vec2 to the fragment shader. For some reason my Ati card driver accepted it, but for example Intel didnt. Thanks for the help all.


LWJGL comes with lwjgl.jar, which is needed in your classpath to run the program. It also comes with lwjgl-debug.jar, which can be used instead to find out incorrect OpenGL usage. Either replace lwjgl.jar with lwjgl-debug.jar in your classpath or just rename the files accordingly if that is easier.

The debug version of LWJGL will call glGetError after all OpenGL calls where it is allowed. If the result is not GL_NO_ERROR, it throws an Exception containing the type of the error. You can then check from the stacktrace or by using a debugger which of your OpenGL calls was incorrect. Together with the documentation of the the function you can find out what is wrong.

While this approach doesn't find out all problems and the results differ between graphics cards, it does pretty good job on ensuring that you are using OpenGL correctly. For example I just found out few days ago with this method that I was also passing vector of wrong dimension as a uniform to a shader. I recommend to test the application with the debug version with at least AMD and nVidia cards.

When you are releasing the game, make sure to use the non-debug version of the library again.


Not the answer you're looking for? Browse other questions tagged .