Browse Source

jme-lwjgl3: config GLFW using AppSettings and org.lwjgl.system.Platform

Stephen Gold 3 years ago
parent
commit
2b7c37469e
1 changed files with 8 additions and 0 deletions
  1. 8 0
      jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java

+ 8 - 0
jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglWindow.java

@@ -64,6 +64,8 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Level;
 import java.util.logging.Logger;
+import org.lwjgl.system.Configuration;
+import org.lwjgl.system.Platform;
 
 import static org.lwjgl.glfw.GLFW.*;
 import static org.lwjgl.opengl.GL11.GL_FALSE;
@@ -576,6 +578,12 @@ public abstract class LwjglWindow extends LwjglContext implements Runnable {
                 });
             }
 
+            String libraryName = settings.getString("GlfwLibraryName");
+            if (libraryName == null) { // use the (platform-dependent) default
+                libraryName = (Platform.get() == Platform.MACOSX) ? "glfw_async" : "glfw";
+            }
+            Configuration.GLFW_LIBRARY_NAME.set(libraryName);
+
             timer = new NanoTimer();
 
             // For canvas, this will create a PBuffer,