[SOLVED] LWJGL 2 fails to initialize with Intel HD Graphics

I downloaded JME v3.6.1-stable-sdk3_assetbrowser_alpha and getting IllegalMonitorStateException whenever i try to run the JMETest or BasicGame package.


My laptop has Windows 8.1 with Intel HD Graphics Card and Open GL 2.1.

Reference:

Could you create a new GRADLE game template with the SDK 3.6.1 you have now. This game template will by default be created using jME 3.6.1. Then what I would like you to do is to go to the build.gradle and try different jME versions. This is to track if this is a regression in jME. Also LWJGL version plays a huge role in this. That can also be changed from the build.gradle by swapping the jme3-lwjgl (LWJGL 2) package to jme3-lwjgl3 (LWJGL 3).

The we can get a list like so:
LWJGL 2:
jME 3.6
jME 3.5
jME 3.4

LWJGL 3:
jME 3.6
jME 3.5
jME 3.4

1 Like

Also please copy paste the whole stacktrace as a text to there.

I created one bug from this, this doesn’t help the issue at hand though…

1 Like

You are right! I managed to realize that jME v3.5.1 was working after creating my project as GradleGame with the SDK 3.6.1. Thanks!


1 Like

Okay

You might be able to use jME 3.6 also if you manually set the renderer setting to (“Renderer”, LWJGL_OPENGL2);. In jME 3.6 the default was bumped to 3.2. I’m not sure how compatible the rest of the jME is if you set the OpenGL level back.

But as always, you should try to get the latest drivers for your graphics card.

2 Likes

Sounds like i should get myself a new laptop because all my system drivers including graphics card are up-to-date :sweat_smile:

Please can you explain how to do this?

2 Likes

I tried the following syntax in my program but it didn’t work:

public static void main(String args) {
Main app = new Main();
app.start();
AppSettings appSettings = app.settings;
appSettings.setRenderer(AppSettings.LWJGL_OPENGL2);
}

How about setting the settings before start:

public static void main(String args) {
  Main app = new Main();
  AppSettings appSettings = app.settings;
  appSettings.setRenderer(AppSettings.LWJGL_OPENGL2);
  app.start();
}
1 Like

And try to avoid accessing the ugly magic protected variable directly and call setSettings() instead. (Especially since .settings might be null.)

public static void main(String args) {
  Main app = new Main();
  AppSettings appSettings = new AppSettings(true);
  appSettings.setRenderer(AppSettings.LWJGL_OPENGL2);
  app.setSettings(appSettings);
  app.start();
}

Related documentation: jME3 Application Display Settings :: jMonkeyEngine Docs

4 Likes

Any attempt to modify app.settings before calling app.start(); causes NullPointerException to be thrown

AWESOME! IT WORKED! :smiley:
Thanks! The jME v3.6.1 is now working.

This is a great and flexible engine. I hope they plan to fix and return back this constant AppSettings.LWJGL_OPENGL_ANY because it no longer exists but was still documented in AppSettings.setRenderer(String).

1 Like

Well, most likely the settings was null like pspeed said. That would cause NPE. You should be able to modify the settings before start. The truth is in the stacktrace as always.

If there is a mismatch in some javadoc or anywhere really. Feel free to report it as an issue on jME Github so it might get fixed.

2 Likes