|
From: Elias N. <eli...@us...> - 2003-06-24 12:24:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv25896/src/java/org/lwjgl/input Modified Files: Cursor.java Keyboard.java Mouse.java Log Message: Ported OpenGL to Buffers Index: Cursor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Cursor.java 7 Jun 2003 11:53:17 -0000 1.5 +++ Cursor.java 24 Jun 2003 12:24:54 -0000 1.6 @@ -34,6 +34,8 @@ import org.lwjgl.Sys; +import java.nio.IntBuffer; + /** * $Id$ * @@ -66,13 +68,13 @@ * @param xHotspot the x coordinate of the cursor hotspot * @param yHotspot the y coordinate of the cursor hotspot * @param numImages number of cursor images specified. Must be 1 if animations are not supported. - * @param cursorAddress the address of an int array containing the cursor image - * @param delayAddresses the address of animation frame delays, if numImages is greater than 1, else Sys.NULL + * @param images A buffer containing the images + * @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null * @throws Exception if the cursor could not be created for any reason */ - public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, int imageAddress, int delayAddresses) throws Exception { + public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws Exception { assert Mouse.isCreated(); - nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, imageAddress, delayAddresses); + nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images, delays); } /** @@ -92,7 +94,7 @@ /** * Native method to create a native cursor */ - private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, int imageAddresses, int delayAddresses); + private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays); /** * Native method to destroy a native cursor 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.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Keyboard.java 7 Jun 2003 12:47:08 -0000 1.22 +++ Keyboard.java 24 Jun 2003 12:24:54 -0000 1.23 @@ -214,9 +214,6 @@ /** The keys status from the last poll */ private static final ByteBuffer keyDownBuffer = ByteBuffer.allocateDirect(256); - /** Address of the keyDown buffer */ - private static final int keyDownAddress = Sys.getDirectBufferAddress(keyDownBuffer); - /** * The key events from the last read: a sequence of pairs of key number, * followed by state. If translation is enabled, the state is followed by @@ -310,7 +307,7 @@ */ public static void poll() { assert created : "The keyboard has not been created."; - nPoll(keyDownAddress); + nPoll(keyDownBuffer); } /** @@ -319,7 +316,7 @@ * @param keyDownBufferAddress the address of a 256-byte buffer to place * key states in. */ - private static native void nPoll(int keyDownBufferAddress); + private static native void nPoll(ByteBuffer keyDownBuffer); /** * Reads the keyboard buffer. @@ -427,4 +424,4 @@ } else return false; } -} \ No newline at end of file +} 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.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Mouse.java 20 May 2003 12:20:11 -0000 1.20 +++ Mouse.java 24 Jun 2003 12:24:54 -0000 1.21 @@ -133,7 +133,7 @@ if (currentCursor != null) { nSetNativeCursor(currentCursor.getHandle()); } else { - nSetNativeCursor(Sys.NULL); + nSetNativeCursor(0); } return oldCursor; } |