Lwjgl
From CSWiki
This is the wiki page for lwjgl(Lightweight Java Game Library).
Contents |
[edit] Conceptual model
[edit] Concepts and objects
Many java programmers may think it is hard to implement high quality games using openGL and openAL. However, Lightweight Java Game Library came out with this idea to make this easy( maybe not very "easy". You still have to understand how this library works.). It is under BSD license so it is free and open source. They just released their very first version on Jan 7, 2007 so it is still very new.
[edit] Operations
Because its name is "lightweight", it should be easy to install and use. The answer is "YES" and "NO". It is easy to install and use because you can just download the zip file and unzip to the location you want and just import the packages you need to make it run. Nevertheless, you have to know how openGL works first in order to make a real and working program.
[edit] Prerequisites
Before installing lwjgl, you need to have JDK installed on your computer. The newest JDK is JDK6.0 at this time.
The following is the installation procedure:
1. Go to lwjgl main page to download the file(s). It will forword you to SourceForge.net. There is only one version so far besides the beta version. The main one is lwjgl-1.0-rc1.zip. You can also choose to download optional documentation and source zip files.
2. Unzip the file(s) to the location you choose.
3. Go to the upzipped folder. The lwjgl offer a command line testing command. It is from the lwjgl installation page:
Type in:
java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\lwjgl_fmod3.jar;jar\lwjgl_devil.jar;jar\jinput.jar; -Djava.library.path=native\win32 org.lwjgl.test.WindowCreationTest
You should see a window coming out. That means you have successfully installed the lwjgl.
Since they just released the library couple weeks ago, they don't have very good documentation and detailed installation procedure. Therefore, the following is from my personal experience to try out the solution. It may not be the best and correct way to do it, but it works on my computer.
4. Look into the folder you just unzipped. Find the file lwjgl.jar. Add this file to the environment variable. You may need to add other file(s) to the environment variable if you do other than the basic operation.
5. Write a simple program to test.
[edit] How accessed/used
The lwjgl is a set of Java libraries, which can make doing java to access openGL and openAL easily in order to make quality games.
In order to make you program to use openGL and openAL, you have to import some packages. For example,
import org.lwjgl.Sys; import org.lwjgl.input.Keyboard; import org.lwjgl.openal.AL; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11;
After programming, compile the file and issue the following command in the command line.
java -Djava.library.path=%your lwjgl unzipped folder%\native\win32 Test
%your lwjgl unzipped folder% is the folder location of the unzipped lwjgl folder.
-Djava.library.path is to tell where the DLL file is.
I will do a simple demo on how to do this.

