Added four boolean properties to alter default behaviour in non-standard apps
This commit is contained in:
parent
70e36d8058
commit
7c4412fcf3
|
@ -421,42 +421,44 @@ public final class Window {
|
|||
GL11.glViewport(0, 0, width, height);
|
||||
|
||||
// Automatically create mouse, keyboard and controller
|
||||
if (!Mouse.isCreated()) {
|
||||
try {
|
||||
Mouse.create();
|
||||
createdMouse = true;
|
||||
Mouse.enableBuffer();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Mouse: "+e);
|
||||
if (!Boolean.getBoolean("org.lwjgl.opengl.Window.noinput")) {
|
||||
if (!Mouse.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nomouse")) {
|
||||
try {
|
||||
Mouse.create();
|
||||
createdMouse = true;
|
||||
Mouse.enableBuffer();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Mouse: "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Keyboard.isCreated()) {
|
||||
try {
|
||||
Keyboard.create();
|
||||
createdKeyboard = true;
|
||||
Keyboard.enableBuffer();
|
||||
Keyboard.enableTranslation();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Keyboard: "+e);
|
||||
if (!Keyboard.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nokeyboard")) {
|
||||
try {
|
||||
Keyboard.create();
|
||||
createdKeyboard = true;
|
||||
Keyboard.enableBuffer();
|
||||
Keyboard.enableTranslation();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Keyboard: "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!Controller.isCreated()) {
|
||||
try {
|
||||
Controller.create();
|
||||
createdController = true;
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Controller: "+e);
|
||||
if (!Controller.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Window.nocontroller")) {
|
||||
try {
|
||||
Controller.create();
|
||||
createdController = true;
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Controller: "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -545,4 +547,6 @@ public final class Window {
|
|||
}
|
||||
|
||||
private static native void nSetVSyncEnabled(boolean sync);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue