mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-04 22:17:59 +00:00
PLATFORM now specifiable from properties
AWTAdapter renamed to SwingAdapter Adapter renamed to PlatformAdapter
This commit is contained in:
parent
39140f1072
commit
27f67d1ffa
3 changed files with 29 additions and 15 deletions
|
|
@ -78,6 +78,9 @@ public final class Sys {
|
|||
|
||||
/** The native library name */
|
||||
private static String LIBRARY_NAME = "lwjgl";
|
||||
|
||||
/** The platform being executed on */
|
||||
private static String PLATFORM;
|
||||
|
||||
/**
|
||||
* Debug flag.
|
||||
|
|
@ -86,6 +89,12 @@ public final class Sys {
|
|||
|
||||
static {
|
||||
initialize();
|
||||
|
||||
// check platform name, and default to awt
|
||||
PLATFORM = System.getProperty("org.lwjgl.Sys.platform");
|
||||
if(PLATFORM == null) {
|
||||
PLATFORM = "org.lwjgl.SwingAdapter";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -208,10 +217,10 @@ public final class Sys {
|
|||
nAlert(title, message);
|
||||
} else {
|
||||
try {
|
||||
Adapter adapter = (Adapter) Class.forName("org.lwjgl.AWTAdapter").newInstance(); // This avoids a Jet error message
|
||||
PlatformAdapter adapter = (PlatformAdapter) Class.forName(PLATFORM).newInstance(); // This avoids a Jet error message
|
||||
adapter.alert(title, message);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(System.err);
|
||||
Sys.log("Unable to display alert using: " + PLATFORM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue