|
From: Elias N. <eli...@us...> - 2003-09-30 10:52:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv26555/src/java/org/lwjgl/input Modified Files: Controller.java Keyboard.java Mouse.java Log Message: boolean results -> Exceptions Index: Controller.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Controller.java 16 Sep 2003 15:39:46 -0000 1.8 +++ Controller.java 30 Sep 2003 10:52:05 -0000 1.9 @@ -171,9 +171,7 @@ return; } - if (!nCreate()) { - throw new Exception("The controller could not be created."); - } + nCreate(); created = true; } @@ -248,10 +246,8 @@ /** * Native method to create the controller - * - * @return true if the controller was created */ - private static native boolean nCreate(); + private static native void nCreate() throws Exception; /** * Native method the destroy the controller Index: Keyboard.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Keyboard.java 10 Sep 2003 22:39:26 -0000 1.29 +++ Keyboard.java 30 Sep 2003 10:52:05 -0000 1.30 @@ -286,17 +286,14 @@ initialize(); if (created) return; - if (!nCreate()) - throw new Exception("The keyboard could not be created."); + nCreate(); created = true; } /** * Native method to create the keyboard - * - * @return true if the keyboard was created */ - private static native boolean nCreate(); + private static native void nCreate() throws Exception; /** * @return true if the keyboard has been created @@ -359,27 +356,26 @@ /** * Enable keyboard translation. Must be called after the keyboard is created, * and keyboard buffering must be enabled. - * @return false if translation cannot be enabled; true if it can */ - public static boolean enableTranslation() { + public static void enableTranslation() throws Exception { assert created : "The keyboard has not been created."; assert readBuffer != null : "Keyboard buffering has not been enabled."; - translationEnabled = nEnableTranslation(); - return translationEnabled; + nEnableTranslation(); + translationEnabled = true; } /** * Native method to enable the translation buffer */ - private static native boolean nEnableTranslation(); + private static native void nEnableTranslation() throws Exception; /** * Enable keyboard buffering. Must be called after the keyboard is created. * @return the size of the keyboard buffer in events, or 0 if no buffering * can be enabled for any reason */ - public static int enableBuffer() { + public static int enableBuffer() throws Exception { assert created : "The keyboard has not been created."; int buf_len = nEnableBuffer(); if (readBuffer != null) @@ -392,7 +388,7 @@ * @return the size of the buffer allocated, in events (1 event is 2 bytes), * or 0 if no buffer can be allocated */ - private static native int nEnableBuffer(); + private static native int nEnableBuffer() throws Exception; /** * Checks to see if a key is down. Index: Mouse.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Mouse.java 16 Sep 2003 15:39:46 -0000 1.25 +++ Mouse.java 30 Sep 2003 10:52:05 -0000 1.26 @@ -146,7 +146,7 @@ } /** Native method to set the native cursor */ - private static native void nSetNativeCursor(int handle); + private static native void nSetNativeCursor(int handle) throws Exception; /** * Gets the minimum size of a native cursor. Can only be called if @@ -210,9 +210,7 @@ if (created) { return; } - if (!nCreate()) { - throw new Exception("The mouse could not be created."); - } + nCreate(); created = true; currentCursor = null; @@ -225,7 +223,7 @@ * * @return true if the mouse was created */ - private static native boolean nCreate(); + private static native void nCreate(); /** * @return true if the mouse has been created |