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
(6) |
2
|
3
|
4
(3) |
5
|
6
|
7
(11) |
|
8
(2) |
9
|
10
|
11
|
12
(6) |
13
|
14
|
|
15
(1) |
16
(4) |
17
(8) |
18
|
19
|
20
|
21
|
|
22
|
23
|
24
(17) |
25
|
26
|
27
|
28
|
|
29
|
30
|
|
|
|
|
|
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 19:28:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv25045/src/native/win32 Modified Files: org_lwjgl_Display.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_Window.cpp Log Message: We now restore display settings on minimize. Hurrah! Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- org_lwjgl_Display.cpp 27 May 2003 14:12:10 -0000 1.39 +++ org_lwjgl_Display.cpp 7 Jun 2003 19:28:52 -0000 1.40 @@ -39,7 +39,7 @@ * @version $Revision$ */ -#include "Window.h" +#include "Window.h" #include "org_lwjgl_Display.h" #define WINDOWCLASSNAME "LWJGLWINDOW" @@ -48,6 +48,8 @@ jobjectArray GetAvailableDisplayModes9x(JNIEnv * env); bool modeSet = false; // Whether we've done a display mode change WORD* originalGamma = new WORD[256 * 3]; // Original gamma settings +WORD* currentGamma = new WORD[256 * 3]; // Current gamma settings +DEVMODE devmode; // Now we'll remember this value for the future /* @@ -206,7 +208,6 @@ int bpp = env->GetIntField(mode, fid_bpp); int freq = env->GetIntField(mode, fid_freq); - DEVMODE devmode; devmode.dmSize = sizeof(DEVMODE); devmode.dmBitsPerPel = bpp; devmode.dmPelsWidth = width; @@ -272,10 +273,10 @@ // Return device gamma to normal HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, originalGamma)) { -#ifdef _DEBUG - printf("Could not reset device gamma\n"); -#endif + if (!SetDeviceGammaRamp(screenDC, originalGamma)) { +#ifdef _DEBUG + printf("Could not reset device gamma\n"); +#endif } ReleaseDC(NULL, screenDC); @@ -287,18 +288,71 @@ // And we'll call init() again to put the correct mode back in Display Java_org_lwjgl_Display_init(env, clazz); } -} - -/* - * Class: org_lwjgl_Display - * Method: getGammaRampLength - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_Display_getGammaRampLength - (JNIEnv *env, jclass clazz) -{ - return 256; -} +} + +/* + * Temporarily reset display settings. This is called when the window is minimized. + */ +void tempResetDisplayMode() { + // Return device gamma to normal + HDC screenDC = GetDC(NULL); + if (!SetDeviceGammaRamp(screenDC, originalGamma)) { +#ifdef _DEBUG + printf("Could not reset device gamma\n"); +#endif + } + ReleaseDC(NULL, screenDC); + + if (modeSet) { +#ifdef _DEBUG + printf("Attempting to temporarily reset the display mode\n"); +#endif + modeSet = false; + // Under Win32, all we have to do is: + ChangeDisplaySettings(NULL, 0); + } +} + +/* + * Put display settings back to what they were when the window is maximized. + */ +void tempRestoreDisplayMode() { + // Restore gamma + HDC screenDC = GetDC(NULL); + if (!SetDeviceGammaRamp(screenDC, currentGamma)) { +#ifdef _DEBUG + printf("Could not restore device gamma\n"); +#endif + } + ReleaseDC(NULL, screenDC); + + if (!modeSet) { + +#ifdef _DEBUG + printf("Attempting to restore the display mode\n"); +#endif + modeSet = true; + LONG cdsret = ChangeDisplaySettings(&devmode, CDS_FULLSCREEN); + +#ifdef _DEBUG + if (cdsret != DISP_CHANGE_SUCCESSFUL) { + printf("Failed to restore display mode\n"); + } +#endif + } +} + + +/* + * Class: org_lwjgl_Display + * Method: getGammaRampLength + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_Display_getGammaRampLength + (JNIEnv *env, jclass clazz) +{ + return 256; +} /* * Class: org_lwjgl_Display @@ -307,20 +361,20 @@ */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp (JNIEnv * env, jclass clazz, jint gammaRampAddress) -{ +{ float *gammaRamp = (float *)gammaRampAddress; // Turn array of floats into array of RGB WORDs - WORD newGamma[768]; - for (int i = 0; i < 256; i ++) { - float scaledRampEntry = gammaRamp[i]*0xffff; - WORD rampEntry = (WORD)scaledRampEntry; - newGamma[i] = rampEntry; - newGamma[i + 256] = rampEntry; - newGamma[i + 512] = rampEntry; + + for (int i = 0; i < 256; i ++) { + float scaledRampEntry = gammaRamp[i]*0xffff; + WORD rampEntry = (WORD)scaledRampEntry; + currentGamma[i] = rampEntry; + currentGamma[i + 256] = rampEntry; + currentGamma[i + 512] = rampEntry; } jboolean ret; HDC screenDC = GetDC(NULL); - if (SetDeviceGammaRamp(screenDC, newGamma) == FALSE) { + if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { #ifdef _DEBUG printf("Failed to set device gamma\n"); #endif 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.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- org_lwjgl_input_Mouse.cpp 7 Jun 2003 12:49:55 -0000 1.22 +++ org_lwjgl_input_Mouse.cpp 7 Jun 2003 19:28:53 -0000 1.23 @@ -397,7 +397,7 @@ if(hRes == DIERR_INPUTLOST || hRes == DIERR_NOTACQUIRED) { mDIDevice->Acquire(); #if _DEBUG - printf("DIERR_INPUTLOST, reaquiring input : mCreate_success=%d\n", mCreate_success); + //printf("DIERR_INPUTLOST, reaquiring input : mCreate_success=%d\n", mCreate_success); #endif } else { #if _DEBUG Index: org_lwjgl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_Window.cpp 7 Jun 2003 12:48:21 -0000 1.11 +++ org_lwjgl_Window.cpp 7 Jun 2003 19:28:53 -0000 1.12 @@ -54,6 +54,9 @@ extern HINSTANCE dll_handle; // Handle to the LWJGL dll RECT clientSize; +extern void tempRestoreDisplayMode(); +extern void tempResetDisplayMode(); + #define WINDOWCLASSNAME "LWJGL" /* @@ -197,10 +200,16 @@ case WA_CLICKACTIVE: environment->SetBooleanField(window, environment->GetFieldID(environment->GetObjectClass(window), "minimized", "Z"), JNI_FALSE); isMinimized = false; + // Change to game display settings + tempRestoreDisplayMode(); + break; case WA_INACTIVE: environment->SetBooleanField(window, environment->GetFieldID(environment->GetObjectClass(window), "minimized", "Z"), JNI_TRUE); isMinimized = true; + // Restore display settings + tempResetDisplayMode(); + break; } appActivate(!isMinimized); @@ -404,6 +413,7 @@ if (isMinimized) return; ShowWindow(hwnd, SW_MINIMIZE); +// tempResetDisplayMode(); } /* @@ -417,5 +427,6 @@ if (!isMinimized) return; +// tempRestoreDisplayMode(); ShowWindow(hwnd, SW_RESTORE); } |
|
From: Elias N. <eli...@us...> - 2003-06-07 13:56:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1:/tmp/cvs-serv23382 Modified Files: configure.in Log Message: Fixed win9x keyboard translation 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.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- configure.in 1 Jun 2003 17:20:03 -0000 1.12 +++ configure.in 7 Jun 2003 13:56:05 -0000 1.13 @@ -51,8 +51,8 @@ else AC_MSG_RESULT($JAVA_HOME) JAVA_HOME="$JAVA_HOME" - CPPFLAGS="$CPPFLAGS -D_DEBUG -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" - CFLAGS="$CFLAGS -D_DEBUG -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CPPFLAGS="$CPPFLAGS -fno-rtti -fno-exceptions -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" + CFLAGS="$CFLAGS -pthread -D_X11 -Wall -I$JAVA_HOME/include -I$JAVA_HOME/include/linux" fi dnl Checks for libraries. |
|
From: Elias N. <eli...@us...> - 2003-06-07 13:56:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv23382/win32 Modified Files: org_lwjgl_input_Keyboard.cpp Log Message: Fixed win9x keyboard translation Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_input_Keyboard.cpp 7 Jun 2003 12:47:35 -0000 1.18 +++ org_lwjgl_input_Keyboard.cpp 7 Jun 2003 13:56:06 -0000 1.19 @@ -52,7 +52,8 @@ static BYTE readBuffer[KEYBOARD_BUFFER_SIZE*4]; static LPDIRECTINPUTDEVICE lpdiKeyboard = NULL; static jfieldID fid_readBuffer; -static bool translationEnabled; +static bool translationEnabled; +static bool useUnicode; /* @@ -177,7 +178,7 @@ lpdiKeyboard->GetDeviceState(256, (void *)buf); } - + /* * Class: org_lwjgl_input_Keyboard * Method: nRead @@ -188,7 +189,8 @@ { static DIDEVICEOBJECTDATA rgdod[KEYBOARD_BUFFER_SIZE]; - wchar_t transBuf[KEYBOARD_BUFFER_SIZE]; + wchar_t transBufUnicode[KEYBOARD_BUFFER_SIZE]; + WORD transBufAscii[KEYBOARD_BUFFER_SIZE]; BYTE state[256]; DWORD bufsize = KEYBOARD_BUFFER_SIZE; @@ -220,28 +222,35 @@ *buf++ = (unsigned char) rgdod[i].dwData; if (translationEnabled) { UINT virt_key = MapVirtualKey(rgdod[i].dwOfs, 1); - if (virt_key != 0) { - if (!GetKeyboardState(state)) { - *buf++ = 0; - *buf++ = 0; - continue; - } - num_chars = ToUnicode(virt_key, - rgdod[i].dwOfs, - state, - transBuf, - KEYBOARD_BUFFER_SIZE, 0); - if (num_chars > 0) { - wchar_t ch = transBuf[0]; - *buf++ = (unsigned char) (ch & 0xff); - *buf++ = (unsigned char) ((ch & 0xff00) >> 8); - for (int i = 1; i < num_chars; i++) { - num_events++; - ch = transBuf[i]; - *buf++ = 0; - *buf++ = 0; - *buf++ = (unsigned char) (ch & 0xff); - *buf++ = (unsigned char) ((ch & 0xff00) >> 8); + if (virt_key != 0 && GetKeyboardState(state)) { + if (useUnicode) { + num_chars = ToUnicode(virt_key, + rgdod[i].dwOfs, + state, + transBufUnicode, + KEYBOARD_BUFFER_SIZE, 0); + } else { + num_chars = ToAscii(virt_key, + rgdod[i].dwOfs, + state, + transBufAscii, + 0); + } + if (num_chars > 0) { + for (int i = 0; i < num_chars; i++) { + if (i >= 1) { + num_events++; + *buf++ = 0; + *buf++ = 0; + } + if (useUnicode) { + wchar_t ch = transBufUnicode[i]; + *buf++ = (unsigned char) (ch & 0xff); + *buf++ = (unsigned char) ((ch & 0xff00) >> 8); + } else { + *buf++ = (unsigned char)transBufAscii[0]; + *buf++ = 0; + } } } else { *buf++ = 0; @@ -300,13 +309,13 @@ osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { - translationEnabled = true; - return JNI_TRUE; + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + useUnicode = true; } else { - translationEnabled = false; - return JNI_FALSE; + useUnicode = false; } + translationEnabled = true; + return JNI_TRUE; } /* |
|
From: Elias N. <eli...@us...> - 2003-06-07 13:56:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv23382/linux Modified Files: org_lwjgl_input_Keyboard.cpp Log Message: Fixed win9x keyboard translation Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- org_lwjgl_input_Keyboard.cpp 1 Jun 2003 17:20:03 -0000 1.23 +++ org_lwjgl_input_Keyboard.cpp 7 Jun 2003 13:56:05 -0000 1.24 @@ -299,10 +299,11 @@ * Method: nEnableTranslation * Signature: ()I */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *env, jclass clazz) { translation_enabled = true; + return JNI_TRUE; } /* |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:49:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1905/src/native/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Early exit on failed mouse read. 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.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- org_lwjgl_input_Mouse.cpp 20 May 2003 12:20:13 -0000 1.21 +++ org_lwjgl_input_Mouse.cpp 7 Jun 2003 12:49:55 -0000 1.22 @@ -61,10 +61,10 @@ static jfieldID fidMDX; static jfieldID fidMDY; static jfieldID fidMDWheel; -static jfieldID fidMHasWheel; - -static POINT cursorPos; -static RECT windowRect; +static jfieldID fidMHasWheel; + +static POINT cursorPos; +static RECT windowRect; static bool usingNativeCursor; // Function prototypes (defined in the cpp file, since header file is generic across platforms @@ -78,16 +78,16 @@ void UpdateMouseFields(); void SetMouseCapabilities(); -static void getScreenClientRect(RECT* clientRect, RECT* windowRect) -{ - GetClientRect(hwnd, clientRect); - // transform clientRect to screen coordinates - clientRect->top = -clientSize.top + windowRect->top; - clientRect->left = -clientSize.left + windowRect->left; - clientRect->bottom += clientRect->top; - clientRect->right += clientRect->left; -} - +static void getScreenClientRect(RECT* clientRect, RECT* windowRect) +{ + GetClientRect(hwnd, clientRect); + // transform clientRect to screen coordinates + clientRect->top = -clientSize.top + windowRect->top; + clientRect->left = -clientSize.left + windowRect->left; + clientRect->bottom += clientRect->top; + clientRect->right += clientRect->left; +} + /** * Initializes any field ids */ @@ -103,12 +103,12 @@ * Called when the Mouse instance is to be created */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { - HRESULT hr; + HRESULT hr; mEnvironment = env; clsMouse = clazz; - - ShowCursor(FALSE); + + ShowCursor(FALSE); CacheMouseFields(); /* skip enumeration, since we only want system mouse */ @@ -126,7 +126,7 @@ ShutdownMouse(); return JNI_FALSE; } - /* Do setup of Mouse */ + /* Do setup of Mouse */ SetupMouse(); /* Set capabilities */ @@ -143,94 +143,94 @@ #if _DEBUG printf("Failed to acquire mouse\n"); #endif - } + } return mCreate_success ? JNI_TRUE : JNI_FALSE; } -/* - * Class: org_lwjgl_input_Mouse - * Method: nIsNativeCursorSupported - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps - (JNIEnv *env, jclass clazz) -{ - return org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARANCY; -} - -/* - * Class: org_lwjgl_input_Mouse - * Method: nSetNativeCursor - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor - (JNIEnv *env, jclass clazz, jint cursor_handle) -{ - if (cursor_handle != NULL) { - if (mDIDevice == NULL) - throwException(env, "null device!"); - mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { -#if _DEBUG - printf("SetCooperativeLevel failed\n"); -#endif - throwException(env, "Could not set the CooperativeLevel."); - return; - } - HCURSOR cursor = (HCURSOR)cursor_handle; - SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor); - SetCursor(cursor); - if (!usingNativeCursor) { - /* Reset cursor position to 0, 0 */ - RECT clientRect; - GetWindowRect(hwnd, &windowRect); - getScreenClientRect(&clientRect, &windowRect); - SetCursorPos(clientRect.left, clientRect.top); - cursorPos.x = clientRect.left; - cursorPos.y = clientRect.top; - ShowCursor(TRUE); - usingNativeCursor = true; - } - } else { - if (usingNativeCursor) { - SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); - SetCursor(NULL); - mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { -#if _DEBUG - printf("SetCooperativeLevel failed\n"); -#endif - throwException(env, "Could not set the CooperativeLevel."); - return; - } - ShowCursor(FALSE); - usingNativeCursor = false; - } - } -} - -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMaxCursorSize - (JNIEnv *env, jclass clazz) -{ - return GetSystemMetrics(SM_CXCURSOR); -} - -/* - * Class: org_lwjgl_input_Mouse - * Method: nGetMaxCursorSize - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMinCursorSize - (JNIEnv *env, jclass clazz) -{ - return GetSystemMetrics(SM_CXCURSOR); -} - +/* + * Class: org_lwjgl_input_Mouse + * Method: nIsNativeCursorSupported + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps + (JNIEnv *env, jclass clazz) +{ + return org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARANCY; +} + +/* + * Class: org_lwjgl_input_Mouse + * Method: nSetNativeCursor + * Signature: (I)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor + (JNIEnv *env, jclass clazz, jint cursor_handle) +{ + if (cursor_handle != NULL) { + if (mDIDevice == NULL) + throwException(env, "null device!"); + mDIDevice->Unacquire(); + if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { +#if _DEBUG + printf("SetCooperativeLevel failed\n"); +#endif + throwException(env, "Could not set the CooperativeLevel."); + return; + } + HCURSOR cursor = (HCURSOR)cursor_handle; + SetClassLong(hwnd, GCL_HCURSOR, (LONG)cursor); + SetCursor(cursor); + if (!usingNativeCursor) { + /* Reset cursor position to 0, 0 */ + RECT clientRect; + GetWindowRect(hwnd, &windowRect); + getScreenClientRect(&clientRect, &windowRect); + SetCursorPos(clientRect.left, clientRect.top); + cursorPos.x = clientRect.left; + cursorPos.y = clientRect.top; + ShowCursor(TRUE); + usingNativeCursor = true; + } + } else { + if (usingNativeCursor) { + SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); + SetCursor(NULL); + mDIDevice->Unacquire(); + if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { +#if _DEBUG + printf("SetCooperativeLevel failed\n"); +#endif + throwException(env, "Could not set the CooperativeLevel."); + return; + } + ShowCursor(FALSE); + usingNativeCursor = false; + } + } +} + +/* + * Class: org_lwjgl_input_Mouse + * Method: nGetMaxCursorSize + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMaxCursorSize + (JNIEnv *env, jclass clazz) +{ + return GetSystemMetrics(SM_CXCURSOR); +} + +/* + * Class: org_lwjgl_input_Mouse + * Method: nGetMaxCursorSize + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetMinCursorSize + (JNIEnv *env, jclass clazz) +{ + return GetSystemMetrics(SM_CXCURSOR); +} + /* * Class: org_lwjgl_input_Mouse * Method: nDestroy @@ -239,7 +239,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv *env, jclass clazz) { mEnvironment = env; clsMouse = clazz; - ShowCursor(FALSE); + ShowCursor(FALSE); ShutdownMouse(); } @@ -350,40 +350,40 @@ return; } mCreate_success = true; -} - -static void getGDICursorDelta(int* return_dx, int* return_dy) { - int dx = 0; - int dy = 0; - - POINT newCursorPos; - GetCursorPos(&newCursorPos); - RECT clientRect; - RECT newWindowRect; - GetWindowRect(hwnd, &newWindowRect); - cursorPos.x += newWindowRect.left - windowRect.left; - cursorPos.y += newWindowRect.top - windowRect.top; - windowRect = newWindowRect; - getScreenClientRect(&clientRect, &windowRect); - // Clip the position to the client rect - if (newCursorPos.x < clientRect.right && newCursorPos.x >= clientRect.left && - newCursorPos.y < clientRect.bottom && newCursorPos.y >= clientRect.top) { - dx = newCursorPos.x - cursorPos.x; - dy = newCursorPos.y - cursorPos.y; - cursorPos.x += dx; - cursorPos.y += dy; - } - *return_dx = dx; - *return_dy = dy; -} - +} + +static void getGDICursorDelta(int* return_dx, int* return_dy) { + int dx = 0; + int dy = 0; + + POINT newCursorPos; + GetCursorPos(&newCursorPos); + RECT clientRect; + RECT newWindowRect; + GetWindowRect(hwnd, &newWindowRect); + cursorPos.x += newWindowRect.left - windowRect.left; + cursorPos.y += newWindowRect.top - windowRect.top; + windowRect = newWindowRect; + getScreenClientRect(&clientRect, &windowRect); + // Clip the position to the client rect + if (newCursorPos.x < clientRect.right && newCursorPos.x >= clientRect.left && + newCursorPos.y < clientRect.bottom && newCursorPos.y >= clientRect.top) { + dx = newCursorPos.x - cursorPos.x; + dy = newCursorPos.y - cursorPos.y; + cursorPos.x += dx; + cursorPos.y += dy; + } + *return_dx = dx; + *return_dy = dy; +} + /** * Updates the fields on the Mouse */ void UpdateMouseFields() { HRESULT hRes; - DIMOUSESTATE diMouseState; // State of Mouse - int dx, dy; + DIMOUSESTATE diMouseState; // State of Mouse + int dx, dy; // get data from the Mouse hRes = mDIDevice->GetDeviceState(sizeof(DIMOUSESTATE), &diMouseState); @@ -404,15 +404,18 @@ printf("Error getting mouse state: %d\n", hRes); #endif } - } - - if (usingNativeCursor) { - getGDICursorDelta(&dx, &dy); - } else { - dx = diMouseState.lX; - dy = diMouseState.lY; - } - + + // Leave anyway and come back next time + return; + } + + if (usingNativeCursor) { + getGDICursorDelta(&dx, &dy); + } else { + dx = diMouseState.lX; + dy = diMouseState.lY; + } + mEnvironment->SetStaticIntField(clsMouse, fidMDX, (jint)dx); mEnvironment->SetStaticIntField(clsMouse, fidMDY, (jint)dy); mEnvironment->SetStaticIntField(clsMouse, fidMDWheel, (jint)diMouseState.lZ); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:48:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1389/src/native/win32 Modified Files: org_lwjgl_Window.cpp Log Message: Minor tweaks to window creation. Index: org_lwjgl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_Window.cpp 4 Jun 2003 22:10:24 -0000 1.10 +++ org_lwjgl_Window.cpp 7 Jun 2003 12:48:21 -0000 1.11 @@ -271,10 +271,10 @@ int exstyle, windowflags; if (fullscreen) { - exstyle = WS_EX_TOPMOST; + exstyle = WS_EX_APPWINDOW | WS_EX_TOPMOST; windowflags = WS_POPUP | WS_VISIBLE; } else { - exstyle = 0; + exstyle = WS_EX_APPWINDOW; windowflags = WS_OVERLAPPED | WS_BORDER | WS_CAPTION | WS_VISIBLE | WS_MINIMIZEBOX | WS_SYSMENU; } @@ -313,8 +313,8 @@ printf("Created window\n"); #endif - //ShowWindow(hwnd, SW_SHOWNORMAL); - ShowWindow(hwnd, SW_SHOW); + ShowWindow(hwnd, SW_SHOWNORMAL); + //ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); SetForegroundWindow(hwnd); SetFocus(hwnd); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:47:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1176/src/native/win32 Modified Files: org_lwjgl_input_Keyboard.cpp Log Message: Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_input_Keyboard.cpp 16 May 2003 18:39:46 -0000 1.17 +++ org_lwjgl_input_Keyboard.cpp 7 Jun 2003 12:47:35 -0000 1.18 @@ -47,7 +47,7 @@ #include "org_lwjgl_input_Keyboard.h" #include "Window.h" -#define KEYBOARD_BUFFER_SIZE 50 +#define KEYBOARD_BUFFER_SIZE 50 static BYTE readBuffer[KEYBOARD_BUFFER_SIZE*4]; static LPDIRECTINPUTDEVICE lpdiKeyboard = NULL; @@ -63,13 +63,14 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_initIDs (JNIEnv * env, jclass clazz) { + /* // Get a global class instance, just to be sure static jobject globalClassLock = NULL; if (globalClassLock == NULL) { globalClassLock = env->NewGlobalRef(clazz); } - + */ fid_readBuffer = env->GetStaticFieldID(clazz, "readBuffer", "Ljava/nio/ByteBuffer;"); } @@ -208,17 +209,23 @@ if (ret == DI_OK) { unsigned char * buf = readBuffer; +//#ifdef _DEBUG +// if (bufsize > 0) { +// printf("Got %d keyboard events.\n", bufsize); +// } +//#endif for (unsigned int i = 0; i < bufsize; i ++) { num_events++; *buf++ = (unsigned char) rgdod[i].dwOfs; *buf++ = (unsigned char) rgdod[i].dwData; if (translationEnabled) { - // Cas: shouldn't need to call handleMessages any more - // handleMessages(); UINT virt_key = MapVirtualKey(rgdod[i].dwOfs, 1); if (virt_key != 0) { - if (!GetKeyboardState(state)) - return 0; + if (!GetKeyboardState(state)) { + *buf++ = 0; + *buf++ = 0; + continue; + } num_chars = ToUnicode(virt_key, rgdod[i].dwOfs, state, @@ -283,10 +290,23 @@ * Method: nEnableTranslation * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *, jclass) { - translationEnabled = true; + // We can't do translation on DOS boxes it seems so we'll have to throw a wobbler + // here: + OSVERSIONINFO osvi; + + osvi.dwOSVersionInfoSize = sizeof(osvi); + GetVersionEx(&osvi); + + if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { + translationEnabled = true; + return JNI_TRUE; + } else { + translationEnabled = false; + return JNI_FALSE; + } } /* |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:47:35
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv1106/src/native/common Modified Files: org_lwjgl_input_Keyboard.h Log Message: Index: org_lwjgl_input_Keyboard.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Keyboard.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Keyboard.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Keyboard.h 11 Jan 2003 23:09:08 -0000 1.2 +++ org_lwjgl_input_Keyboard.h 7 Jun 2003 12:47:19 -0000 1.3 @@ -313,7 +313,7 @@ * Method: nEnableTranslation * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation +JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nEnableTranslation (JNIEnv *, jclass); /* |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:47:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv1027/src/java/org/lwjgl/input Modified Files: Keyboard.java Log Message: Index: Keyboard.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Keyboard.java 8 May 2003 21:27:12 -0000 1.21 +++ Keyboard.java 7 Jun 2003 12:47:08 -0000 1.22 @@ -344,18 +344,20 @@ /** * Enable keyboard translation. Must be called after the keyboard is created, * and keyboard buffering must be enabled. + * @return false if translation cannot be enabled; true if it can */ - public static void enableTranslation() { + public static boolean enableTranslation() { assert created : "The keyboard has not been created."; assert readBuffer != null : "Keyboard buffering has not been enabled."; - nEnableTranslation(); - translationEnabled = true; + + translationEnabled = nEnableTranslation(); + return translationEnabled; } /** * Native method to enable the translation buffer */ - private static native void nEnableTranslation(); + private static native boolean nEnableTranslation(); /** * Enable keyboard buffering. Must be called after the keyboard is created. |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-06-07 12:47:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv1027/src/java/org/lwjgl Modified Files: Window.java Log Message: Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Window.java 4 Jun 2003 21:49:46 -0000 1.10 +++ Window.java 7 Jun 2003 12:47:08 -0000 1.11 @@ -120,6 +120,7 @@ * @param newTitle The new window title */ public final void setTitle(String newTitle) { + assert isCreated(); title = newTitle; nSetTitle(title); } @@ -134,6 +135,7 @@ * @return true if the user or operating system has asked the window to close */ public final boolean isCloseRequested() { + assert isCreated(); return closeRequested; } @@ -141,6 +143,7 @@ * @return true if the window is minimized or otherwise not visible */ public final boolean isMinimized() { + assert isCreated(); return minimized; } @@ -172,6 +175,7 @@ * and needs to repaint itself */ public final boolean isDirty() { + assert isCreated(); return dirty; } @@ -179,6 +183,7 @@ * Paint the window. This clears the dirty flag and swaps the buffers. */ public final void paint() { + assert isCreated(); dirty = false; doPaint(); } @@ -194,7 +199,8 @@ doCreate(); currentWindow = this; created = true; - } + + } /** * Create the window (derived classes). @@ -205,7 +211,7 @@ /** * Destroy the window. */ - public final synchronized void destroy() { + public final void destroy() { if (!created) return; doDestroy(); @@ -237,16 +243,7 @@ * 'Tick' the window. This must be called at least once per video frame * to handle window close requests, moves, paints, etc. */ - public final native void tick(); - - /* (non-Javadoc) - * @see java.lang.Object#finalize() - */ - protected void finalize() throws Throwable { - super.finalize(); - - destroy(); - } + public native void tick(); /* (non-Javadoc) * @see java.lang.Object#toString() |
|
From: Elias N. <eli...@us...> - 2003-06-07 11:53:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv17977 Modified Files: Cursor.java Log Message: Doc update Index: Cursor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Cursor.java 20 May 2003 12:20:11 -0000 1.4 +++ Cursor.java 7 Jun 2003 11:53:17 -0000 1.5 @@ -59,7 +59,8 @@ * Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create * Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported. * So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values. - * + * The constructor will copy the images and delays, so there's no need to keep them around. + * * @param width cursor image width * @param height cursor image height * @param xHotspot the x coordinate of the cursor hotspot |