This page is a collection questions that occur from time to time. If you have a specific problem, please post a question to the forum.
LWJGL is distributed under a BSD license which allows you to do whatever you want, as long as you include the LWJGL license, and any components you use (OpenAL, Jinput, DevIL, FMOD). Do note however, that FMOD requires a seperate license - specifically if you are using it a commercial project, you must buy a license.
There are a lot of options for getting help, most notably the IRC channel and the Forum. We also have a forum on javagaming.org.
This is because the path to the native dll hasn't been supplied. Add a -Djava.library.path=path/to/dir to the commandline or as an VM option in your IDE
For optimal performance LWJGL uses Java 1.4's ByteBuffers to move chunks of data between your Java code and the native OpenGL/OpenAL/etc. libraries. ByteBuffers are essencially continuous chunks of data, you can access them much like an array, but also have operations for bulk put and get.
ByteBuffers used with LWJGL should be *direct*, as non-direct buffers will be copied to an internal direct buffer before being used. The provided BufferUtil will create buffers for you which are both direct and also have their endian correctly set.
BufferUtils.createIntBuffer(size); BufferUtils.createFloatBuffer(size);
ByteBuffers have an internal position and limit. These are set as you put and get data to and from them. When using a ByteBuffer as a parameter in a method, LWJGL will start from the element marked by the position and progress up to the element marked by the limit. This has the side effect of removing the 'size' param of many OpenGL/OpenAL methods, as it is now calculated for you. In general you need to create a byte buffer, fill it with data (which will automatically move the position along it) and then call .flip() on the buffer. This flip will correctly set the position and limit to span your added data ready for use with LWJGL.
Many OpenGL/OpenAL methods which in C have a type postfix (such as glLightfv/glLightiv) no longer have the postfix, instead this is determined by the type of ByteBuffer passed to it.
TODO: Add a proper code example using a buffer and flip()
glGetInteger/etc. accepts a byte buffer to return the values specified by the enum. Depending on the enum the length of the data varies, but you must always pass a byte buffer with at least space for 16 ints/floats.
All OpenGL calls must be made in the thread in which its context is current. At the most simple usage this means creating the display in the main thread and keeping all OpenGL calls in this thread. If you want to use OpenGL in another thread then you can either create the display in that thread to start with, or use Display.makeCurrent() (and watch for the usual threading issues, like interrupting a set of drawing commands you might be in the middle of).
Fetching the latest code from Subversion and typing ant should build the jar files in libs/ and the natives in the subdirectories win32, linux or macosx. The requirements for building are roughly:
Yes. GCJ 4.0 and 4.1 support LWJGL applications. This guy managed to compile a reasonably complex game with GCJ and LWJGL on windows.