You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
|
2
(1) |
3
(2) |
4
|
|
5
(1) |
6
|
7
(11) |
8
(4) |
9
(2) |
10
(6) |
11
(14) |
|
12
(10) |
13
(13) |
14
(8) |
15
|
16
|
17
(2) |
18
|
|
19
|
20
|
21
|
22
|
23
|
24
|
25
|
|
26
|
27
(3) |
28
(1) |
29
|
30
|
31
|
|
|
From: Brian M. <ma...@us...> - 2004-12-07 23:07:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3664 Modified Files: display.cpp Log Message: case insensitive key lookup, reported by zhuzheng Index: display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/display.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- display.cpp 14 Nov 2004 10:42:19 -0000 1.8 +++ display.cpp 7 Dec 2004 23:07:03 -0000 1.9 @@ -359,7 +359,7 @@ // szAdapterKey now contains something like \Registry\Machine\System\CurrentControlSet\Control\Video\{B70DBD2A-90C4-41CF-A58E-F3BA69F1A6BC}\0000 // We'll check for the first chunk: - if (strncmp("\\Registry\\Machine", szAdapterKey, 17) == 0) { + if (strnicmp("\\Registry\\Machine", szAdapterKey, 17) == 0) { // Yes, it's right, so let's look for that key now TCHAR szDriverKey[MY_BUFSIZE]; |
|
From: Brian M. <ma...@us...> - 2004-12-07 22:01:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20502/src/java/org/lwjgl/test/openal Modified Files: PositionTest.java Log Message: using grabbed mode Index: PositionTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- PositionTest.java 22 Jul 2004 14:27:07 -0000 1.23 +++ PositionTest.java 7 Dec 2004 22:01:15 -0000 1.24 @@ -226,6 +226,8 @@ Sys.log("Soundfiles loaded successfully"); // ----------------------------------------------------- + + Mouse.setGrabbed(true); } /** @@ -406,6 +408,8 @@ AL10.alListener(AL10.AL_POSITION, listenerPosition); + // empty mouse buffer + while(Mouse.next()); } /** |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:56:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19041/src/java/org/lwjgl/test/input Modified Files: MouseTest.java Log Message: using grabbed mode Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- MouseTest.java 22 Sep 2004 18:03:10 -0000 1.41 +++ MouseTest.java 7 Dec 2004 21:56:07 -0000 1.42 @@ -116,6 +116,7 @@ Display.setFullscreen(FULLSCREEN); Display.setVSyncEnabled(true); Display.create(); + Mouse.setGrabbed(true); } catch (Exception e) { e.printStackTrace(); System.exit(-1); @@ -187,8 +188,6 @@ handleKeyboard(); handleMouse(); - System.out.println(Mouse.getX() + ", " + Mouse.getY()); - // pause and continue if minimized if(!Display.isVisible()) { if(Display.isDirty()) { |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:54:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18668/src/java/org/lwjgl/test/input Modified Files: MouseCreationTest.java Log Message: fixed displaymode using grabbed mouse mode empty mouse buffer Index: MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- MouseCreationTest.java 22 Jul 2004 14:56:40 -0000 1.33 +++ MouseCreationTest.java 7 Dec 2004 21:54:43 -0000 1.34 @@ -50,9 +50,6 @@ /** position of quad to draw */ private Vector2f position = new Vector2f(320.0f, 240.0f); - /** Display mode selected */ - private DisplayMode displayMode; - /** Creates a new instance of MouseTest */ public MouseCreationTest() { } @@ -62,6 +59,7 @@ setDisplayMode(); Display.setFullscreen(fullscreen); Display.create(); + Mouse.setGrabbed(true); } catch (Exception e) { e.printStackTrace(); System.exit(-1); @@ -118,7 +116,6 @@ try { Display.destroy(); initialize(true); - Display.setDisplayMode(displayMode); } catch (Exception e) { e.printStackTrace(); } @@ -144,10 +141,13 @@ long statustime = Sys.getTime(); long endtime = Sys.getTime() + Sys.getTimerResolution() * 5; - + while (Sys.getTime() < endtime) { Display.update(); + // empty mouse buffer + while(Mouse.next()); + position.x += Mouse.getDX(); position.y += Mouse.getDY(); |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:50:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17676/src/java/org/lwjgl/input Modified Files: Mouse.java Log Message: simple optimization Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- Mouse.java 25 Nov 2004 22:16:46 -0000 1.70 +++ Mouse.java 7 Dec 2004 21:50:30 -0000 1.71 @@ -136,6 +136,9 @@ private static final int EVENT_SIZE = 5; private static boolean isGrabbed; + + /** Whether we're running windows - which need to manually update cursor animation */ + private static final boolean isWindows = System.getProperty("os.name").startsWith("Win"); /** * Mouse cannot be constructed. @@ -585,7 +588,7 @@ * shouldn't be called otherwise */ public static void updateCursor() { - if (System.getProperty("os.name").startsWith("Win") && currentCursor != null && currentCursor.hasTimedOut()) { + if (isWindows && currentCursor != null && currentCursor.hasTimedOut()) { currentCursor.nextCursor(); try { setNativeCursor(currentCursor); |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:45:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16546/src/java/org/lwjgl/test/input Modified Files: HWCursorTest.java Log Message: cleanup and fixes Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- HWCursorTest.java 22 Sep 2004 18:03:10 -0000 1.37 +++ HWCursorTest.java 7 Dec 2004 21:44:57 -0000 1.38 @@ -52,357 +52,345 @@ * @version $Revision$ */ public class HWCursorTest { - - /** The native cursor */ - private static Cursor[] cursor = null; - - /** The mouse cursor position */ - private static int mouse_x; - private static int mouse_y; - private static int mouse_btn = 0; - - /** - * Executes the test - */ - public void execute() { - initialize(); - - mainLoop(); - - cleanup(); - } - - /** - * Sets the display mode for fullscreen mode - */ - protected boolean setDisplayMode() { - // get modes - DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60); - - try { - org.lwjgl.util.Display.setDisplayMode(dm, new String[] { - "width=" + 640, - "height=" + 480, - "freq=" + 60, - "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel() - }); - return true; - } catch (Exception e) { - e.printStackTrace(); - } - - return false; - } - - /** - * Initializes the test - */ - private void initialize() { - try { - // start of in windowed mode - setDisplayMode(); - Display.create(); - - glInit(); - - initNativeCursors(); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static void initNativeCursors() throws Exception { - if ((Mouse.getNativeCursorCaps() & Mouse.CURSOR_ONE_BIT_TRANSPARENCY) == 0) { - System.out.println("No HW cursor support!"); - System.exit(0); - } - - cursor = new Cursor[3]; - - int cursorImageCount = 1; - int cursorWidth = Mouse.getMaxCursorSize(); - int cursorHeight = cursorWidth; - IntBuffer cursorImages; - IntBuffer cursorDelays; - - - // Create a single cursor - // ================================== - cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - cursorDelays = null; - for(int j=0; j<cursorWidth; j++) { - for(int l=0; l<cursorHeight; l++) { - cursorImages.put(0xffffffff); - } - } - cursorImages.flip(); - cursor[0] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); - // ---------------------------------- - - // Create 3 piece animation - // ================================== - cursorImageCount = 3; - cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - for(int i=0; i<cursorImageCount; i++) { - - // make a colored square with a chocolate center - int offColor = 0x00000000; - int onColor = 0xffff0000; - - // change color according to cursor - if(i == 1) { - onColor = 0xff00ff00; - } else if (i == 2) { - onColor = 0xff0000ff; - } - - // calculate size of center - int centerSize = (cursorWidth / 5) * (i + 1); - int centerLeft = cursorWidth / 2 - centerSize / 2; - int centerRight = cursorWidth / 2 + centerSize / 2; - - // go! - for(int j=0; j<cursorWidth; j++) { - for(int l=0; l<cursorHeight; l++) { - if(j >= centerLeft && j < centerRight && l >= centerLeft && l < centerRight) { - cursorImages.put(offColor); - } else { - cursorImages.put(onColor); - } - } - } - } - cursorDelays.put(2000).put(2000).put(2000); - cursorDelays.flip(); - cursorImages.flip(); - - cursor[1] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); - // ---------------------------------- - - - // Create a 20 piece animation - // ================================== - cursorImageCount = 20; - cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - cursorDelays.put( - new int[] { - 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100 - }); - - float step = 0xffffffff / 20.0f; - for(int i=0; i<cursorImageCount; i++) { - for(int j=0; j<cursorWidth; j++) { - for(int l=0; l<cursorHeight; l++) { - cursorImages.put((int)step); - } - } - step += step; - } - cursorImages.flip(); - cursorDelays.flip(); - cursor[2] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); - // ---------------------------------- - - Mouse.setNativeCursor(cursor[0]); - } - - /** - * Runs the main loop of the "test" - */ - private void mainLoop() { - while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) - && !Display.isCloseRequested()) { - // allow subsystem to get a chance to run too - Display.update(); - - if (Display.isVisible()) { - // check keyboard input - processKeyboard(); - processMouse(); - - render(); - } else { - - // no need to render/paint if nothing has changed (ie. window dragged over) - if (Display.isDirty()) { - render(); - } - - // don't waste cpu time, sleep more - try { - Thread.sleep(100); - } catch (InterruptedException inte) { - } - } - } - } - - /** - * Performs the logic - */ - private void render() { - //clear background - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); - - // draw white quad - GL11.glPushMatrix(); - { - GL11.glTranslatef(mouse_x, mouse_y, 0); - GL11.glColor3f(1.0f, 1.0f, 1.0f); - GL11.glBegin(GL11.GL_QUADS); - { - GL11.glColor3f(1.0f, 0.0f, 0.0f); GL11.glVertex2i(-50, -50); - GL11.glColor3f(0.0f, 1.0f, 0.0f); GL11.glVertex2i(50, -50); - GL11.glColor3f(0.0f, 0.0f, 1.0f); GL11.glVertex2i(50, 50); - GL11.glColor3f(1.0f, 0.0f, 1.0f); GL11.glVertex2i(-50, 50); - } - GL11.glEnd(); - } - GL11.glPopMatrix(); - } - - private void processMouse() { - int dx = Mouse.getDX(); - int dy = Mouse.getDY(); - - if (dx != 0 || dy != 0) { - //mouse_x += dx; - //mouse_y += dy; - } - mouse_x = Mouse.getX(); - mouse_y = Mouse.getY(); - - while(Mouse.next()) { - int button = Mouse.getEventButton(); - if(button >= 0 && button < 3 && Mouse.getEventButtonState()) { - mouse_btn = Mouse.getEventButton(); - } - } - } - - /** - * Processes keyboard input - */ - private void processKeyboard() { - //check for fullscreen key - if (Keyboard.isKeyDown(Keyboard.KEY_F)) { - - try { - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - for(int i=0; i<cursor.length; i++) { - cursor[i].destroy(); - } - Display.setFullscreen(true); - - glInit(); - - initNativeCursors(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - //check for window key - if (Keyboard.isKeyDown(Keyboard.KEY_W)) { - try { - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - for(int i=0; i<cursor.length; i++) { - cursor[i].destroy(); - } - Display.setFullscreen(false); - glInit(); - - initNativeCursors(); - } catch (Exception e) { - e.printStackTrace(); - } - } - - if (Keyboard.isKeyDown(Keyboard.KEY_M)) { - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - } - } - - if (Keyboard.isKeyDown(Keyboard.KEY_N)) { - try { - Mouse.setNativeCursor(cursor[mouse_btn]); - } catch (Exception e) { - e.printStackTrace(); - } - } - - while(Keyboard.next()) { - if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) { - Mouse.setGrabbed(!Mouse.isGrabbed()); - //mouse_x = Mouse.getX(); - //mouse_y = Mouse.getY(); - } - } - } - - /** - * Cleans up the test - */ - private void cleanup() { - try { - Mouse.setNativeCursor(null); - } catch (Exception e) { - e.printStackTrace(); - System.exit(1); - } - for(int i=0; i<cursor.length; i++) { - cursor[i].destroy(); - } - Display.destroy(); - } - - /** - * Initializes OGL - */ - private void glInit() { - // Go into orthographic projection mode. - GL11.glMatrixMode(GL11.GL_PROJECTION); - GL11.glLoadIdentity(); - GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight()); - GL11.glMatrixMode(GL11.GL_MODELVIEW); - GL11.glLoadIdentity(); - GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight()); - - //set clear color to black - GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - - //sync frame (only works on windows) - Display.setVSyncEnabled(true); - } - - /** - * Test entry point - */ - public static void main(String[] args) { - System.out.println( - "Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M."); - System.out.println( - "Move quad using arrowkeys, and change rotation using +/-"); - HWCursorTest cursorTest = new HWCursorTest(); - cursorTest.execute(); - } + + /** The native cursor */ + private static Cursor[] cursor = null; + + /** The mouse cursor position */ + private static int mouse_x; + private static int mouse_y; + private static int mouse_btn = 0; + + /** + * Executes the test + */ + public void execute() { + initialize(); + + mainLoop(); + + cleanup(); + } + + /** + * Sets the display mode for fullscreen mode + */ + protected boolean setDisplayMode() { + // get modes + DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60); + + try { + org.lwjgl.util.Display.setDisplayMode(dm, new String[] { + "width=" + 640, + "height=" + 480, + "freq=" + 60, + "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel() + }); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + + return false; + } + + /** + * Initializes the test + */ + private void initialize() { + try { + // start of in windowed mode + setDisplayMode(); + Display.create(); + + glInit(); + + initNativeCursors(); + + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void initNativeCursors() throws Exception { + if ((Mouse.getNativeCursorCaps() & Mouse.CURSOR_ONE_BIT_TRANSPARENCY) == 0) { + System.out.println("No HW cursor support!"); + System.exit(0); + } + + cursor = new Cursor[3]; + + int cursorImageCount = 1; + int cursorWidth = Mouse.getMaxCursorSize(); + int cursorHeight = cursorWidth; + IntBuffer cursorImages; + IntBuffer cursorDelays; + + + // Create a single cursor + // ================================== + cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + cursorDelays = null; + for(int j=0; j<cursorWidth; j++) { + for(int l=0; l<cursorHeight; l++) { + cursorImages.put(0xffffffff); + } + } + cursorImages.flip(); + cursor[0] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); + // ---------------------------------- + + // Create 3 piece animation + // ================================== + cursorImageCount = 3; + cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + for(int i=0; i<cursorImageCount; i++) { + + // make a colored square with a chocolate center + int offColor = 0x00000000; + int onColor = 0xffff0000; + + // change color according to cursor + if(i == 1) { + onColor = 0xff00ff00; + } else if (i == 2) { + onColor = 0xff0000ff; + } + + // calculate size of center + int centerSize = (cursorWidth / 5) * (i + 1); + int centerLeft = cursorWidth / 2 - centerSize / 2; + int centerRight = cursorWidth / 2 + centerSize / 2; + + // go! + for(int j=0; j<cursorWidth; j++) { + for(int l=0; l<cursorHeight; l++) { + if(j >= centerLeft && j < centerRight && l >= centerLeft && l < centerRight) { + cursorImages.put(offColor); + } else { + cursorImages.put(onColor); + } + } + } + } + cursorDelays.put(2000).put(2000).put(2000); + cursorDelays.flip(); + cursorImages.flip(); + + cursor[1] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); + // ---------------------------------- + + + // Create a 20 piece animation + // ================================== + cursorImageCount = 20; + cursorImages = ByteBuffer.allocateDirect(cursorWidth*cursorHeight*cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + cursorDelays = ByteBuffer.allocateDirect(cursorImageCount*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + cursorDelays.put( + new int[] { + 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100, + 100, 100, 100, 100, 100 + }); + + float step = 0xffffffff / 20.0f; + for(int i=0; i<cursorImageCount; i++) { + for(int j=0; j<cursorWidth; j++) { + for(int l=0; l<cursorHeight; l++) { + cursorImages.put((int)step); + } + } + step += step; + } + cursorImages.flip(); + cursorDelays.flip(); + cursor[2] = new Cursor(Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize(), Mouse.getMaxCursorSize()/2, Mouse.getMaxCursorSize()/2, cursorImageCount, cursorImages, cursorDelays); + // ---------------------------------- + + Mouse.setNativeCursor(cursor[0]); + } + + /** + * Runs the main loop of the "test" + */ + private void mainLoop() { + while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) + && !Display.isCloseRequested()) { + // allow subsystem to get a chance to run too + Display.update(); + + if (Display.isVisible()) { + // check keyboard input + processKeyboard(); + processMouse(); + + render(); + } else { + + // no need to render/paint if nothing has changed (ie. window dragged over) + if (Display.isDirty()) { + render(); + } + + // don't waste cpu time, sleep more + try { + Thread.sleep(100); + } catch (InterruptedException inte) { + } + } + } + } + + /** + * Performs the logic + */ + private void render() { + //clear background + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + + // draw white quad + GL11.glPushMatrix(); + { + GL11.glTranslatef(mouse_x, mouse_y, 0); + GL11.glColor3f(1.0f, 1.0f, 1.0f); + GL11.glBegin(GL11.GL_QUADS); + { + GL11.glColor3f(1.0f, 0.0f, 0.0f); GL11.glVertex2i(-50, -50); + GL11.glColor3f(0.0f, 1.0f, 0.0f); GL11.glVertex2i(50, -50); + GL11.glColor3f(0.0f, 0.0f, 1.0f); GL11.glVertex2i(50, 50); + GL11.glColor3f(1.0f, 0.0f, 1.0f); GL11.glVertex2i(-50, 50); + } + GL11.glEnd(); + } + GL11.glPopMatrix(); + } + + private void processMouse() { + mouse_x = Mouse.getX(); + mouse_y = Mouse.getY(); + + while(Mouse.next()) { + int button = Mouse.getEventButton(); + if(button >= 0 && button < 3 && Mouse.getEventButtonState()) { + mouse_btn = Mouse.getEventButton(); + } + } + } + + /** + * Processes keyboard input + */ + private void processKeyboard() { + //check for fullscreen key + if (Keyboard.isKeyDown(Keyboard.KEY_F)) { + + try { + try { + Mouse.setNativeCursor(null); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + for(int i=0; i<cursor.length; i++) { + cursor[i].destroy(); + } + Display.setFullscreen(true); + + glInit(); + + initNativeCursors(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + //check for window key + if (Keyboard.isKeyDown(Keyboard.KEY_W)) { + try { + try { + Mouse.setNativeCursor(null); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + for(int i=0; i<cursor.length; i++) { + cursor[i].destroy(); + } + Display.setFullscreen(false); + glInit(); + + initNativeCursors(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (Keyboard.isKeyDown(Keyboard.KEY_M)) { + try { + Mouse.setNativeCursor(null); + } catch (Exception e) { + e.printStackTrace(); + } + } + + if (Keyboard.isKeyDown(Keyboard.KEY_N)) { + try { + Mouse.setNativeCursor(cursor[mouse_btn]); + } catch (Exception e) { + e.printStackTrace(); + } + } + + while(Keyboard.next()) { + if(Keyboard.getEventKey() == Keyboard.KEY_SPACE && Keyboard.getEventKeyState()) { + Mouse.setGrabbed(!Mouse.isGrabbed()); + } + } + } + + /** + * Cleans up the test + */ + private void cleanup() { + try { + Mouse.setNativeCursor(null); + } catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } + for(int i=0; i<cursor.length; i++) { + cursor[i].destroy(); + } + Display.destroy(); + } + + /** + * Initializes OGL + */ + private void glInit() { + // Go into orthographic projection mode. + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight()); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight()); + + //set clear color to black + GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + + //sync frame (only works on windows) + Display.setVSyncEnabled(true); + } + + /** + * Test entry point + */ + public static void main(String[] args) { + System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M."); + HWCursorTest cursorTest = new HWCursorTest(); + cursorTest.execute(); + } } |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:34:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14401/src/java/org/lwjgl/test/input Modified Files: ControllerCreationTest.java Log Message: fixed display mode bug Index: ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- ControllerCreationTest.java 7 Dec 2004 21:29:17 -0000 1.30 +++ ControllerCreationTest.java 7 Dec 2004 21:34:02 -0000 1.31 @@ -50,9 +50,6 @@ /** position of quad to draw */ private Vector2f position = new Vector2f(320.0f, 240.0f); - /** Display mode selected */ - private DisplayMode displayMode; - /** Creates a new instance of MouseTest */ public ControllerCreationTest() { } @@ -122,7 +119,6 @@ try { Display.destroy(); initialize(true); - Display.setDisplayMode(displayMode); } catch (Exception e) { e.printStackTrace(); } |
|
From: Brian M. <ma...@us...> - 2004-12-07 21:29:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13373/src/java/org/lwjgl/test/input Modified Files: ControllerCreationTest.java Log Message: check that controller is actually created! Index: ControllerCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/ControllerCreationTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- ControllerCreationTest.java 22 Jul 2004 14:56:40 -0000 1.29 +++ ControllerCreationTest.java 7 Dec 2004 21:29:17 -0000 1.30 @@ -62,7 +62,10 @@ setDisplayMode(); Display.setFullscreen(fullscreen); Display.create(); - + + if(!Controller.isCreated()) { + throw new Exception("Controller could not be created"); + } } catch (Exception e) { e.printStackTrace(); System.exit(-1); |
|
From: Brian M. <ma...@us...> - 2004-12-07 06:38:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14088/src/java/org/lwjgl/test/fmod3 Modified Files: StreamPlayerMemory.java Log Message: comment fixing Index: StreamPlayerMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/StreamPlayerMemory.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- StreamPlayerMemory.java 3 Oct 2004 09:35:38 -0000 1.3 +++ StreamPlayerMemory.java 7 Dec 2004 06:38:37 -0000 1.4 @@ -102,8 +102,7 @@ /** * Reads the file into a ByteBuffer * - * @param filename - * Name of file to load + * @param filename Name of file to load * @return ByteBuffer containing file data */ static protected ByteBuffer getData(String filename) { @@ -126,8 +125,8 @@ //done reading, close bis.close(); - - // if ogg vorbis data, we need to pass it unmodified to alBufferData + + // place it in a buffer buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-12-07 00:24:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3376/src/java/org/lwjgl/util Modified Files: Timer.java Log Message: Index: Timer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Timer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Timer.java 7 Dec 2004 00:23:20 -0000 1.7 +++ Timer.java 7 Dec 2004 00:24:29 -0000 1.8 @@ -82,14 +82,7 @@ */ public float getTime() { if (!paused) { - if (currentTime > startTime) { - lastTime = currentTime - startTime; - } else { - // The timer seems to have wrapped round. We don't know - // when it wrapped round, so the only thing we can reasonably - // do is reset the starttime and have a "glitch" - startTime = currentTime; - } + lastTime = currentTime - startTime; } return (float) ((double) lastTime / (double) resolution); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2004-12-07 00:23:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3059/src/java/org/lwjgl/util Modified Files: Timer.java Log Message: Shoved resolution down into ints for better wrap handling Index: Timer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/Timer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Timer.java 3 Dec 2004 00:56:14 -0000 1.6 +++ Timer.java 7 Dec 2004 00:23:20 -0000 1.7 @@ -54,13 +54,13 @@ private static int queryCount = 0; // Globally keeps track of time for all instances of Timer - private static long currentTime; + private static int currentTime; // When the timer was started - private long startTime; + private int startTime; // The last time recorded by getTime() - private long lastTime; + private int lastTime; // Whether the timer is paused private boolean paused; @@ -133,7 +133,7 @@ * @param newTime the new time, in seconds */ public void set(float newTime) { - long newTimeInTicks = (long) ((double) newTime * (double) resolution); + int newTimeInTicks = (int) ((double) newTime * (double) resolution); startTime = currentTime - newTimeInTicks; lastTime = newTimeInTicks; } @@ -144,7 +144,7 @@ * from it. */ public static void tick() { - currentTime = Sys.getTime(); + currentTime = (int) Sys.getTime(); // Periodically refresh the timer resolution: queryCount ++; |