mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-02-25 09:04:44 +01:00
Sys.java: Don't use reflection to create platform specific implementations
This commit is contained in:
parent
4a1b565c74
commit
7742185e34
|
|
@ -111,27 +111,14 @@ public final class Sys {
|
|||
String class_name;
|
||||
switch (LWJGLUtil.getPlatform()) {
|
||||
case LWJGLUtil.PLATFORM_LINUX:
|
||||
class_name = "org.lwjgl.LinuxSysImplementation";
|
||||
break;
|
||||
return new LinuxSysImplementation();
|
||||
case LWJGLUtil.PLATFORM_WINDOWS:
|
||||
class_name = "org.lwjgl.WindowsSysImplementation";
|
||||
break;
|
||||
return new org.lwjgl.WindowsSysImplementation();
|
||||
case LWJGLUtil.PLATFORM_MACOSX:
|
||||
class_name = "org.lwjgl.MacOSXSysImplementation";
|
||||
break;
|
||||
return new org.lwjgl.MacOSXSysImplementation();
|
||||
default:
|
||||
throw new IllegalStateException("Unsupported platform");
|
||||
}
|
||||
try {
|
||||
Class impl_class = Class.forName(class_name);
|
||||
return (SysImplementation)impl_class.newInstance();
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (IllegalAccessException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (InstantiationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue