|
From: Elias N. <eli...@us...> - 2004-03-27 14:00:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24895/src/java/org/lwjgl/input Modified Files: Controller.java Cursor.java Keyboard.java Mouse.java Log Message: All classes use Sys.initialize now Index: Controller.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controller.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Controller.java 27 Mar 2004 11:55:06 -0000 1.13 +++ Controller.java 27 Mar 2004 13:48:57 -0000 1.14 @@ -146,7 +146,9 @@ * Static initialization */ private static void initialize() { - System.loadLibrary(Sys.getLibraryName()); + if (initialized) + return; + Sys.initialize(); initIDs(); // Assign names to all the buttons @@ -166,9 +168,7 @@ public static void create() throws Exception { if (!Window.isCreated()) throw new IllegalStateException("Window must be created before you can create Controller"); - if (!initialized) { - initialize(); - } + initialize(); if (created) { return; Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Cursor.java 27 Mar 2004 11:55:06 -0000 1.17 +++ Cursor.java 27 Mar 2004 13:48:57 -0000 1.18 @@ -49,10 +49,6 @@ */ public class Cursor { - - /** Lazy initialization */ - private static boolean initialized = false; - /** First element to display */ private CursorElement[] cursors = null; @@ -86,10 +82,7 @@ if (yHotspot >= height || yHotspot < 0) throw new IllegalArgumentException("yHotspot > height || yHotspot < 0"); - // initialize - if (!initialized) { - initialize(); - } + Sys.initialize(); // Hmm yHotspot = height - 1 - yHotspot; @@ -99,14 +92,6 @@ } /** - * Initializes the cursor class - */ - private static void initialize() { - System.loadLibrary(Sys.getLibraryName()); - initialized = true; - } - - /** * Creates the actual cursor, using a platform specific class */ private void createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws Exception { Index: Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- Keyboard.java 27 Mar 2004 11:55:06 -0000 1.41 +++ Keyboard.java 27 Mar 2004 13:48:57 -0000 1.42 @@ -268,7 +268,9 @@ * Static initialization */ private static void initialize() { - System.loadLibrary(Sys.getLibraryName()); + if (initialized) + return; + Sys.initialize(); initIDs(); initialized = true; } Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- Mouse.java 27 Mar 2004 11:55:06 -0000 1.43 +++ Mouse.java 27 Mar 2004 13:48:57 -0000 1.44 @@ -217,7 +217,7 @@ * Static initialization */ private static void initialize() { - System.loadLibrary(Sys.getLibraryName()); + Sys.initialize(); initIDs(); // Assign names to all the buttons @@ -245,9 +245,7 @@ if (!Window.isCreated()) throw new IllegalStateException("Window must be created prior to creating mouse"); - if (!initialized) { - initialize(); - } + initialize(); if (created) { return; } |