* InputManager will throw exception if joysticks are disabled instead of returning null
* Allow use of negative program IDs in LwjglRenderer (will continue instead of crashing for "Invalid ID received from driver" errors) git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9116 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
3a84693f68
commit
db4188c797
@ -651,6 +651,9 @@ public class InputManager implements RawInputListener {
|
|||||||
* @return an array of all joysticks installed on the system.
|
* @return an array of all joysticks installed on the system.
|
||||||
*/
|
*/
|
||||||
public Joystick[] getJoysticks() {
|
public Joystick[] getJoysticks() {
|
||||||
|
if (joyInput == null){
|
||||||
|
throw new InvalidStateException("Joystick Input is disabled");
|
||||||
|
}
|
||||||
return joysticks;
|
return joysticks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1027,7 +1027,7 @@ public class LwjglRenderer implements Renderer {
|
|||||||
if (id == -1) {
|
if (id == -1) {
|
||||||
// create program
|
// create program
|
||||||
id = glCreateProgram();
|
id = glCreateProgram();
|
||||||
if (id <= 0) {
|
if (id == 0) {
|
||||||
throw new RendererException("Invalid ID (" + id + ") received when trying to create shader program.");
|
throw new RendererException("Invalid ID (" + id + ") received when trying to create shader program.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user