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
(3) |
2
|
3
(1) |
4
|
|
5
|
6
(5) |
7
(11) |
8
(7) |
9
|
10
(3) |
11
(12) |
|
12
|
13
(2) |
14
(7) |
15
(3) |
16
(3) |
17
|
18
|
|
19
|
20
(11) |
21
(5) |
22
(12) |
23
(10) |
24
(8) |
25
(4) |
|
26
(1) |
27
|
28
(13) |
29
(1) |
30
|
31
|
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 21:44:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv18444/src/java/org/lwjgl Modified Files: Sys.java Log Message: Index: Sys.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- Sys.java 28 Oct 2003 19:22:53 -0000 1.31 +++ Sys.java 28 Oct 2003 21:44:46 -0000 1.32 @@ -237,7 +237,7 @@ // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it // right anyway. - String[] browsers = {"mozilla", "opera", "konqueror", "galeon", "netscape", "lynx"}; + String[] browsers = {"mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"}; for (int i = 0; i < browsers.length; i ++) { try { |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:34:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv12231/src/java/org/lwjgl/test Added Files: OpenURLTest.java Log Message: Test new OpenURL code --- NEW FILE: OpenURLTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/OpenURLTest.java /* * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test; import org.lwjgl.Sys; /** * $Id: OpenURLTest.java,v 1.1 2003/10/28 19:30:34 cix_foo Exp $ * <br> * Open URLs test * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class OpenURLTest { public static void main(String[] args) { Sys.openURL("http://www.lwjgl.org"); } } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:31:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv11566/src/native/linux Modified Files: org_lwjgl_Sys.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_Sys.cpp 28 Oct 2003 16:23:17 -0000 1.17 +++ org_lwjgl_Sys.cpp 28 Oct 2003 19:26:51 -0000 1.18 @@ -180,7 +180,7 @@ * Method: openURL * Signature: (Ljava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv * env, jclass clazz, jstring url) { const char * urlString = env->GetStringUTFChars(url, NULL); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:30:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv11390/src/native/win32 Modified Files: org_lwjgl_Sys.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_Sys.cpp 28 Oct 2003 16:23:16 -0000 1.16 +++ org_lwjgl_Sys.cpp 28 Oct 2003 19:25:50 -0000 1.17 @@ -159,7 +159,7 @@ * Method: openURL * Signature: (Ljava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv * env, jclass clazz, jstring url) { const char * urlString = env->GetStringUTFChars(url, NULL); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:30:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv11390/src/native/macosx Modified Files: org_lwjgl_Sys.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Sys.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_Sys.cpp 28 Oct 2003 16:23:17 -0000 1.7 +++ org_lwjgl_Sys.cpp 28 Oct 2003 19:25:50 -0000 1.8 @@ -133,7 +133,7 @@ * Method: openURL * Signature: (Ljava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv * env, jclass clazz, jstring url) { const char * urlString = env->GetStringUTFChars(url, NULL); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:30:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv11390/src/native/common Modified Files: org_lwjgl_Sys.h Log Message: Index: org_lwjgl_Sys.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_Sys.h 28 Oct 2003 16:23:16 -0000 1.13 +++ org_lwjgl_Sys.h 28 Oct 2003 19:25:50 -0000 1.14 @@ -65,7 +65,7 @@ * Method: openURL * Signature: (Ljava/lang/String;)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_nOpenURL (JNIEnv *, jclass, jstring); #ifdef __cplusplus |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 19:24:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv10443/src/java/org/lwjgl Modified Files: Sys.java Log Message: Index: Sys.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- Sys.java 28 Oct 2003 16:23:17 -0000 1.30 +++ Sys.java 28 Oct 2003 19:22:53 -0000 1.31 @@ -32,6 +32,8 @@ package org.lwjgl; +import java.io.IOException; + import org.lwjgl.input.Controller; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; @@ -225,5 +227,32 @@ * best attempt at opening the URL given - don't rely on it to work! * @param url The URL */ - public static native void openURL(String url); + public static void openURL(String url) { + String osName = System.getProperty("os.name"); + if (osName.startsWith("Mac OS") || osName.startsWith("Windows")) { + // Mac and Windows both do this nicely from native code. + nOpenURL(url); + return; + } + // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it + // right anyway. + + String[] browsers = {"mozilla", "opera", "konqueror", "galeon", "netscape", "lynx"}; + + for (int i = 0; i < browsers.length; i ++) { + try { + Runtime.getRuntime().exec(new String[] { browsers[i], url }); + break; + } catch (IOException e) { + // Ignore + e.printStackTrace(System.err); + } + } + } + + + /* + * Where necessary, we use a native implementation of openURL. + */ + private static native void nOpenURL(String url); } |
|
From: Elias N. <eli...@us...> - 2003-10-28 19:13:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv8567/src/java/org/lwjgl/opengl Modified Files: GLCaps.java Log Message: GLCaps.determineAvailableExtensions is not public anymore Index: GLCaps.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLCaps.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLCaps.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- GLCaps.java 20 Oct 2003 14:36:05 -0000 1.11 +++ GLCaps.java 28 Oct 2003 19:12:54 -0000 1.12 @@ -188,7 +188,7 @@ * Determine which extensions are available. Use this to initialize capability fields. * Can only be called _after_ a GLWindow or Pbuffer has been created. */ - public static void determineAvailableExtensions(HashSet exts) { + static void determineAvailableExtensions(HashSet exts) { // Grab all the public static booleans out of this class Field[] fields = GLCaps.class.getDeclaredFields(); HashMap map = new HashMap(fields.length); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 16:23:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv12258/src/native/win32 Modified Files: org_lwjgl_Sys.cpp org_lwjgl_input_Mouse.cpp Log Message: New Sys.openURL command added Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_Sys.cpp 7 Aug 2003 21:51:51 -0000 1.15 +++ org_lwjgl_Sys.cpp 28 Oct 2003 16:23:16 -0000 1.16 @@ -153,3 +153,50 @@ return (jint) env->GetDirectBufferAddress(buf); } */ + +/* + * Class: org_lwjgl_Sys + * Method: openURL + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL + (JNIEnv * env, jclass clazz, jstring url) +{ + const char * urlString = env->GetStringUTFChars(url, NULL); + + char command[256]; + strcpy(command, ""); + strcat(command, "rundll32 url.dll,FileProtocolHandler "); + strncat(command, urlString, 200); // Prevent buffer overflow + env->ReleaseStringUTFChars(url, urlString); + + STARTUPINFO si; + PROCESS_INFORMATION pi; + + ZeroMemory( &si, sizeof(si) ); + si.cb = sizeof(si); + ZeroMemory( &pi, sizeof(pi) ); + + // Start the child process. + if( !CreateProcess( NULL, // No module name (use command line). + command, // Command line. + NULL, // Process handle not inheritable. + NULL, // Thread handle not inheritable. + FALSE, // Set handle inheritance to FALSE. + 0, // No creation flags. + NULL, // Use parent's environment block. + NULL, // Use parent's starting directory. + &si, // Pointer to STARTUPINFO structure. + &pi ) // Pointer to PROCESS_INFORMATION structure. + ) + { +#ifdef _DEBUG + printf("Failed to open URL %s\n", urlString); +#endif + } + + // Close process and thread handles. + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); + +} Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- org_lwjgl_input_Mouse.cpp 25 Oct 2003 21:27:54 -0000 1.37 +++ org_lwjgl_input_Mouse.cpp 28 Oct 2003 16:23:16 -0000 1.38 @@ -43,10 +43,10 @@ #include <windows.h> #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0300 -#include "Window.h" +#include "Window.h" #include "common_tools.h" -#include <dinput.h> - +#include <dinput.h> + static BYTE readBuffer[EVENT_BUFFER_SIZE]; static LPDIRECTINPUTDEVICE mDIDevice; // DI Device instance @@ -141,95 +141,95 @@ } } -JNIEXPORT jobject JNICALL Java_org_lwjgl_input_Mouse_nEnableBuffer(JNIEnv * env, jclass clazz) { - jobject newBuffer = env->NewDirectByteBuffer(&readBuffer, EVENT_BUFFER_SIZE); - return newBuffer; -} - -static unsigned char mapButton(DWORD button_id) { - switch (button_id) { - case DIMOFS_BUTTON0: return 0; - case DIMOFS_BUTTON1: return 1; - case DIMOFS_BUTTON2: return 2; - case DIMOFS_BUTTON3: return 3; -/* case DIMOFS_BUTTON4: return 4; - case DIMOFS_BUTTON5: return 5; - case DIMOFS_BUTTON6: return 6; - case DIMOFS_BUTTON7: return 7;*/ - default: return mButtoncount; - } -} - -static int bufferButtons(int count, DIDEVICEOBJECTDATA *di_buffer) { - int buffer_index = 0; - for (int i = 0; i < count; i++) { - unsigned char button = mapButton(di_buffer[i].dwOfs); - if (button >= 0 && button < mButtoncount) { - unsigned char state = (unsigned char)di_buffer[i].dwData & 0x80; - if (state != 0) - state = 1; - readBuffer[buffer_index++] = button; - readBuffer[buffer_index++] = state; - if (buffer_index == EVENT_BUFFER_SIZE) - break; - } - } - return buffer_index/2; -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nRead - (JNIEnv * env, jclass clazz) -{ - - static DIDEVICEOBJECTDATA rgdod[EVENT_BUFFER_SIZE]; - DWORD bufsize = EVENT_BUFFER_SIZE; - - HRESULT ret; - - ret = mDIDevice->Acquire(); - if (ret != DI_OK && ret != S_FALSE) - return 0; - - ret = mDIDevice->GetDeviceData( - sizeof(DIDEVICEOBJECTDATA), - rgdod, - &bufsize, - 0); - - if (ret == DI_OK) { - return bufferButtons(bufsize, rgdod); - } else if (ret == DI_BUFFEROVERFLOW) { -#ifdef _DEBUG - printf("Buffer overflowed\n"); -#endif - } else if (ret == DIERR_INPUTLOST) { -#ifdef _DEBUG - printf("Input lost\n"); -#endif - } else if (ret == DIERR_NOTACQUIRED) { -#ifdef _DEBUG - printf("not acquired\n"); -#endif - } else if (ret == DIERR_INVALIDPARAM) { -#ifdef _DEBUG - printf("invalid parameter\n"); -#endif - } else if (ret == DIERR_NOTBUFFERED) { -#ifdef _DEBUG - printf("not buffered\n"); -#endif - } else if (ret == DIERR_NOTINITIALIZED) { -#ifdef _DEBUG - printf("not inited\n"); -#endif - } else { -#ifdef _DEBUG - printf("unknown keyboard error\n"); -#endif - } - return 0; -} - +JNIEXPORT jobject JNICALL Java_org_lwjgl_input_Mouse_nEnableBuffer(JNIEnv * env, jclass clazz) { + jobject newBuffer = env->NewDirectByteBuffer(&readBuffer, EVENT_BUFFER_SIZE); + return newBuffer; +} + +static unsigned char mapButton(DWORD button_id) { + switch (button_id) { + case DIMOFS_BUTTON0: return 0; + case DIMOFS_BUTTON1: return 1; + case DIMOFS_BUTTON2: return 2; + case DIMOFS_BUTTON3: return 3; +/* case DIMOFS_BUTTON4: return 4; + case DIMOFS_BUTTON5: return 5; + case DIMOFS_BUTTON6: return 6; + case DIMOFS_BUTTON7: return 7;*/ + default: return mButtoncount; + } +} + +static int bufferButtons(int count, DIDEVICEOBJECTDATA *di_buffer) { + int buffer_index = 0; + for (int i = 0; i < count; i++) { + unsigned char button = mapButton(di_buffer[i].dwOfs); + if (button >= 0 && button < mButtoncount) { + unsigned char state = (unsigned char)di_buffer[i].dwData & 0x80; + if (state != 0) + state = 1; + readBuffer[buffer_index++] = button; + readBuffer[buffer_index++] = state; + if (buffer_index == EVENT_BUFFER_SIZE) + break; + } + } + return buffer_index/2; +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nRead + (JNIEnv * env, jclass clazz) +{ + + static DIDEVICEOBJECTDATA rgdod[EVENT_BUFFER_SIZE]; + DWORD bufsize = EVENT_BUFFER_SIZE; + + HRESULT ret; + + ret = mDIDevice->Acquire(); + if (ret != DI_OK && ret != S_FALSE) + return 0; + + ret = mDIDevice->GetDeviceData( + sizeof(DIDEVICEOBJECTDATA), + rgdod, + &bufsize, + 0); + + if (ret == DI_OK) { + return bufferButtons(bufsize, rgdod); + } else if (ret == DI_BUFFEROVERFLOW) { +#ifdef _DEBUG + printf("Buffer overflowed\n"); +#endif + } else if (ret == DIERR_INPUTLOST) { +#ifdef _DEBUG + printf("Input lost\n"); +#endif + } else if (ret == DIERR_NOTACQUIRED) { +#ifdef _DEBUG + printf("not acquired\n"); +#endif + } else if (ret == DIERR_INVALIDPARAM) { +#ifdef _DEBUG + printf("invalid parameter\n"); +#endif + } else if (ret == DIERR_NOTBUFFERED) { +#ifdef _DEBUG + printf("not buffered\n"); +#endif + } else if (ret == DIERR_NOTINITIALIZED) { +#ifdef _DEBUG + printf("not inited\n"); +#endif + } else { +#ifdef _DEBUG + printf("unknown keyboard error\n"); +#endif + } + return 0; +} + /* * Class: org_lwjgl_input_Mouse * Method: nIsNativeCursorSupported @@ -265,8 +265,8 @@ RECT clientRect; GetWindowRect(hwnd, &windowRect); getScreenClientRect(&clientRect, &windowRect); - cursorPos.x = (clientRect.left + clientRect.right)/2; - cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; + cursorPos.x = (clientRect.left + clientRect.right)/2; + cursorPos.y = clientRect.bottom - 1 - (clientRect.bottom - clientRect.top)/2; SetCursorPos(cursorPos.x, cursorPos.y); ShowCursor(TRUE); usingNativeCursor = true; @@ -413,15 +413,15 @@ mCreate_success = false; return; } - - DIPROPDWORD dipropdw; - dipropdw.diph.dwSize = sizeof(DIPROPDWORD); - dipropdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipropdw.diph.dwObj = 0; - dipropdw.diph.dwHow = DIPH_DEVICE; - dipropdw.dwData = EVENT_BUFFER_SIZE; - mDIDevice->SetProperty(DIPROP_BUFFERSIZE, &dipropdw.diph); - + + DIPROPDWORD dipropdw; + dipropdw.diph.dwSize = sizeof(DIPROPDWORD); + dipropdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipropdw.diph.dwObj = 0; + dipropdw.diph.dwHow = DIPH_DEVICE; + dipropdw.dwData = EVENT_BUFFER_SIZE; + mDIDevice->SetProperty(DIPROP_BUFFERSIZE, &dipropdw.diph); + // set the cooperative level if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { #if _DEBUG @@ -431,15 +431,15 @@ return; } mCreate_success = true; -} - -static int cap(int val, int min, int max) { - if (val < min) - return min; - else if (val > max) - return max; - else - return val; +} + +static int cap(int val, int min, int max) { + if (val < min) + return min; + else if (val > max) + return max; + else + return val; } static void getGDICursorDelta(int* return_dx, int* return_dy) { @@ -454,10 +454,10 @@ cursorPos.x += newWindowRect.left - windowRect.left; cursorPos.y += newWindowRect.top - windowRect.top; windowRect = newWindowRect; - getScreenClientRect(&clientRect, &windowRect); - // Clip the position to the client rect + getScreenClientRect(&clientRect, &windowRect); + // Clip the position to the client rect newCursorPos.x = cap(newCursorPos.x, clientRect.left, clientRect.right - 1); - newCursorPos.y = cap(newCursorPos.y, clientRect.top, clientRect.bottom - 1); + newCursorPos.y = cap(newCursorPos.y, clientRect.top, clientRect.bottom - 1); dx = newCursorPos.x - cursorPos.x; dy = newCursorPos.y - cursorPos.y; cursorPos.x += dx; @@ -500,7 +500,7 @@ } else { dx = diMouseState.lX; dy = diMouseState.lY; - } + } dy = -dy; env->SetStaticIntField(clsMouse, fidMDX, (jint)dx); @@ -515,7 +515,7 @@ } } jbyteArray mButtonsArray = (jbyteArray) env->GetStaticObjectField(clsMouse, fidMButtons); - env->SetByteArrayRegion(mButtonsArray, 0, mButtoncount, diMouseState.rgbButtons); + env->SetByteArrayRegion(mButtonsArray, 0, mButtoncount, (const signed char *) diMouseState.rgbButtons); } /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 16:23:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv12258/src/native/common Modified Files: org_lwjgl_Sys.h Log Message: New Sys.openURL command added Index: org_lwjgl_Sys.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_Sys.h 7 Aug 2003 21:51:24 -0000 1.12 +++ org_lwjgl_Sys.h 28 Oct 2003 16:23:16 -0000 1.13 @@ -62,11 +62,11 @@ /* * Class: org_lwjgl_Sys - * Method: getDirectBufferAddress - * Signature: (Ljava/nio/Buffer;)I -JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress - (JNIEnv *, jclass, jobject); + * Method: openURL + * Signature: (Ljava/lang/String;)V */ +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL + (JNIEnv *, jclass, jstring); #ifdef __cplusplus } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 16:23:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv12258/src/native/linux Modified Files: org_lwjgl_Sys.cpp Log Message: New Sys.openURL command added Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_Sys.cpp 11 Aug 2003 17:33:41 -0000 1.16 +++ org_lwjgl_Sys.cpp 28 Oct 2003 16:23:17 -0000 1.17 @@ -1,35 +1,35 @@ -/* +/* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * - * * Neither the name of 'Light Weight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived + * * Neither the name of 'Light Weight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - + /** * $Id$ * @@ -65,7 +65,7 @@ #ifdef _DEBUG printf("Could not read current time\n"); #endif - } + } long result = tv.tv_sec * 1000000l + tv.tv_usec; return result; @@ -109,7 +109,7 @@ int linux_priority; int max_pri, min_pri; struct sched_param sched_pri; - + if (sched_getscheduler(0) != SCHED_OTHER) { // Reset scheduler to normal sched_pri.sched_priority = 0; @@ -120,7 +120,7 @@ return; } } - + switch (priority) { case org_lwjgl_Sys_REALTIME_PRIORITY: min_pri = sched_get_priority_min(SCHED_FIFO); @@ -174,3 +174,16 @@ env->ReleaseStringUTFChars(message, eMessageText); env->ReleaseStringUTFChars(title, cTitleBarText); } + +/* + * Class: org_lwjgl_Sys + * Method: openURL + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL + (JNIEnv * env, jclass clazz, jstring url) +{ + const char * urlString = env->GetStringUTFChars(url, NULL); + printf("*** Please visit %s\n", urlString); + env->ReleaseStringUTFChars(url, urlString); +} \ No newline at end of file |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 16:23:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv12258/src/native/macosx Modified Files: org_lwjgl_Sys.cpp Log Message: New Sys.openURL command added Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Sys.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_Sys.cpp 8 Sep 2003 16:40:52 -0000 1.6 +++ org_lwjgl_Sys.cpp 28 Oct 2003 16:23:17 -0000 1.7 @@ -42,6 +42,7 @@ #include <sched.h> #include <sys/time.h> #include <sys/resource.h> +#include <Carbon/Carbon.h> #include "org_lwjgl_Sys.h" long int hires_timer_freq; // Hires timer frequency @@ -106,7 +107,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority (JNIEnv * env, jclass clazz, jint priority) { - printf("Unsupported"); +#ifdef _DEBUG + printf("Unsupported\n"); +#endif } /* @@ -124,3 +127,31 @@ env->ReleaseStringUTFChars(message, eMessageText); env->ReleaseStringUTFChars(title, cTitleBarText); } + +/* + * Class: org_lwjgl_Sys + * Method: openURL + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_openURL + (JNIEnv * env, jclass clazz, jstring url) +{ + const char * urlString = env->GetStringUTFChars(url, NULL); + + OSStatus err; + ICInstance inst; + long startSel; + long endSel; + Str255 urlStr; + + CopyCStringToPascal(urlString, urlStr); + env->ReleaseStringUTFChars(url, urlString); + + err = ICStart(&inst, '????'); // Use your creator code if you have one! + if (err == noErr) { + startSel = 0; + endSel = urlStr[0]; + err = ICLaunchURL(inst, "\p", (char *) &urlStr[1], urlStr[0], &startSel, &endSel); + (void) ICStop(inst); + } +} \ No newline at end of file |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-10-28 16:23:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv12258/src/java/org/lwjgl Modified Files: Sys.java Log Message: New Sys.openURL command added Index: Sys.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- Sys.java 17 Aug 2003 16:14:36 -0000 1.29 +++ Sys.java 28 Oct 2003 16:23:17 -0000 1.30 @@ -213,4 +213,17 @@ * public static native int getDirectBufferAddress(Buffer buf); */ + + /** + * Open the system web browser and point it at the specified URL. It is recommended + * that this not be called whilst your game is running, but on application exit in + * a shutdown hook, as the screen resolution will not be reset when the browser is + * brought into view. + * + * There is no guarantee that this will work, nor that we can detect if it has + * failed - hence we don't return success code or throw an Exception. This is just a + * best attempt at opening the URL given - don't rely on it to work! + * @param url The URL + */ + public static native void openURL(String url); } |