LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Nychold on December 27, 2003, 09:50:07

Title: Having trouble getting LWJGL set up
Post by: Nychold on December 27, 2003, 09:50:07
I'm not sure what the problem is, but I'm trying to compile ANYTHING which uses LWJGL.  The NeHe tutorials come closest, with no compile errors if I comment out the following lines:


GLCaps.determineAvailableExtensions();
if(GLCaps.WGL_EXT_swap_control) {
 GL.wglSwapIntervalEXT(1);
}


but crash out on runtime:


java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1403)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:832)
at org.lwjgl.Sys.initialize(Unknown Source)
at org.lwjgl.Sys.<clinit>(Unknown Source)
at org.lwjgl.opengl.Window.<clinit>(Unknown Source)
at Nehe02.<clinit>(Nehe02.java:49)
Exception in thread "main"


while the "spinning cube" example generates pages of syntax errors.

I'm using Borland JBuilder 9.0 for my IDE/Compiler/Runtime Environment, so that might be causing some problems, but I serious doubt that.  I'm more convinced that I'm doing something wrong, or that version 0.8 of LWJGL has deprecated some of the things which have not yet been fixed in the tutorials.  Is there anyone who's had this problem, something similar, or might know what's going on?  Thanks!
Title: Having trouble getting LWJGL set up
Post by: Nychold on December 27, 2003, 10:13:29
Forgot to mention, this is running on Windows XP Professional.  :lol:
Title: Having trouble getting LWJGL set up
Post by: Matzon on December 27, 2003, 10:44:24
QuoteGLCaps.determineAvailableExtensions();
if(GLCaps.WGL_EXT_swap_control) {
 GL.wglSwapIntervalEXT(1);
}
- Extensions are now determined automatically, so no need to call it.
- GL.wglSwapIntervalEXT(1); is a call for vscan sync, use Window.setVSyncEnabled(true);

The 'java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path ' bug is *really* simple :), it's because the java runtime cannot fine the lwjgl.dll. I don't know JBuilder, but you need to add the path of the dll to the library path. On the java cmdline, you'd do this:
java -Djava.library.path=path\to\dll
Title: Having trouble getting LWJGL set up
Post by: bloritsch on January 07, 2004, 18:05:05
Quote from: "Matzon"
QuoteGLCaps.determineAvailableExtensions();
if(GLCaps.WGL_EXT_swap_control) {
 GL.wglSwapIntervalEXT(1);
}
- Extensions are now determined automatically, so no need to call it.
- GL.wglSwapIntervalEXT(1); is a call for vscan sync, use Window.setVSyncEnabled(true);

I just tried this, and discovered that the method signature for determineAvailableExtensions() is changed.  It should be:


//sync to monitor
GLCaps.determineAvailableExtensions(new HashSet());
if(GLCaps.WGL_EXT_swap_control) {
 Window.setVSyncEnabled(true);
}
Title: Having trouble getting LWJGL set up
Post by: elias on January 07, 2004, 19:41:46
No, a

Window.setVSyncEnabled(true);

will do. The other two calls are superfluous.

- elias
Title: Having trouble getting LWJGL set up
Post by: princec on January 08, 2004, 10:16:38
Hm that's not right either.
determineAvailableExtensions should not be visible outside the package, and WGL_EXT_swap_control shouldn't be visible either in GLCaps (as we no longer support the methods in the extension). Maybe this is right or wrong in CVS. (@work, can't look right now)

Cas :)
Title: Having trouble getting LWJGL set up
Post by: Matzon on January 08, 2004, 10:43:37
hmm
public abstract class GLCaps
public static boolean WGL_EXT_swap_control;

however

static void determineAvailableExtensions(HashSet exts)

shouldn't be visible...

oh, and Cas:
http://cvs.sourceforge.net/viewcvs.py/java-game-lib/

:)