I used to use LWJGL 2 a lot for OpenGL game projects a while back, but haven't used it in 2 or 3 years or so. I figured I'd give 3.0 a try for a new 3d application I have planned, but getting started has been a little tricky so far. I think the first hurdle is that the documentation at
http://www.lwjgl.org/guide is not correct (or maybe out of date?). The first, obvious, issue is that line 95:
GL.createCapabilities();
seems to require a boolean. However, setting it to true or false doesn't seem to change anything. You'll get an exception that looks like:
Exception in thread "main" java.lang.IllegalStateException: There is no OpenGL context current in the current thread.
at org.lwjgl.opengl.GL.getCapabilities(GL.java:164)
at org.lwjgl.opengl.GL11.getInstance(GL11.java:1390)
at org.lwjgl.opengl.GL11.glClearColor(GL11.java:1830)
at com.grimfox.dpm.HelloWorld.loop(HelloWorld.java:98)
at com.grimfox.dpm.HelloWorld.run(HelloWorld.java:28)
at com.grimfox.dpm.HelloWorld.main(HelloWorld.java:114)
either way. After importing sources and debugging through the code it seems that the issue is that at line 162 in GL.java currentContext is null. It also seems that createCapabilites doesn't really do anything necessary or useful at the place it's called. If I replace the createCapabilities line with the following:
// GL.createCapabilities(true);
GL.setCurrent(GLContext.createFromCurrent());
it seems to work (I get a red window). I'm now wondering if there is a better place to go to than the main documentation to find docs and examples about LWJGL that are more current or reliable. Is there some other place I should be looking for help and guidance? I'm not sure if changing this line was the right thing to do, or just me debugging until I found the issue and poking at it until it worked. Is there some place that explains what this is actually doing and why?