-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop project created by setup still uses lwjgl 2 causing problems for some xrandr configurations #4774
Comments
Lwjgl3 isn't ready for use in stand in quite yet, the |
Is lwjgl3 ready now? Just ran into this Edit: was able to get it working by changing
to
and updating DesktopLauncher.java |
Where do you edit this line? I am getting the following. Exception in thread "LWJGL Application" java.lang.NoClassDefFoundError: Could not initialize class org.lwjgl.Sys |
diff --git a/build.gradle b/build.gradle
index 908b5b7..096b460 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,7 +44,7 @@ project(":desktop") {
dependencies {
implementation project(":core")
- api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
+ api "com.badlogicgames.gdx:gdx-backend-lwjgl3:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
} Just change it in the dependencies of the ":desktop" project. Afterwards, you have to adjust the classes for the Desktop specific code: diff --git a/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java b/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java
index fd6833f..c0071b5 100644
--- a/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java
+++ b/desktop/src/com/mygdx/game/desktop/DesktopLauncher.java
@@ -1,12 +1,12 @@
package com.mygdx.game.desktop;
-import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
-import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
+import com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application;
+import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
import com.mygdx.game.MyGdxGame;
public class DesktopLauncher {
public static void main (String[] arg) {
- LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
- new LwjglApplication(new MyGdxGame(), config);
+ Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
+ new Lwjgl3Application(new MyGdxGame(), config);
}
} (Just use :%s/Lwjgl/Lwjgl3/g and :%s/lwjgl/lwjgl3/g or whatever search&replace function in your editor.) |
Issue details
Generating a new project with gdx-setup does not create a project that runs because of old lwjgl dependency. Symptoms for this may be error messages like:
The reason seems to be bad parsing of
xrandr
output in lwjgl 2.9 which is better in lwjgl 3.0.Reproduction steps/code
Sidenote: We figured that the parsing of the output of
xrandr
by lwjgl 2.9 failed because of an output (shortened here) like:The display modes with underscore seem to be the problem.
Version of LibGDX and/or relevant dependencies
Stacktrace
Please select the affected platforms
One possible solution
gdx-backend-lwjgl
togdx-backend-lwjgl3
inlibgdx/extensions/gdx-setup/src/com/badlogic/gdx/setup/DependencyBank.java
Line 85 in 9e4c560
The text was updated successfully, but these errors were encountered: