OSDN Git Service

[changed] added Cylabs suggestion to handle jawt.dll loading with a property as well.
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 3 Dec 2010 12:20:05 +0000 (12:20 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Fri, 3 Dec 2010 12:20:05 +0000 (12:20 +0000)
backends/gdx-backend-jogl/src/com/badlogic/gdx/backends/jogl/JoglNativesLoader.java

index 2faea0d..a359187 100644 (file)
@@ -23,7 +23,7 @@ import com.sun.opengl.impl.NativeLibLoader;
 \r
 public class JoglNativesLoader {\r
        static boolean nativesLoaded = false;\r
-       \r
+\r
        /**\r
         * loads the necessary libraries depending on the operating system\r
         */\r
@@ -35,8 +35,17 @@ public class JoglNativesLoader {
                com.sun.gluegen.runtime.NativeLibLoader.disableLoading();\r
                // By wkien: On some systems (read: mine) jogl_awt would not find its\r
                // dependency jawt if not loaded before\r
-               if(System.getProperty("os.name").contains("Windows"))\r
-                       System.loadLibrary("jawt");\r
+               if (System.getProperty("os.name", "").contains("Windows")\r
+                               && !System.getProperty("libgdx.nojawtpreloading", "false")\r
+                                               .contains("true")) {\r
+                       try {\r
+                               System.loadLibrary("jawt");\r
+                       } catch (Exception ex) {\r
+                               System.err\r
+                                               .println("WARNING: Unable to load native jawt library: '"\r
+                                                               + ex.getMessage() + "'");\r
+                       }\r
+               }\r
                loadLibrary("gluegen-rt");\r
                loadLibrary("jogl_awt");\r
                loadLibrary("jogl");\r