Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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:

glPushMatrix();

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);

glPopMatrix();

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.

share|improve this question

closed as too localized by Byte56, Maik Semder, Sean Middleditch, Trevor Powell, bummzack Mar 25 '13 at 14:37

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
This question on SO might be able to help you. –  Polar Mar 22 '13 at 14:36
    
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. –  Byte56 Mar 22 '13 at 16:06
    
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? –  Basaa Mar 22 '13 at 16:13
    
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?) –  Jimmy Shelter Mar 22 '13 at 17:04
    
Yep, my answer was wrong, mh01 pointed that out. Henk should be able to run Age of Blocks on their laptop. –  Byte56 Mar 22 '13 at 17:08
show 1 more comment

2 Answers 2

up vote 1 down vote accepted

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.

share|improve this answer
add comment

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.

share|improve this answer
    
Wow, nice tip! Thanks! –  Basaa Mar 23 '13 at 14:18
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.