Advertisement
Guest User

Untitled

a guest
Sep 19th, 2011
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. Downloading and Setting Up LWJGL
  2. What you need
  3. You'll need to first get the lwjgl package from the lwjgl download page. Its recommended you use a stable release as the nightly build may contain issues and be unstable. There are 4 packages you can choose to download but lwjgl-[version].zip is all you should need to get going. lwjgl-source-[version].zip, lwjgl-docs-[version].zip and lwjgl_applet-[version] are all optional packages and should be self explanatory as to what they are.
  4.  
  5. How to install LWJGL?
  6. This is a question may people ask, the answer to which is that you do not install lwjgl. It should not be put in any system/jre folder nor is there any method to install it on the system. LWJGL is a library and intended to be used as such, you must include it with your java application and simply point to it when the jvm is launched.
  7.  
  8. Setting up LWJGL
  9. LWJGL consists of two parts, a java part and a native code part. You must setup both of these parts properly in order for lwjgl to work. In order to setup the java part you must add lwjgl.jar to the classpath (as an external library jar). As for the native part (*.dll files on windows, *.so on linux, *.jnilib on mac, etc) you must tell java which folder the natives are located in for LWJGL to be able to find them (use the -Djava.library.path=path/to/dir vm parameter to do this).
  10.  
  11. I keep getting an java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
  12. This is because the native part is not setup correctly. Add a -Djava.library.path=path/to/dir to the commandline or as an VM option in your IDE so that lwjgl is able to find the folder containing the native files.
  13.  
  14. Testing LWJGL
  15. Go to where you extracted lwjgl-[version].zip. The information provided below was taken from doc/README:
  16. Windows
  17. Open a command prompt and navigate to the folder where the archive was extracted (i.e., by using the cd command). Then issue the following command (all in one line):
  18. java -cp .;res;jar\lwjgl.jar;jar\lwjgl_test.jar;jar\lwjgl_util.jar;jar\jinput.jar; -Djava.library.path=native\windows org.lwjgl.test.WindowCreationTest
  19. Mac OS X
  20. Open a terminal and navigate to the folder where the archive was extracted (i.e., by using the cd command). Then issue the following command (all in one line):
  21. java -cp .:res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar:jar/jinput.jar: -Djava.library.path=native/macosx org.lwjgl.test.WindowCreationTest
  22. Linux/BSD
  23. Open a terminal and navigate to the folder where the archive was extracted (i.e., by using the cd command). Then issue the following command (all in one line):
  24. java -cp .:res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar:jar/jinput.jar: -Djava.library.path=native/linux org.lwjgl.test.WindowCreationTest
  25. Solaris
  26. Open a terminal and navigate to the folder where the archive was extracted (i.e., by using the cd command). Then issue the following command (all in one line):
  27. java -cp .:res:jar/lwjgl.jar:jar/lwjgl_test.jar:jar/lwjgl_util.jar:jar/jinput.jar: -Djava.library.path=native/solaris org.lwjgl.test.WindowCreationTest
  28. A window should appear, and you should see the following output:
  29. Found <number> display modes
  30. 240, 320, WindowCreationTest
  31. Display created
  32. Moving to 100, 100
  33. Window created
  34. 600, 800, Game
  35. You can replace org.lwjgl.test.WindowCreationTest with one of the following:
  36. org.lwjgl.test.SysTest
  37. org.lwjgl.test.DisplayTest
  38.  
  39. org.lwjgl.test.input.MouseCreationTest
  40. org.lwjgl.test.input.MouseTest
  41. org.lwjgl.test.input.HWCursorTest
  42. org.lwjgl.test.input.KeyboardTest
  43. org.lwjgl.test.input.TestControllers
  44.  
  45. org.lwjgl.test.openal.ALCTest
  46. org.lwjgl.test.openal.OpenALCreationTest
  47. org.lwjgl.test.openal.MovingSoundTest
  48. org.lwjgl.test.openal.PlayTest
  49. org.lwjgl.test.openal.PlayTestMemory
  50. org.lwjgl.test.openal.SourceLimitTest
  51. org.lwjgl.test.openal.PositionTest
  52. org.lwjgl.test.openal.StressTest
  53. org.lwjgl.test.openal.SourceLimitTest
  54.  
  55. org.lwjgl.test.opengl.FullScreenWindowedTest
  56. org.lwjgl.test.opengl.PbufferTest
  57. org.lwjgl.test.opengl.VBOIndexTest
  58. org.lwjgl.test.opengl.VBOTest
  59.  
  60. org.lwjgl.test.opengl.pbuffers.PbufferTest
  61.  
  62. org.lwjgl.test.opengl.shaders.ShadersTest
  63.  
  64. org.lwjgl.examples.spaceinvaders.Game
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement