Hello gurus!
This is my first time to post here as I usually find a solution just searching around, but this time I found none. So my problem is that Java crashes upon calling glfwTerminate(). I call it after exiting the application loop and freeing callbacks and OpenGL resources like so:
while(!stopped)
{
glfwPollEvents();
//traverse scene
//render scene, draw code goes here
glfwSwapBuffers(displayID);
}
//free GL resources
glfwSetKeyCallback(displayID, null).free();
...
glfwTerminate();
What's interesting is that if I comment out the draw code the application exits gracefully ???. Everything works fine with rendering btw. The draw code goes like:
glBindVertexArray(vao);
glDrawElements(type, numIndices, GL_UNSIGNED_INT, 0);
This problem occurred when I switched from LWJGL 3.0.0a to LWJGL 3.0.0b and later versions including nightlies. Any insight on this will be much appreciated ;)
A minimal working sample (without dependencies other than LWJGL) that reproduces the issue would be very helpful.
Hi, thanks for the reply. I found out as I was building the test scene that it was an instruction in the fragment shader which causes the crash. I didn't know shader code can hinder proper disposal of the window :o.