1

I'm following tutorials on the lwjgl wiki but when I run the program in the first tutorial nothing happens at all (no window appears).

Here is my code for the program:

public Test()
{}

public void start() {
    try {
        Display.setDisplayMode(new DisplayMode(800,600));
        Display.setTitle("Test");
        Display.create();
    } catch (LWJGLException e) {
        e.printStackTrace();
        System.exit(0);
    }
    // init OpenGL here
    while (!Display.isCloseRequested()) {
        // render OpenGL here
        Display.update();
    }
    Display.destroy();
}

public static void main(String[] argv) {
    Test displayExample = new Test();
    displayExample.start();
}

Any ideas why nothing happens when I run this? The IDE I am using is eclipse and I set up the build path as the tutorial showed.

Thanks

UltraViolent
  • 99
  • 1
  • 2
  • 9
  • Hard to say, can you provide more details on "nothing happens"? Does it simply exit or just sit there idle with no screen updates and you have to kill the proces? Do you get an error message in the logs? – Jere Jun 29 '12 at 15:00
  • Ah yeah when I said nothing happens I mean no errors, no window pops up, I dont have to end the program either it seems to terminate on it's own. – UltraViolent Jun 29 '12 at 15:58
  • Also, when I put a simple print statement in the main function, or anywhere in the program, nothing shows up on the console. – UltraViolent Jun 29 '12 at 16:18
  • Where did you put the print statement in your code? First line of the 'main', inside the 'start' method? I assume you're launching from inside Eclipse, so output should be captured by it. – Jere Jun 29 '12 at 17:29
  • Ah it seems to be running now. But I get an error message: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path – UltraViolent Jun 30 '12 at 12:36

2 Answers2

0

The applications works fine on my configuration of the LWJGL.

Click here for a text tutorial on setting up your LWJGL workspace.

Click here for a video tutorial on setting up your LWJGL workspace.

James Webster
  • 31,873
  • 11
  • 70
  • 114
Oskar
  • 1,321
  • 9
  • 19
  • You might want to be careful with the self promotion. Of course you're trying to be helpful, but some might regard it as spamming if you do it too often. – Bart Jun 29 '12 at 22:29
0

If you didnt add lwjgl jars to the class path and then tell the lwjgl jar where to get the natives, it wont work. Though it is odd that there wasnt an error thrown before. It shouldnt simply close. For eclipse, you go into build path and right click on lwjgl.jar and say edit natives or something like that. Then find or type path to the natives for lwjgl ie .dll or .so etc...

Another problem may be this : "public class Test {}" there was nothing in it!!! Though it may be a typig problem when you posted

sandspro
  • 72
  • 1
  • 7