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
(4) |
2
(4) |
3
|
4
(2) |
5
|
6
|
7
|
|
8
|
9
(4) |
10
|
11
|
12
(1) |
13
(1) |
14
|
|
15
|
16
(21) |
17
(2) |
18
|
19
|
20
(1) |
21
|
|
22
|
23
|
24
|
25
|
26
|
27
|
28
|
|
29
|
30
|
31
(4) |
|
|
|
|
|
From: Elias N. <eli...@us...> - 2006-01-31 12:48:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1079/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Fixed resetDisplayMode in case XRandr is used and the first reported mode is not the initial mode Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- LinuxDisplay.java 31 Jan 2006 12:31:41 -0000 1.39 +++ LinuxDisplay.java 31 Jan 2006 12:48:46 -0000 1.40 @@ -389,11 +389,16 @@ } private static DisplayMode getCurrentXRandrMode() throws LWJGLException { - incDisplay(); + lockAWT(); try { - return nGetCurrentXRandrMode(); + incDisplay(); + try { + return nGetCurrentXRandrMode(); + } finally { + decDisplay(); + } } finally { - decDisplay(); + unlockAWT(); } } |
|
From: Elias N. <eli...@us...> - 2006-01-31 12:31:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Fixed resetDisplayMode in case XRandr is used and the first reported mode is not the initial mode Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- LinuxDisplay.java 4 Jan 2006 07:36:08 -0000 1.38 +++ LinuxDisplay.java 31 Jan 2006 12:31:41 -0000 1.39 @@ -369,7 +369,16 @@ DisplayMode[] modes = getAvailableDisplayModes(); if (modes == null || modes.length == 0) throw new LWJGLException("No modes available"); - saved_mode = modes[0]; + switch (current_displaymode_extension) { + case XRANDR: + saved_mode = getCurrentXRandrMode(); + break; + case XF86VIDMODE: + saved_mode = modes[0]; + break; + default: + throw new LWJGLException("Unknown display mode extension: " + current_displaymode_extension); + } current_mode = saved_mode; saved_gamma = getCurrentGammaRamp(); current_gamma = saved_gamma; @@ -378,8 +387,18 @@ unlockAWT(); } } - /** Assumes extension != NONE */ - private static native DisplayMode nInit(int extension) throws LWJGLException; + + private static DisplayMode getCurrentXRandrMode() throws LWJGLException { + incDisplay(); + try { + return nGetCurrentXRandrMode(); + } finally { + decDisplay(); + } + } + + /** Assumes extension == XRANDR */ + private static native DisplayMode nGetCurrentXRandrMode() throws LWJGLException; public void setTitle(String title) { lockAWT(); |
|
From: Elias N. <eli...@us...> - 2006-01-31 12:31:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103/src/native/common Modified Files: common_tools.h Log Message: Linux: Fixed resetDisplayMode in case XRandr is used and the first reported mode is not the initial mode Index: common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- common_tools.h 21 Feb 2005 14:46:43 -0000 1.39 +++ common_tools.h 31 Jan 2006 12:31:41 -0000 1.40 @@ -141,6 +141,7 @@ extern bool putEvent(event_queue_t *queue, jint *event); extern void throwGeneralException(JNIEnv * env, const char *exception_name, const char * err); extern void throwException(JNIEnv *env, const char *msg); +extern void throwFormattedException(JNIEnv * env, const char *format, ...); extern void throwFMODException(JNIEnv * env, const char * err); extern void setDebugEnabled(bool enable); extern void printfDebugJava(JNIEnv *env, const char *format, ...); |
|
From: Elias N. <eli...@us...> - 2006-01-31 12:31:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27103/src/native/linux Modified Files: display.c Log Message: Linux: Fixed resetDisplayMode in case XRandr is used and the first reported mode is not the initial mode Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- display.c 4 Jan 2006 12:52:25 -0000 1.26 +++ display.c 31 Jan 2006 12:31:41 -0000 1.27 @@ -197,7 +197,7 @@ Time config_time; *timestamp = XRRConfigTimes(screen_configuration, &config_time); Rotation current_rotation; - XRRConfigRotations(screen_configuration, ¤t_rotation); + XRRConfigCurrentConfiguration(screen_configuration, ¤t_rotation); status = XRRSetScreenConfigAndRate(disp, screen_configuration, root_window, mode->mode_data.size_index, current_rotation, mode->freq, *timestamp); XRRFreeScreenConfigInfo(screen_configuration); return status; @@ -359,7 +359,6 @@ avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL) { printfDebugJava(env, "Could not get display modes"); - XCloseDisplay(disp); return NULL; } // Allocate an array of DisplayModes big enough @@ -375,6 +374,36 @@ return ret; } +static jobject getCurrentXRandrMode(JNIEnv * env, Display *disp, int screen) { + Drawable root_window = RootWindow(disp, screen); + XRRScreenConfiguration *config = XRRGetScreenInfo(disp, root_window); + if (config == NULL) { + throwException(env, "Could not get current screen configuration."); + return NULL; + } + short rate = XRRConfigCurrentRate(config); + Rotation current_rotation; + SizeID size_index = XRRConfigCurrentConfiguration(config, ¤t_rotation); + int n_sizes; + XRRScreenSize *sizes = XRRConfigSizes(config, &n_sizes); + if (size_index >= n_sizes) { + throwFormattedException(env, "Xrandr current index (%d) is larger than or equals to the number of sizes (%d).", size_index, n_sizes); + XRRFreeScreenConfigInfo(config); + return NULL; + } + XRRScreenSize current_size = sizes[size_index]; + XRRFreeScreenConfigInfo(config); + int bpp = XDefaultDepth(disp, screen); + jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); + jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); + jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, current_size.width, current_size.height, bpp, rate); + return displayMode; +} + +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentXRandrMode(JNIEnv *env, jclass unused) { + return getCurrentXRandrMode(env, getDisplay(), getCurrentScreen()); +} + JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2006-01-20 23:25:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7106/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- org_lwjgl_input_Mouse.c 17 Jan 2006 07:18:02 -0000 1.19 +++ org_lwjgl_input_Mouse.c 20 Jan 2006 23:25:05 -0000 1.20 @@ -484,27 +484,38 @@ // if so, then attempt to reacquire. if(hRes == DIERR_INPUTLOST || hRes == DIERR_NOTACQUIRED) { hRes = IDirectInputDevice_Acquire(mDIDevice); - if (hRes != DI_OK) + if (hRes != DI_OK) { return; + } else { + hRes = IDirectInputDevice_GetDeviceState(mDIDevice, sizeof(DIMOUSESTATE), &diMouseState); + if (hRes != DI_OK) { + printfDebugJava(env, "Error getting mouse state #2: %d", hRes); + return; + } + } } else { - printfDebugJava(env, "Error getting mouse state: %d", hRes); + printfDebugJava(env, "Error getting mouse state #2: %d", hRes); return; } } coords[2] = diMouseState.lZ; num_buttons = mButtoncount; - if (num_buttons > buttons_length) + if (num_buttons > buttons_length) { num_buttons = buttons_length; - for (j = 0; j < num_buttons; j++) + } + for (j = 0; j < num_buttons; j++) { buttons_buffer[j] = diMouseState.rgbButtons[j] != 0 ? JNI_TRUE : JNI_FALSE; + } } else { coords[2] = accum_dwheel; num_buttons = mButtoncount; - if (num_buttons > BUTTON_STATES_SIZE) + if (num_buttons > BUTTON_STATES_SIZE) { num_buttons = BUTTON_STATES_SIZE; - for (j = 0; j < num_buttons; j++) + } + for (j = 0; j < num_buttons; j++) { buttons_buffer[j] = win32_message_button_states[j]; + } } accum_dwheel = 0; if (mouse_grabbed) { |
|
From: Elias N. <eli...@us...> - 2006-01-17 08:47:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16656/src/java/org/lwjgl Modified Files: Sys.java Log Message: Mac OS X: Fixed legacy library loading Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- Sys.java 16 Jan 2006 21:04:49 -0000 1.92 +++ Sys.java 17 Jan 2006 08:47:52 -0000 1.93 @@ -72,6 +72,8 @@ for (int i = 0; i < library_names.length; i++) { try { loadLibrary(library_names[i]); + last_load_error = null; + break; } catch (UnsatisfiedLinkError e) { last_load_error = e; } |
|
From: Elias N. <eli...@us...> - 2006-01-17 07:18:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26596 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Don't accumulate scroll wheel deltas if Dinput is grabbed Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_input_Mouse.c 16 Jan 2006 23:51:57 -0000 1.18 +++ org_lwjgl_input_Mouse.c 17 Jan 2006 07:18:02 -0000 1.19 @@ -500,13 +500,13 @@ buttons_buffer[j] = diMouseState.rgbButtons[j] != 0 ? JNI_TRUE : JNI_FALSE; } else { coords[2] = accum_dwheel; - accum_dwheel = 0; num_buttons = mButtoncount; if (num_buttons > BUTTON_STATES_SIZE) num_buttons = BUTTON_STATES_SIZE; for (j = 0; j < num_buttons; j++) buttons_buffer[j] = win32_message_button_states[j]; } + accum_dwheel = 0; if (mouse_grabbed) { coords[0] = diMouseState.lX; coords[1] = -diMouseState.lY; |
|
From: Elias N. <eli...@us...> - 2006-01-16 23:52:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18967 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: More experimental directinput stuff Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_input_Mouse.c 16 Jan 2006 23:09:58 -0000 1.17 +++ org_lwjgl_input_Mouse.c 16 Jan 2006 23:51:57 -0000 1.18 @@ -65,8 +65,6 @@ static bool mouse_grabbed; /* These accumulated deltas track the cursor position from Windows messages */ -static int accum_dx; -static int accum_dy; static int accum_dwheel; static int last_x; static int last_y; @@ -97,10 +95,6 @@ return putMouseEventWithCoords(button, state, last_x, last_y, dz); } -static void resetCursorPos(void) { - accum_dx = accum_dy = 0; -} - JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Win32Display_hasWheel(JNIEnv *env, jobject self) { return mHaswheel; } @@ -141,6 +135,18 @@ return true; } +static bool acquireMouse(DWORD flags) { + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), flags) == DI_OK) { + IDirectInputDevice_Acquire(mDIDevice); + return true; + } else + return false; +} + +static bool acquireMouseNonExclusive() { + return acquireMouse(DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) || acquireMouse(DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); +} + /** * Sets up the Mouse properties */ @@ -160,11 +166,10 @@ IDirectInputDevice_SetProperty(mDIDevice, DIPROP_BUFFERSIZE, &dipropdw.diph); // set the cooperative level - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { - throwException(env, "SetCooperativeLevel failed"); + if (!acquireMouseNonExclusive()) { + printfDebugJava(env, "SetCooperativeLevel failed"); return false; } - resetCursorPos(); return true; } @@ -176,7 +181,7 @@ initEventQueue(&event_queue, EVENT_SIZE); - last_x = last_y = accum_dx = accum_dy = accum_dwheel = 0; + last_x = last_y = accum_dwheel = 0; mouse_grabbed = false; // Create input @@ -221,8 +226,6 @@ y = transformY(y); dx = x - last_x; dy = y - last_y; - accum_dx += dx; - accum_dy += dy; last_x = x; last_y = y; if (mouse_grabbed) { @@ -393,18 +396,14 @@ if (!mouse_grabbed) { mouse_grabbed = true; IDirectInputDevice_Unacquire(mDIDevice); - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) + if (!acquireMouse(DISCL_EXCLUSIVE | DISCL_FOREGROUND)) printfDebugJava(env, "Failed to reset cooperative mode"); - IDirectInputDevice_Acquire(mDIDevice); } } else { if (mouse_grabbed) { mouse_grabbed = false; IDirectInputDevice_Unacquire(mDIDevice); - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) == DI_OK || - IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) == DI_OK) { - IDirectInputDevice_Acquire(mDIDevice); - } + acquireMouseNonExclusive(); } } initEventQueue(&event_queue, EVENT_SIZE); @@ -493,8 +492,6 @@ } } - coords[0] = diMouseState.lX; - coords[1] = -diMouseState.lY; coords[2] = diMouseState.lZ; num_buttons = mButtoncount; if (num_buttons > buttons_length) @@ -502,14 +499,19 @@ for (j = 0; j < num_buttons; j++) buttons_buffer[j] = diMouseState.rgbButtons[j] != 0 ? JNI_TRUE : JNI_FALSE; } else { - coords[0] = last_x; - coords[1] = last_y; coords[2] = accum_dwheel; - accum_dx = accum_dy = accum_dwheel = 0; + accum_dwheel = 0; num_buttons = mButtoncount; if (num_buttons > BUTTON_STATES_SIZE) num_buttons = BUTTON_STATES_SIZE; for (j = 0; j < num_buttons; j++) buttons_buffer[j] = win32_message_button_states[j]; } + if (mouse_grabbed) { + coords[0] = diMouseState.lX; + coords[1] = -diMouseState.lY; + } else { + coords[0] = last_x; + coords[1] = last_y; + } } |
|
From: Elias N. <eli...@us...> - 2006-01-16 23:10:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6420 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Quick test to see if we can get more accurate polling data from the mouse when not grabbed Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_input_Mouse.c 27 Dec 2005 13:40:21 -0000 1.16 +++ org_lwjgl_input_Mouse.c 16 Jan 2006 23:09:58 -0000 1.17 @@ -392,12 +392,19 @@ if(grab) { if (!mouse_grabbed) { mouse_grabbed = true; + IDirectInputDevice_Unacquire(mDIDevice); + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) + printfDebugJava(env, "Failed to reset cooperative mode"); IDirectInputDevice_Acquire(mDIDevice); } } else { if (mouse_grabbed) { mouse_grabbed = false; IDirectInputDevice_Unacquire(mDIDevice); + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_NONEXCLUSIVE | DISCL_FOREGROUND) == DI_OK || + IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_NONEXCLUSIVE | DISCL_BACKGROUND) == DI_OK) { + IDirectInputDevice_Acquire(mDIDevice); + } } } initEventQueue(&event_queue, EVENT_SIZE); @@ -467,8 +474,8 @@ return; } - if (mouse_grabbed) { - hRes = IDirectInputDevice_GetDeviceState(mDIDevice, sizeof(DIMOUSESTATE), &diMouseState); + hRes = IDirectInputDevice_GetDeviceState(mDIDevice, sizeof(DIMOUSESTATE), &diMouseState); + if (mouse_grabbed || hRes == DI_OK) { if (hRes != DI_OK) { // Don't allow the mouse to drift when failed diMouseState.lX = 0; |
|
From: Elias N. <eli...@us...> - 2006-01-16 21:17:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9764 Modified Files: macosx_al.c Log Message: Mac OS X: Cleanup of macosx_al.c Index: macosx_al.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/macosx_al.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- macosx_al.c 16 Jan 2006 19:35:09 -0000 1.2 +++ macosx_al.c 16 Jan 2006 21:17:12 -0000 1.3 @@ -53,14 +53,15 @@ static CFBundleRef openal_bundle = NULL; void *NativeGetFunctionPointer(const char *function) { - char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); void *address = NULL; - if (mac_symbol_name == NULL) - return NULL; - mac_symbol_name[0] = '_'; - strcpy(&(mac_symbol_name[1]), function); if (handleOAL != NULL) { + char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); + if (mac_symbol_name == NULL) + return NULL; + mac_symbol_name[0] = '_'; + strcpy(&(mac_symbol_name[1]), function); NSSymbol symbol = NSLookupSymbolInImage(handleOAL, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + free(mac_symbol_name); if (symbol != NULL) { address = NSAddressOfSymbol(symbol); } @@ -69,7 +70,6 @@ address = CFBundleGetFunctionPointerForName(openal_bundle, cf_function); CFRelease(cf_function); } - free(mac_symbol_name); return address; } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2006-01-16 21:06:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7202/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: Cleanup of unused imports Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- WindowCreationTest.java 21 Oct 2005 18:54:00 -0000 1.37 +++ WindowCreationTest.java 16 Jan 2006 21:06:00 -0000 1.38 @@ -31,17 +31,11 @@ */ package org.lwjgl.test; -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.IntBuffer; - -import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; -import org.lwjgl.util.XPMFile; /** * Small class for testing that the Window is creatable |
|
From: Caspian Rychlik-P. <ci...@us...> - 2006-01-16 21:05:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6940/src/java/org/lwjgl Modified Files: LWJGLUtil.java Sys.java LinuxSysImplementation.java MacOSXSysImplementation.java Log Message: Index: LinuxSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- LinuxSysImplementation.java 30 May 2005 16:21:03 -0000 1.5 +++ LinuxSysImplementation.java 16 Jan 2006 21:04:49 -0000 1.6 @@ -31,11 +31,9 @@ */ package org.lwjgl; -import java.io.IOException; - import java.security.AccessController; -import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; /** * $Id$ Index: MacOSXSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MacOSXSysImplementation.java 16 Jan 2006 20:37:28 -0000 1.4 +++ MacOSXSysImplementation.java 16 Jan 2006 21:04:49 -0000 1.5 @@ -32,7 +32,6 @@ package org.lwjgl; import java.lang.reflect.Method; - import java.security.AccessController; import java.security.PrivilegedExceptionAction; Index: LWJGLUtil.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LWJGLUtil.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- LWJGLUtil.java 16 Jan 2006 20:37:28 -0000 1.9 +++ LWJGLUtil.java 16 Jan 2006 21:04:49 -0000 1.10 @@ -34,14 +34,13 @@ import java.io.File; import java.lang.reflect.Method; import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; /** * $Id$ Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- Sys.java 16 Jan 2006 20:37:28 -0000 1.91 +++ Sys.java 16 Jan 2006 21:04:49 -0000 1.92 @@ -34,13 +34,12 @@ import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; - -import org.lwjgl.input.Mouse; - import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; +import org.lwjgl.input.Mouse; + /** * $Id$ * <p> |
|
From: Caspian Rychlik-P. <ci...@us...> - 2006-01-16 21:04:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6940/src/java/org/lwjgl/opengl Modified Files: MacOSXFrame.java GLContext.java Display.java LinuxCanvasImplementation.java Log Message: Index: LinuxCanvasImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- LinuxCanvasImplementation.java 30 May 2005 16:21:04 -0000 1.8 +++ LinuxCanvasImplementation.java 16 Jan 2006 21:04:49 -0000 1.9 @@ -34,7 +34,6 @@ import java.awt.GraphicsConfiguration; import java.awt.GraphicsDevice; import java.lang.reflect.Method; - import java.security.AccessController; import java.security.PrivilegedExceptionAction; Index: MacOSXFrame.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- MacOSXFrame.java 30 May 2005 16:21:04 -0000 1.13 +++ MacOSXFrame.java 16 Jan 2006 21:04:49 -0000 1.14 @@ -47,10 +47,9 @@ import java.awt.event.ComponentListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; - import java.security.AccessController; -import java.security.PrivilegedExceptionAction; import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import org.lwjgl.LWJGLException; Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- Display.java 2 Jan 2006 14:15:24 -0000 1.62 +++ Display.java 16 Jan 2006 21:04:49 -0000 1.63 @@ -45,11 +45,10 @@ import java.nio.ByteBuffer; import java.nio.FloatBuffer; -import java.util.Arrays; -import java.util.HashSet; - import java.security.AccessController; import java.security.PrivilegedAction; +import java.util.Arrays; +import java.util.HashSet; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- GLContext.java 12 Jan 2006 12:25:12 -0000 1.54 +++ GLContext.java 16 Jan 2006 21:04:49 -0000 1.55 @@ -32,17 +32,15 @@ package org.lwjgl.opengl; import java.lang.reflect.Method; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.StringTokenizer; import java.util.WeakHashMap; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; |
|
From: Elias N. <eli...@us...> - 2006-01-16 20:37:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv764/src/java/org/lwjgl Modified Files: DefaultSysImplementation.java LWJGLUtil.java MacOSXSysImplementation.java Sys.java SysImplementation.java Log Message: Mac OS X: Added loading of a legacy native lwjgl library to support applications that need to run on Mac OS X 10.2, 10.3 and 10.4, including intel mac versions. NOTE: Intel support from the universal build is not tested, since I don\'t have acces to an intel mac. Index: SysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/SysImplementation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SysImplementation.java 18 Jan 2005 20:22:45 -0000 1.1 +++ SysImplementation.java 16 Jan 2006 20:37:28 -0000 1.2 @@ -42,6 +42,12 @@ */ interface SysImplementation { /** + * Return an array of possible library names. later names + * tried last. + */ + public String[] getNativeLibraryNames(); + + /** * Return the version of the native library */ public String getNativeLibraryVersion(); Index: LWJGLUtil.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LWJGLUtil.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- LWJGLUtil.java 21 Oct 2005 18:52:45 -0000 1.8 +++ LWJGLUtil.java 16 Jan 2006 20:37:28 -0000 1.9 @@ -421,4 +421,28 @@ System.err.println(msg); } } + + /** + * Method to determine if the current system is running a version of + * Mac OS X better than the given version. This is only useful for Mac OS X + * specific code and will not work for any other platform. + */ + public static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) { + String os_version = System.getProperty("os.version"); + StringTokenizer version_tokenizer = new StringTokenizer(os_version, "."); + int major; + int minor; + try { + String major_str = version_tokenizer.nextToken(); + String minor_str = version_tokenizer.nextToken(); + major = Integer.parseInt(major_str); + minor = Integer.parseInt(minor_str); + } catch (Exception e) { + LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e); + // Best guess, no + return false; + } + return major > major_required || (major == major_required && minor >= minor_required); + } + } Index: MacOSXSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MacOSXSysImplementation.java 30 May 2005 16:21:03 -0000 1.3 +++ MacOSXSysImplementation.java 16 Jan 2006 20:37:28 -0000 1.4 @@ -43,6 +43,37 @@ * @version $Revision$ */ class MacOSXSysImplementation extends J2SESysImplementation { + public String[] getNativeLibraryNames() { + /* If we're on 10.4, fine, we'll just try the default library name. For + * earlier versions of Mac OS X, try the legacy library first. + * + * Having a kludge like this is unfortunate, but necessary for the following reasons: + * 1. We need two libraries to support Mac OS X 10.2, 10.3 and 10.4. We could + * cover 10.2, 10.3 and 10.4 with one gcc 3 compiled library, but then we + * loose intel mac support. Instead, we'll distribute two versions of the lwjgl + * native library, the default and a legacy one. + * 2. The default library will be universal ('fat') with both intel and powerpc support + * compiled in. This requires gcc 4, and makes the library unusable on Mac OS X 10.3 + * and earlier (actually 10.3.9 has the required gcc 4 libraries, but we'll ignore that). + * We could still choose to load the default library first, and the legacy one later, + * but a bug in the Mac OS X java implementation forces a java program to exit + * if the loaded library has a missing dependency (The correct behaviour is to throw + * an UnsatisfiedLinkError, like on linux and windows). + * 3. If the LWJGL program is launched with an intelligent ClassLoader, this issue can be avoided + * altogether, and the legacy library naming can be avoided too. For example, when + * using webstart, one can supply two nativelib references, one for Mac OS X 10.4 + * (the default library), and one for earlier Mac OS X (the legacy library). This is the + * preferred way to deploy the libraries. The legacy naming is for the users that don't want to + * mess around with libraries and classloaders. They can simply supply make sure that lwjgl.jar + * is in the classpath and that both the default library and the legacy library is in the native + * library path (java.library.path). + */ + if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) + return super.getNativeLibraryNames(); + else + return new String[]{LIBRARY_NAME + "-legacy", LIBRARY_NAME}; + } + public boolean openURL(String url) { try { Method openURL_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- Sys.java 19 Dec 2005 10:57:22 -0000 1.90 +++ Sys.java 16 Jan 2006 20:37:28 -0000 1.91 @@ -54,20 +54,31 @@ /** Current version of library */ private static final String VERSION = "0.99"; - /** The native library name */ - private static final String LIBRARY_NAME = "lwjgl"; - /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; - static { - implementation = createImplementation(); + private static void loadLibrary(final String name) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - System.loadLibrary(LIBRARY_NAME); + System.loadLibrary(name); return null; } }); + } + + static { + implementation = createImplementation(); + String[] library_names = implementation.getNativeLibraryNames(); + UnsatisfiedLinkError last_load_error = null; + for (int i = 0; i < library_names.length; i++) { + try { + loadLibrary(library_names[i]); + } catch (UnsatisfiedLinkError e) { + last_load_error = e; + } + } + if (last_load_error != null) + throw last_load_error; String native_version = implementation.getNativeLibraryVersion(); if (!native_version.equals(getVersion())) throw new LinkageError("Version mismatch: jar version is '" + getVersion() + Index: DefaultSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DefaultSysImplementation.java 20 Jan 2005 22:51:27 -0000 1.2 +++ DefaultSysImplementation.java 16 Jan 2006 20:37:28 -0000 1.3 @@ -39,6 +39,13 @@ * @version $Revision$ */ abstract class DefaultSysImplementation implements SysImplementation { + /** The native library name */ + protected static final String LIBRARY_NAME = "lwjgl"; + + public String[] getNativeLibraryNames() { + return new String[]{LIBRARY_NAME}; + } + public native String getNativeLibraryVersion(); public native void setDebug(boolean debug); |
|
From: Elias N. <eli...@us...> - 2006-01-16 20:37:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv764/src/java/org/lwjgl/opengl Modified Files: MacOSXDisplay.java Log Message: Mac OS X: Added loading of a legacy native lwjgl library to support applications that need to run on Mac OS X 10.2, 10.3 and 10.4, including intel mac versions. NOTE: Intel support from the universal build is not tested, since I don\'t have acces to an intel mac. Index: MacOSXDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- MacOSXDisplay.java 4 Nov 2005 12:38:59 -0000 1.38 +++ MacOSXDisplay.java 16 Jan 2006 20:37:28 -0000 1.39 @@ -283,28 +283,10 @@ * when the OS version is 10.3 or lower. */ private void hideUI(boolean hide) { - if (!isMacOSXEqualsOrBetterThan(10, 4)) + if (!LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) nHideUI(hide); } - private static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) { - String os_version = System.getProperty("os.version"); - StringTokenizer version_tokenizer = new StringTokenizer(os_version, "."); - int major; - int minor; - try { - String major_str = version_tokenizer.nextToken(); - String minor_str = version_tokenizer.nextToken(); - major = Integer.parseInt(major_str); - minor = Integer.parseInt(minor_str); - } catch (Exception e) { - LWJGLUtil.log("Exception occurred while trying to determine OS version: " + e); - // Best guess, no - return false; - } - return major > major_required || (major == major_required && minor >= minor_required); - } - private native void nHideUI(boolean hide); native void getMouseDeltas(IntBuffer delta_buffer); @@ -360,7 +342,7 @@ private native void nGrabMouse(boolean grab); public int getNativeCursorCapabilities() { - if (isMacOSXEqualsOrBetterThan(10, 4)) { + if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) { int cursor_colors = Toolkit.getDefaultToolkit().getMaximumCursorColors(); boolean supported = cursor_colors >= Short.MAX_VALUE && getMaxCursorSize() > 0; int caps = supported ? org.lwjgl.input.Cursor.CURSOR_8_BIT_ALPHA | org.lwjgl.input.Cursor.CURSOR_ONE_BIT_TRANSPARENCY: 0; @@ -455,7 +437,7 @@ } public int getPbufferCapabilities() { - if (isMacOSXEqualsOrBetterThan(10, 3)) + if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 3)) return Pbuffer.PBUFFER_SUPPORTED; else return 0; |
|
From: Elias N. <eli...@us...> - 2006-01-16 19:52:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22373/src/native/macosx Modified Files: context.m Log Message: Mac OS X: Ported OpenGL library code to use frameworks instead of accessing libGL.dylib directly Index: context.m =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/context.m,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- context.m 26 Aug 2005 15:11:21 -0000 1.4 +++ context.m 16 Jan 2006 19:52:40 -0000 1.5 @@ -37,36 +37,41 @@ * @version $Revision$ */ +#import <CoreFoundation/CoreFoundation.h> #import "context.h" -#import <Cocoa/Cocoa.h> -#import <Carbon/Carbon.h> - -#include <mach-o/dyld.h> -static const struct mach_header *opengl_lib_handle = NULL; - -void *extgl_GetProcAddress(const char *name) -{ - #define BUFFER_SIZE 1024 - char mach_name[BUFFER_SIZE] = "_"; - strncat(mach_name, name, BUFFER_SIZE - 1); +static CFBundleRef opengl_bundle = NULL; - NSSymbol sym = NSLookupSymbolInImage(opengl_lib_handle, mach_name, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - void *address = NSAddressOfSymbol(sym); +void *extgl_GetProcAddress(const char *name) { + CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8); + void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name); + CFRelease(cf_name); if (address == NULL) printfDebug("Could not locate symbol %s\n", name); return address; } -static const struct mach_header *loadImage(const char *lib_name) { - return NSAddImage(lib_name, NSADDIMAGE_OPTION_RETURN_ON_ERROR); +static CFBundleRef loadFramework(JNIEnv *env) { + CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenGL.framework"); + if (framework_path == NULL) { + printfDebugJava(env, "Failed to allocate string"); + return NULL; + } + CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE); + if (url == NULL) { + printfDebugJava(env, "Failed to allocate URL"); + return NULL; + } + CFBundleRef opengl_bundle = CFBundleCreate(NULL, url); + CFRelease(url); + return opengl_bundle; } bool extgl_Open(JNIEnv *env) { - if (opengl_lib_handle != NULL) + if (opengl_bundle != NULL) return true; - opengl_lib_handle = loadImage("/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib"); - if (opengl_lib_handle != NULL) { + opengl_bundle = loadFramework(env); + if (opengl_bundle != NULL) { return true; } else { throwException(env, "Could not load OpenGL library"); @@ -76,7 +81,10 @@ void extgl_Close(void) { - opengl_lib_handle = NULL; + if (opengl_bundle != NULL) { + CFRelease(opengl_bundle); + opengl_bundle = NULL; + } } NSOpenGLPixelFormat *choosePixelFormat(JNIEnv *env, jobject pixel_format, bool use_display_bpp, bool support_window, bool support_pbuffer, bool double_buffered) { |
|
From: Elias N. <eli...@us...> - 2006-01-16 19:35:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18829/src/java/org/lwjgl/openal Modified Files: AL.java Log Message: Mac OS X: Load the framework (builtin) version of OpenAL last, after having tried all possible locations of a private openal.dylib Index: AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- AL.java 16 Jan 2006 15:54:49 -0000 1.48 +++ AL.java 16 Jan 2006 19:35:09 -0000 1.49 @@ -66,6 +66,14 @@ * @param oalPaths Array of strings containing paths to search for OpenAL library */ private static native void nCreate(String oalPath) throws LWJGLException; + + /** + * Native method to create AL instance from the Mac OS X 10.4 OpenAL framework. + * It is only defined in the Mac OS X native library. + * + * @param oalPaths Array of strings containing paths to search for OpenAL library + */ + private static native void nCreateDefault() throws LWJGLException; /** * Native method the destroy the AL @@ -108,6 +116,11 @@ LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage()); } } + if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { + // Try to load OpenAL from the framework instead + nCreateDefault(); + created = true; + } if (!created) throw new LWJGLException("Could not locate OpenAL library."); |
|
From: Elias N. <eli...@us...> - 2006-01-16 19:35:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18829/src/native/macosx Modified Files: Makefile.legacy macosx_al.c Log Message: Mac OS X: Load the framework (builtin) version of OpenAL last, after having tried all possible locations of a private openal.dylib Index: Makefile.legacy =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/Makefile.legacy,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.legacy 16 Jan 2006 15:15:38 -0000 1.1 +++ Makefile.legacy 16 Jan 2006 19:35:09 -0000 1.2 @@ -1,7 +1,7 @@ # Use this makefile to build for Mac OS X 10.3 and earlier -CC=gcc-3.0 -LINKER=gcc-3.0 +CC=gcc-3.3 +LINKER=gcc-3.3 STRIP=strip ARCHS= SYMBOL_FILE=lwjgl.symbols Index: macosx_al.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/macosx_al.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- macosx_al.c 16 Jan 2006 15:54:50 -0000 1.1 +++ macosx_al.c 16 Jan 2006 19:35:09 -0000 1.2 @@ -97,10 +97,7 @@ printfDebugJava(env, "Found OpenAL at '%s'", path_str); } (*env)->ReleaseStringUTFChars(env, path, path_str); - openal_bundle = tryLoadFramework(env); - if (openal_bundle != NULL) - printfDebugJava(env, "Found OpenAL Bundle"); - return handleOAL != NULL || openal_bundle != NULL; + return handleOAL != NULL; } /** @@ -113,3 +110,10 @@ } } +JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreateDefault(JNIEnv *env, jclass clazz) { + openal_bundle = tryLoadFramework(env); + if (openal_bundle != NULL) + printfDebugJava(env, "Found OpenAL Bundle"); + else + throwException(env, "Could not load OpenAL framework"); +} |
|
From: Elias N. <eli...@us...> - 2006-01-16 18:37:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3797 Modified Files: Makefile Log Message: Mac OS X: Removed redundant -syslibroot from linker flags Index: Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Makefile 16 Jan 2006 15:15:38 -0000 1.10 +++ Makefile 16 Jan 2006 18:37:51 -0000 1.11 @@ -5,7 +5,7 @@ STRIP=strip SDK_ROOT=/Developer/SDKs/MacOSX10.4u.sdk ARCHS=-arch i386 -arch ppc -CFLAGS_LINK=-isysroot $(SDK_ROOT) -Wl,-syslibroot,$(SDK_ROOT) $(ARCHS) -exported_symbols_list lwjgl.symbols -dynamiclib -Wall +CFLAGS_LINK=-isysroot $(SDK_ROOT) $(ARCHS) -exported_symbols_list lwjgl.symbols -dynamiclib -Wall SYMBOL_FILE=lwjgl.symbols FRAMEWORKS=-framework Foundation -framework AppKit -framework JavaVM -framework Carbon CFLAGS_O=-isysroot $(SDK_ROOT) $(ARCHS) -fPIC -O2 -D_MACOSX -Wall -c -I$(SDK_ROOT)/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers -I../common -I$(SDK_ROOT)/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:58:33
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27677/src/native/common Modified Files: extal.h Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. Index: extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- extal.h 16 Jan 2006 15:54:49 -0000 1.38 +++ extal.h 16 Jan 2006 15:58:23 -0000 1.39 @@ -158,6 +158,7 @@ typedef void ALvoid; void* extal_GetProcAddress(const char* function); +void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); /* Platform dependent functions */ void *NativeGetFunctionPointer(const char *function); |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:55:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27148/src/native/common Added Files: extal.c Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. --- NEW FILE: extal.c --- /* * Copyright (c) 2002-2004 LWJGL 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 'LWJGL' 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. */ #include <jni.h> #include "extal.h" typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)(const ALubyte* fname); /* alGetProcAddress is commented out, since we don't use it anyway */ //static alGetProcAddressPROC alGetProcAddress = NULL; /** * Initializes OpenAL by loading the library */ /*void InitializeOpenAL(JNIEnv *env, jstring oalPath) { //load our library if (!tryLoadLibrary(env, oalPath)) { throwException(env, "Could not load openal library."); return; } alGetProcAddress = (alGetProcAddressPROC)NativeGetFunctionPointer("alGetProcAddress"); if (alGetProcAddress == NULL) { UnLoadOpenAL(); throwException(env, "Could not load alGetProcAddress function pointer."); return; } }*/ /** * Retrieves a pointer to the named function * * @param function Name of function * @return pointer to named function, or NULL if not found */ void* extal_GetProcAddress(const char* function) { void *p; /* p = alGetProcAddress((const ALubyte*)function); if (p == NULL) {*/ p = NativeGetFunctionPointer(function); if (p == NULL) { printfDebug("Could not locate symbol %s\n", function); } // } return p; } void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) { ext_InitializeClass(env, clazz, &extal_GetProcAddress, num_functions, functions); } |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:55:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26957/src/native/macosx Added Files: macosx_al.c Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. --- NEW FILE: macosx_al.c --- /* * Copyright (c) 2002-2004 LWJGL 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 'LWJGL' 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. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> #include <CoreFoundation/CoreFoundation.h> #include "extal.h" #include "common_tools.h" /** * $Id: macosx_al.c,v 1.1 2006/01/16 15:54:50 elias_naur Exp $ * * This file contains the AL extension assigning mechanism * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ static const struct mach_header* handleOAL = NULL; static CFBundleRef openal_bundle = NULL; void *NativeGetFunctionPointer(const char *function) { char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); void *address = NULL; if (mac_symbol_name == NULL) return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); if (handleOAL != NULL) { NSSymbol symbol = NSLookupSymbolInImage(handleOAL, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); if (symbol != NULL) { address = NSAddressOfSymbol(symbol); } } else if (openal_bundle != NULL) { CFStringRef cf_function = CFStringCreateWithCString(NULL, function, kCFStringEncodingUTF8); address = CFBundleGetFunctionPointerForName(openal_bundle, cf_function); CFRelease(cf_function); } free(mac_symbol_name); return address; } static CFBundleRef tryLoadFramework(JNIEnv *env) { CFStringRef framework_path = CFSTR("/System/Library/Frameworks/OpenAL.framework"); if (framework_path == NULL) { printfDebugJava(env, "Failed to allocate string"); return NULL; } CFURLRef url = CFURLCreateWithFileSystemPath(NULL, framework_path, kCFURLPOSIXPathStyle, TRUE); if (url == NULL) { printfDebugJava(env, "Failed to allocate URL"); return NULL; } CFBundleRef openal_bundle = CFBundleCreate(NULL, url); CFRelease(url); return openal_bundle; } bool tryLoadLibrary(JNIEnv *env, jstring path) { const char *path_str = (*env)->GetStringUTFChars(env, path, NULL); printfDebugJava(env, "Testing '%s'", path_str); handleOAL = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); if (handleOAL != NULL) { printfDebugJava(env, "Found OpenAL at '%s'", path_str); } (*env)->ReleaseStringUTFChars(env, path, path_str); openal_bundle = tryLoadFramework(env); if (openal_bundle != NULL) printfDebugJava(env, "Found OpenAL Bundle"); return handleOAL != NULL || openal_bundle != NULL; } /** * Unloads the OpenAL Library */ void UnLoadOpenAL() { if (openal_bundle != NULL) { CFRelease(openal_bundle); openal_bundle = NULL; } } |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:55:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26957/src/java/org/lwjgl/openal Modified Files: AL.java Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. Index: AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- AL.java 20 Oct 2005 21:46:20 -0000 1.47 +++ AL.java 16 Jan 2006 15:54:49 -0000 1.48 @@ -65,7 +65,7 @@ * * @param oalPaths Array of strings containing paths to search for OpenAL library */ - private static native void nCreate(String[] oalPaths) throws LWJGLException; + private static native void nCreate(String oalPath) throws LWJGLException; /** * Native method the destroy the AL @@ -99,8 +99,17 @@ "openal", "libopenal.so", "openal", "openal.dylib"}, AL.class.getClassLoader()); LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths"); - nCreate(oalPaths); - created = true; + for (int i = 0; i < oalPaths.length; i++) { + try { + nCreate(oalPaths[i]); + created = true; + break; + } catch (LWJGLException e) { + LWJGLUtil.log("Failed to load " + oalPaths[i] + ": " + e.getMessage()); + } + } + if (!created) + throw new LWJGLException("Could not locate OpenAL library."); try { AL10.initNativeStubs(); |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:54:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26957/src/native/win32 Added Files: win32_al.c Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. --- NEW FILE: win32_al.c --- /* * Copyright (c) 2002-2004 LWJGL 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 'LWJGL' 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. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include "extal.h" #include "common_tools.h" /** * $Id: win32_al.c,v 1.1 2006/01/16 15:54:50 elias_naur Exp $ * * This file contains the AL extension assigning mechanism * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ /* Handle to OpenAL Library */ static HMODULE handleOAL; void *NativeGetFunctionPointer(const char *function) { return GetProcAddress(handleOAL, function); } bool tryLoadLibrary(JNIEnv *env, jstring path) { char *path_str = GetStringNativeChars(env, path); printfDebugJava(env, "Testing '%s'", path_str); handleOAL = LoadLibrary(path_str); if (handleOAL != NULL) { printfDebugJava(env, "Found OpenAL at '%s'", path_str); } free(path_str); return handleOAL != NULL; } /** * Unloads the OpenAL Library */ void UnLoadOpenAL() { FreeLibrary(handleOAL); } |
|
From: Elias N. <eli...@us...> - 2006-01-16 15:54:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26957/src/native/common Modified Files: extal.h org_lwjgl_openal_AL.c Removed Files: extal.c Log Message: OpenAL: Split platform dependent code from extal.c into platform subdirs. Made nCreate take a path instead of an array of paths. Index: org_lwjgl_openal_AL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_AL.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_AL.c 12 Apr 2005 10:55:23 -0000 1.2 +++ org_lwjgl_openal_AL.c 16 Jan 2006 15:54:49 -0000 1.3 @@ -30,17 +30,18 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <jni.h> #include "org_lwjgl_openal_AL.h" - -/* OpenAL includes */ #include "extal.h" -JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate (JNIEnv *env, jclass clazz, jobjectArray oalPaths) { - InitializeOpenAL(env, oalPaths); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nCreate(JNIEnv *env, jclass clazz, jstring oalPath) { + if (!tryLoadLibrary(env, oalPath)) { + throwException(env, "Could not load OpenAL library"); + } } JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_nDestroy(JNIEnv *env, jclass clazz) { - DeInitializeOpenAL(); + UnLoadOpenAL(); } JNIEXPORT void JNICALL Java_org_lwjgl_openal_AL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass al_class) { --- extal.c DELETED --- Index: extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- extal.h 20 Nov 2005 13:47:45 -0000 1.37 +++ extal.h 16 Jan 2006 15:54:49 -0000 1.38 @@ -44,8 +44,6 @@ extern "C" { #endif -void extal_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); - #if defined(_WIN32) #ifdef _OPENAL32LIB #define ALCAPI __declspec(dllexport) @@ -159,11 +157,12 @@ /** void type (for opaque pointers only) */ typedef void ALvoid; +void* extal_GetProcAddress(const char* function); -void InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths); -void DeInitializeOpenAL(); - -//extern alGetProcAddressPROC alGetProcAddress; +/* Platform dependent functions */ +void *NativeGetFunctionPointer(const char *function); +bool tryLoadLibrary(JNIEnv *env, jstring path); +void UnLoadOpenAL(); #ifdef __cplusplus } |