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: Elias N. <eli...@us...> - 2003-10-29 16:21:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv32202/common Modified Files: common_tools.cpp common_tools.h Log Message: Fixed nasty buffer overflow bug in event_queue_t Index: common_tools.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/common_tools.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- common_tools.cpp 22 Oct 2003 10:57:18 -0000 1.3 +++ common_tools.cpp 29 Oct 2003 16:21:42 -0000 1.4 @@ -39,6 +39,10 @@ #include "common_tools.h" +static void incListStart(event_queue_t *queue) { + queue->list_start = (queue->list_start + 1)%EVENT_BUFFER_SIZE; +} + void initEventQueue(event_queue_t *event_queue) { event_queue->list_start = 0; event_queue->list_end = 0; @@ -64,7 +68,7 @@ int output_index = event_index*event_size; for (int i = 0; i < event_size; i++) { queue->output_event_buffer[output_index] = queue->input_event_buffer[queue->list_start]; - queue->list_start = (queue->list_start + 1)%EVENT_BUFFER_SIZE; + incListStart(queue); output_index++; } } Index: common_tools.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- common_tools.h 22 Oct 2003 10:57:18 -0000 1.2 +++ common_tools.h 29 Oct 2003 16:21:42 -0000 1.3 @@ -42,7 +42,8 @@ #include <jni.h> -#define EVENT_BUFFER_SIZE 100 +// Must be x * max_event_size + 1 +#define EVENT_BUFFER_SIZE (25 * 4 + 1) typedef struct { unsigned char input_event_buffer[EVENT_BUFFER_SIZE]; |
|
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); } |
|
From: Elias N. <eli...@us...> - 2003-10-26 09:47:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv17211/macosx Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Added created to mac Mouse.cpp Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- org_lwjgl_input_Mouse.cpp 25 Oct 2003 21:27:54 -0000 1.20 +++ org_lwjgl_input_Mouse.cpp 26 Oct 2003 08:44:19 -0000 1.21 @@ -66,6 +66,7 @@ static int last_dx; static int last_dy; static int last_dz; +static bool created; static void handleButton(unsigned char button_index, jbyte state) { if (button_index >= NUM_BUTTONS) { @@ -232,31 +233,24 @@ }*/ CGAssociateMouseAndMouseCursorPosition(FALSE); CGDisplayHideCursor(CGMainDisplayID()); + created = true; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv * env, jclass clazz) { //shutdownDevice(&hid_dev); -// if (!native_cursor) { + if (created) { + created = false; CGDisplayShowCursor(CGMainDisplayID()); CGAssociateMouseAndMouseCursorPosition(TRUE); -// } + } } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz) { int dx, dy, dz; //pollMouseDevice(); dz = last_dz*WHEEL_SCALE; - //if (!native_cursor) { - dx = last_dx; - dy = -last_dy; - /*} else { - Point cursor_pos; - GetMouse(&cursor_pos); - dx = cursor_pos.v - last_x; - dy = cursor_pos.h - last_y; - last_x += dx; - last_y += dy; - }*/ + dx = last_dx; + dy = -last_dy; env->SetStaticIntField(clazz, fid_dx, (jint)dx); env->SetStaticIntField(clazz, fid_dy, (jint)dy); env->SetStaticIntField(clazz, fid_dwheel, (jint)dz); |
|
From: Elias N. <eli...@us...> - 2003-10-25 21:38:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv26531/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Fixed Mac OS X mouse button mapping 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.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- org_lwjgl_input_Mouse.cpp 14 Oct 2003 12:42:05 -0000 1.36 +++ org_lwjgl_input_Mouse.cpp 25 Oct 2003 21:27:54 -0000 1.37 @@ -514,8 +514,8 @@ diMouseState.rgbButtons[i] = JNI_FALSE; } } - jbooleanArray mButtonsArray = (jbooleanArray) env->GetStaticObjectField(clsMouse, fidMButtons); - env->SetBooleanArrayRegion(mButtonsArray, 0, mButtoncount, diMouseState.rgbButtons); + jbyteArray mButtonsArray = (jbyteArray) env->GetStaticObjectField(clsMouse, fidMButtons); + env->SetByteArrayRegion(mButtonsArray, 0, mButtoncount, diMouseState.rgbButtons); } /** |
|
From: Elias N. <eli...@us...> - 2003-10-25 21:33:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv26531/macosx Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Fixed Mac OS X mouse button mapping Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- org_lwjgl_input_Mouse.cpp 24 Oct 2003 11:46:31 -0000 1.19 +++ org_lwjgl_input_Mouse.cpp 25 Oct 2003 21:27:54 -0000 1.20 @@ -55,7 +55,7 @@ static jfieldID fid_dwheel; static jfieldID fid_buttons; -static unsigned char button_states[NUM_BUTTONS]; +static jbyte button_states[NUM_BUTTONS]; static bool buffer_enabled; /*static int x_axis_index = NUM_BUTTONS; static int y_axis_index = NUM_BUTTONS + 1; @@ -67,7 +67,13 @@ static int last_dy; static int last_dz; -static void handleButton(unsigned char button_index, unsigned char state) { +static void handleButton(unsigned char button_index, jbyte state) { + if (button_index >= NUM_BUTTONS) { +#ifdef _DEBUG + printf("Button index %d out of range [0..%d]\n", button_index, NUM_BUTTONS); +#endif + return; + } button_states[button_index] = state; if (buffer_enabled) { putEventElement(&event_queue, button_index); @@ -122,7 +128,7 @@ #endif return; } - handleButton(button, state); + handleButton(button - 1, state); } static void handleMovedEvent(EventRef event) { @@ -159,6 +165,7 @@ case kEventMouseUp: handleButtonEvent(event, 0); break; + case kEventMouseDragged: case kEventMouseMoved: handleMovedEvent(event); break; @@ -253,8 +260,8 @@ env->SetStaticIntField(clazz, fid_dx, (jint)dx); env->SetStaticIntField(clazz, fid_dy, (jint)dy); env->SetStaticIntField(clazz, fid_dwheel, (jint)dz); - jbooleanArray buttons_array = (jbooleanArray)env->GetStaticObjectField(clazz, fid_buttons); - env->SetBooleanArrayRegion(buttons_array, 0, NUM_BUTTONS, button_states); + jbyteArray buttons_array = (jbyteArray)env->GetStaticObjectField(clazz, fid_buttons); + env->SetByteArrayRegion(buttons_array, 0, NUM_BUTTONS, button_states); resetDeltas(); } |
|
From: Elias N. <eli...@us...> - 2003-10-25 19:06:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv22445/macosx Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- org_lwjgl_opengl_Window.cpp 24 Oct 2003 11:45:55 -0000 1.27 +++ org_lwjgl_opengl_Window.cpp 24 Oct 2003 11:51:07 -0000 1.28 @@ -51,7 +51,7 @@ static bool current_fullscreen; static void destroyMode(JNIEnv *env, jclass clazz) { - if (current_fullscreen); + if (!current_fullscreen); resetMode(env); } @@ -131,6 +131,7 @@ throwException(env, "Could not load gl function pointers"); return; } + FlushEventQueue(GetMainEventQueue()); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nSetTitle(JNIEnv * env, jclass clazz, jstring title_obj) { |
|
From: Elias N. <eli...@us...> - 2003-10-25 00:11:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv23979/macosx Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- org_lwjgl_opengl_Window.cpp 24 Oct 2003 11:51:07 -0000 1.28 +++ org_lwjgl_opengl_Window.cpp 24 Oct 2003 11:59:18 -0000 1.29 @@ -94,7 +94,6 @@ } CGLSetFullScreen(context); CGLSetCurrentContext(context); - FlushEventQueue(GetMainEventQueue()); return true; } |
|
From: Elias N. <eli...@us...> - 2003-10-24 15:28:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv16402/common Modified Files: extal.cpp Log Message: Index: extal.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- extal.cpp 22 Oct 2003 10:57:18 -0000 1.11 +++ extal.cpp 23 Oct 2003 18:21:56 -0000 1.12 @@ -196,7 +196,7 @@ jsize pathcount = env->GetArrayLength(oalPaths); #ifdef _DEBUG - printf("Found %d OpenAL paths\n", pathcount); + printf("Found %d OpenAL paths\n", (int)pathcount); #endif for(int i=0;i<pathcount;i++) { jstring path = (jstring) env->GetObjectArrayElement(oalPaths, i); |
|
From: Elias N. <eli...@us...> - 2003-10-24 11:49:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv21637/macosx Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Switched mouse handling to Carbin events Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_input_Mouse.cpp 24 Oct 2003 11:45:55 -0000 1.18 +++ org_lwjgl_input_Mouse.cpp 24 Oct 2003 11:46:31 -0000 1.19 @@ -147,7 +147,6 @@ #endif return; } -printf("wheel delta %d\n", (int)delta); last_dz += (int)delta; } |
|
From: Elias N. <eli...@us...> - 2003-10-24 11:48:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv21564/macosx Modified Files: Window.h org_lwjgl_Display.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Window.cpp Log Message: Switched mouse handling to Carbin events Index: Window.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/Window.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Window.h 24 Oct 2003 05:51:50 -0000 1.9 +++ Window.h 24 Oct 2003 11:45:55 -0000 1.10 @@ -47,5 +47,6 @@ extern void resetMode(JNIEnv *env); extern bool switchMode(JNIEnv *env, long width, long height, long bpp, long freq); extern void handleKeyboardEvent(EventRef event); + extern void handleMouseEvent(EventRef event); #endif /* _LWJGL_WINDOW_H_INCLUDED_ */ Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- org_lwjgl_Display.cpp 24 Oct 2003 05:51:50 -0000 1.24 +++ org_lwjgl_Display.cpp 24 Oct 2003 11:45:55 -0000 1.25 @@ -79,23 +79,12 @@ } } -static void captureDisplay(void) { - if (!display_captured) { - display_captured = true; - CGDisplayCapture(kCGDirectMainDisplay); - } -} - -static void releaseDisplay(void) { - if (display_captured) { - display_captured = false; - CGDisplayRelease(kCGDirectMainDisplay); - } -} - bool switchMode(JNIEnv *env, long width, long height, long bpp, long freq) { init(env); - captureDisplay(); + if (display_captured) + return false; + display_captured = true; + CGDisplayCapture(kCGDirectMainDisplay); CFArrayRef modes = CGDisplayAvailableModes(kCGDirectMainDisplay); int size = CFArrayGetCount(modes); for (int i = 0; i < size; i++) { @@ -121,9 +110,12 @@ void resetMode(JNIEnv *env) { init(env); + if (!display_captured) + return; + display_captured = false; CGDisplayRestoreColorSyncSettings(); CGDisplaySwitchToMode(kCGDirectMainDisplay, original_mode); - releaseDisplay(); + CGDisplayRelease(kCGDirectMainDisplay); saveOriginalMode(env); } Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_input_Mouse.cpp 23 Oct 2003 18:21:56 -0000 1.17 +++ org_lwjgl_input_Mouse.cpp 24 Oct 2003 11:45:55 -0000 1.18 @@ -56,12 +56,11 @@ static jfieldID fid_buttons; static unsigned char button_states[NUM_BUTTONS]; -static bool created; static bool buffer_enabled; -static int x_axis_index = NUM_BUTTONS; +/*static int x_axis_index = NUM_BUTTONS; static int y_axis_index = NUM_BUTTONS + 1; static int z_axis_index = NUM_BUTTONS + 2; -static hid_device_t hid_dev; +static hid_device_t hid_dev;*/ static event_queue_t event_queue; static int last_dx; @@ -76,7 +75,7 @@ } } -static void pollMouseDevice() { +/*static void pollMouseDevice() { hid_event_t event; cont: while (nextDeviceEvent(&hid_dev, &event)) { @@ -107,13 +106,71 @@ #endif } } - +*/ static void resetDeltas(void) { last_dx = 0; last_dy = 0; last_dz = 0; } +static void handleButtonEvent(EventRef event, unsigned char state) { + EventMouseButton button; + OSStatus err = GetEventParameter(event, kEventParamMouseButton, typeMouseButton, NULL, sizeof(button), NULL, &button); + if (err != noErr) { +#ifdef _DEBUG + printf("Could not get button parameter from event\n"); +#endif + return; + } + handleButton(button, state); +} + +static void handleMovedEvent(EventRef event) { + HIPoint delta; + OSStatus err = GetEventParameter(event, kEventParamMouseDelta, typeHIPoint, NULL, sizeof(delta), NULL, &delta); + if (err != noErr) { +#ifdef _DEBUG + printf("Could not delta parameter from event\n"); +#endif + return; + } + last_dx += (int)delta.x; + last_dy += (int)delta.y; +} + +static void handleWheelEvent(EventRef event) { + long delta; + OSStatus err = GetEventParameter(event, kEventParamMouseWheelDelta, typeLongInteger, NULL, sizeof(delta), NULL, &delta); + if (err != noErr) { +#ifdef _DEBUG + printf("Could not delta parameter from event\n"); +#endif + return; + } +printf("wheel delta %d\n", (int)delta); + last_dz += (int)delta; +} + +void handleMouseEvent(EventRef event) { + UInt32 event_kind = GetEventKind(event); + switch (event_kind) { + case kEventMouseDown: + handleButtonEvent(event, 1); + break; + case kEventMouseUp: + handleButtonEvent(event, 0); + break; + case kEventMouseMoved: + handleMovedEvent(event); + break; + case kEventMouseWheelMoved: + handleWheelEvent(event); + break; + default: + break; + } +} + JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasWheel(JNIEnv *, jclass) { return JNI_TRUE; } @@ -152,7 +209,7 @@ button_states[i] = 0; } initEventQueue(&event_queue); - hid_cookie_t hid_cookies[NUM_COOKIES]; +/* hid_cookie_t hid_cookies[NUM_COOKIES]; for (int i = 0; i < NUM_BUTTONS; i++) { hid_cookies[i].usage_page = kHIDPage_Button; hid_cookies[i].usage = i + 1; @@ -166,24 +223,22 @@ if (!findDevice(&hid_dev, kHIDPage_GenericDesktop, kHIDUsage_GD_Mouse, NUM_COOKIES, hid_cookies, EVENT_BUFFER_SIZE)) { throwException(env, "Could not find HID mouse device"); return; - } + }*/ CGAssociateMouseAndMouseCursorPosition(FALSE); CGDisplayHideCursor(CGMainDisplayID()); - created = true; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv * env, jclass clazz) { - shutdownDevice(&hid_dev); + //shutdownDevice(&hid_dev); // if (!native_cursor) { - CGAssociateMouseAndMouseCursorPosition(TRUE); CGDisplayShowCursor(CGMainDisplayID()); + CGAssociateMouseAndMouseCursorPosition(TRUE); // } - created = false; } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll(JNIEnv * env, jclass clazz) { int dx, dy, dz; - pollMouseDevice(); + //pollMouseDevice(); dz = last_dz*WHEEL_SCALE; //if (!native_cursor) { dx = last_dx; @@ -211,6 +266,5 @@ } JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nRead(JNIEnv *env, jclass clazz) { - pollMouseDevice(); return copyEvents(&event_queue, 2); } Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- org_lwjgl_opengl_Window.cpp 24 Oct 2003 05:51:50 -0000 1.26 +++ org_lwjgl_opengl_Window.cpp 24 Oct 2003 11:45:55 -0000 1.27 @@ -94,6 +94,7 @@ } CGLSetFullScreen(context); CGLSetCurrentContext(context); + FlushEventQueue(GetMainEventQueue()); return true; } @@ -140,8 +141,16 @@ OSStatus err = ReceiveNextEvent(0, NULL, 0, true, &event); if (err == noErr) { UInt32 event_class = GetEventClass(event); - if (event_class == kEventClassKeyboard) - handleKeyboardEvent(event); + switch (event_class) { + case kEventClassKeyboard: + handleKeyboardEvent(event); + break; + case kEventClassMouse: + handleMouseEvent(event); + break; + default: + break; + } } } |
|
From: Brian M. <ma...@us...> - 2003-10-24 08:37:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1:/tmp/cvs-serv4144 Modified Files: MouseCreationTest.java Log Message: move mouse in right direction on y axis Index: MouseCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- MouseCreationTest.java 17 Aug 2003 18:40:58 -0000 1.19 +++ MouseCreationTest.java 23 Oct 2003 17:17:18 -0000 1.20 @@ -167,7 +167,7 @@ Mouse.poll(); position.x += Mouse.dx; - position.y -= Mouse.dy; + position.y += Mouse.dy; if(position.x<0) { position.x = 0; |
|
From: Elias N. <eli...@us...> - 2003-10-24 06:59:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1:/tmp/cvs-serv16514/src/native Modified Files: configure.in Log Message: Index: configure.in CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/configure.in =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/configure.in,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- configure.in 21 Oct 2003 15:11:58 -0000 1.47 +++ configure.in 22 Oct 2003 10:57:18 -0000 1.48 @@ -30,7 +30,7 @@ case "$host_os" in darwin*) _BUILD_FLAGS="-D_AGL -fpascal-strings" - LDFLAGS="-Xlinker -framework -Xlinker JavaVM -Xlinker -framework -Xlinker ApplicationServices -Xlinker -framework -Xlinker CoreServices" + LDFLAGS="-Xlinker -framework -Xlinker JavaVM -Xlinker -framework -Xlinker ApplicationServices -Xlinker -framework -Xlinker CoreServices -Xlinker -framework -Xlinker Carbon" NATIVE_BUILD_DIR=macosx CXXFLAGS="$CXXFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS" CFLAGS="$CFLAGS $DEBUG_FLAGS -Wall $_BUILD_FLAGS" |
|
From: Elias N. <eli...@us...> - 2003-10-24 05:58:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv31990/macosx Modified Files: Window.h org_lwjgl_Display.cpp org_lwjgl_opengl_Window.cpp Log Message: Index: Window.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/Window.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Window.h 22 Oct 2003 10:57:18 -0000 1.8 +++ Window.h 24 Oct 2003 05:51:50 -0000 1.9 @@ -44,9 +44,8 @@ #include <jni.h> #include <Carbon/Carbon.h> - extern void setQuitRequested(void); extern void resetMode(JNIEnv *env); - extern void switchMode(JNIEnv *env, long width, long height, long bpp, long freq); + extern bool switchMode(JNIEnv *env, long width, long height, long bpp, long freq); extern void handleKeyboardEvent(EventRef event); #endif /* _LWJGL_WINDOW_H_INCLUDED_ */ Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- org_lwjgl_Display.cpp 22 Oct 2003 18:34:42 -0000 1.23 +++ org_lwjgl_Display.cpp 24 Oct 2003 05:51:50 -0000 1.24 @@ -93,12 +93,30 @@ } } -void switchMode(JNIEnv *env, long width, long height, long bpp, long freq) { +bool switchMode(JNIEnv *env, long width, long height, long bpp, long freq) { init(env); captureDisplay(); - CFDictionaryRef displayMode = CGDisplayBestModeForParametersAndRefreshRate(kCGDirectMainDisplay, bpp, width, height, freq, NULL); - CGDisplaySwitchToMode(kCGDirectMainDisplay, displayMode); - saveMode(env, width, height, bpp, freq); + CFArrayRef modes = CGDisplayAvailableModes(kCGDirectMainDisplay); + int size = CFArrayGetCount(modes); + for (int i = 0; i < size; i++) { + CFDictionaryRef mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i); + long mode_width; + long mode_height; + long mode_bpp; + long mode_freq; + getDictLong(mode, kCGDisplayWidth, &mode_width); + getDictLong(mode, kCGDisplayHeight, &mode_height); + getDictLong(mode, kCGDisplayRefreshRate, &mode_freq); + getDictLong(mode, kCGDisplayBitsPerPixel, &mode_bpp); + if (width == mode_width && height == mode_height && bpp == mode_bpp && mode_freq == freq) { + CGDisplayErr err = CGDisplaySwitchToMode(kCGDirectMainDisplay, mode); + if (!err) { + saveMode(env, width, height, bpp, freq); + return true; + } + } + } + return false; } void resetMode(JNIEnv *env) { @@ -123,7 +141,9 @@ int height = env->GetIntField(mode, fid_height); int bpp = env->GetIntField(mode, fid_bpp); int freq = env->GetIntField(mode, fid_freq); - switchMode(env, width, height, bpp, freq); + if (!switchMode(env, width, height, bpp, freq)) { + throwException(env, "Could not switch mode."); + } } JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_Display_nGetAvailableDisplayModes(JNIEnv * env, jclass clazz) { Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- org_lwjgl_opengl_Window.cpp 22 Oct 2003 10:57:19 -0000 1.25 +++ org_lwjgl_opengl_Window.cpp 24 Oct 2003 05:51:50 -0000 1.26 @@ -103,7 +103,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nCreate(JNIEnv *env, jclass clazz, jstring title, jint x, jint y, jint width, jint height, jboolean fullscreen, jint bpp, jint alpha, jint depth, jint stencil, jobject ext_set) { vsync_enabled = false; - current_fullscreen = fullscreen == JNI_FALSE; + current_fullscreen = fullscreen == JNI_TRUE; if (!extgl_Open()) { throwException(env, "Could not load gl library"); return; @@ -112,8 +112,14 @@ throwException(env, "Could not load agl symbols"); return; } - if (current_fullscreen) - switchMode(env, width, height, bpp, 60); + if (!current_fullscreen) { + if (!switchMode(env, width, height, bpp, 60)) { + destroyMode(env, clazz); + extgl_Close(); + throwException(env, "Could not switch mode."); + return; + } + } if (!createFullscreenContext(env, bpp, alpha, depth, stencil)) { destroyMode(env, clazz); extgl_Close(); |