Having trouble getting LWJGL set up

Started by Nychold, December 27, 2003, 09:50:07

Previous topic - Next topic

Nychold

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!

Nychold

Forgot to mention, this is running on Windows XP Professional.  :lol:

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);

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

bloritsch

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);
}

elias

No, a

Window.setVSyncEnabled(true);

will do. The other two calls are superfluous.

- elias

princec

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 :)

Matzon

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/

:)