You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
1
|
|
2
|
3
(2) |
4
|
5
|
6
(8) |
7
|
8
|
|
9
(8) |
10
(7) |
11
(11) |
12
(7) |
13
(8) |
14
(8) |
15
(5) |
|
16
(3) |
17
|
18
(51) |
19
(9) |
20
(6) |
21
(3) |
22
(3) |
|
23
(2) |
24
|
25
(17) |
26
(1) |
27
(4) |
28
(5) |
29
(4) |
|
30
(1) |
31
(1) |
|
|
|
|
|
Update of /cvsroot/java-game-lib/LWJGL/www/_gfx/projects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27944 Added Files: puppytron_1.jpg puppytron_2.jpg puppytron_3.jpg puppytron_small_1.jpg puppytron_small_2.jpg puppytron_small_3.jpg Log Message: added puppytron --- NEW FILE: puppytron_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: puppytron_small_2.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: puppytron_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: puppytron_1.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: puppytron_small_3.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: puppytron_small_1.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: Elias N. <eli...@us...> - 2005-01-10 09:21:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv810/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Fixes for previous commit 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.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_input_Mouse.c 10 Jan 2005 08:48:13 -0000 1.7 +++ org_lwjgl_input_Mouse.c 10 Jan 2005 09:21:35 -0000 1.8 @@ -179,6 +179,7 @@ last_x = last_y = accum_dx = accum_dy = accum_dwheel = 0; buffer_enabled = false; + mouse_grabbed = false; // Create input ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); @@ -205,11 +206,6 @@ ShutdownMouse(); return; } - /* Aquire the Mouse */ - ret = IDirectInputDevice_Acquire(mDIDevice); - if(FAILED(ret)) { - printfDebug("Failed to acquire mouse\n"); - } created = true; } @@ -247,7 +243,7 @@ if(created) { putMouseEvent(button, state, 0); if (button < BUTTON_STATES_SIZE) - win32_message_button_states[button] = state != 0 : JNI_TRUE: JNI_FALSE; + win32_message_button_states[button] = state != 0 ? JNI_TRUE: JNI_FALSE; } } @@ -386,13 +382,11 @@ if(grab) { if (!mouse_grabbed) { mouse_grabbed = true; - ShowCursor(false); IDirectInputDevice_Acquire(mDIDevice); } } else { if (mouse_grabbed) { mouse_grabbed = false; - ShowCursor(true); IDirectInputDevice_Unacquire(mDIDevice); } } |
|
From: Elias N. <eli...@us...> - 2005-01-10 08:48:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26459/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: I've discovered that at least one Win XP configuration doesn't support the DirectInput cooperative level NONEXCLUSIVE | FOREGROUND for mouse devices. Fortunately, we don't really need that coop level anyway, so I have replaced it with Unacquire/Acquire. 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.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_input_Mouse.c 6 Jan 2005 13:07:30 -0000 1.6 +++ org_lwjgl_input_Mouse.c 10 Jan 2005 08:48:13 -0000 1.7 @@ -49,6 +49,8 @@ #define EVENT_SIZE 5 +#define BUTTON_STATES_SIZE 7 + extern HINSTANCE dll_handle; // Handle to the LWJGL dll static LPDIRECTINPUT lpdi = NULL; // DirectInput static LPDIRECTINPUTDEVICE mDIDevice; // DI Device instance @@ -58,8 +60,9 @@ static bool mFirstTimeInitialization = true; // boolean to determine first time initialization static bool created = false; +static jboolean win32_message_button_states[BUTTON_STATES_SIZE]; + static bool mouse_grabbed; -static int mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; /* These accumulated deltas track the cursor position from Windows messages */ static int accum_dx; @@ -112,12 +115,12 @@ */ static bool EnumerateMouseCapabilities(JNIEnv *env) { HRESULT hr; - hr = IDirectInputDevice_EnumObjects(mDIDevice, EnumMouseObjectsCallback, NULL, DIDFT_ALL); + hr = IDirectInputDevice_EnumObjects(mDIDevice, EnumMouseObjectsCallback, NULL, DIDFT_ALL); if FAILED(hr) { throwException(env, "EnumObjects failed"); return false; } - + //check for > 4 buttons - need to clamp since we're using dx 5 if(mButtoncount > 4) { mButtoncount = 4; @@ -145,7 +148,7 @@ static bool SetupMouse(JNIEnv *env) { DIPROPDWORD dipropdw; // set Mouse data format - if(IDirectInputDevice_SetDataFormat(mDIDevice, &c_dfDIMouse) != DI_OK) { + if(IDirectInputDevice_SetDataFormat(mDIDevice, &c_dfDIMouse) != DI_OK) { throwException(env, "SetDataFormat failed"); return false; } @@ -155,10 +158,10 @@ dipropdw.diph.dwObj = 0; dipropdw.diph.dwHow = DIPH_DEVICE; dipropdw.dwData = EVENT_BUFFER_SIZE; - IDirectInputDevice_SetProperty(mDIDevice, DIPROP_BUFFERSIZE, &dipropdw.diph); + IDirectInputDevice_SetProperty(mDIDevice, DIPROP_BUFFERSIZE, &dipropdw.diph); // set the cooperative level - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { throwException(env, "SetCooperativeLevel failed"); return false; } @@ -170,7 +173,7 @@ * Called when the Mouse instance is to be created */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createMouse(JNIEnv *env, jobject self) { - HRESULT ret; + HRESULT ret; initEventQueue(&event_queue, EVENT_SIZE); @@ -178,7 +181,7 @@ buffer_enabled = false; // Create input - ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); + ret = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &lpdi, NULL); if (ret != DI_OK && ret != DIERR_BETADIRECTINPUTVERSION) { throwException(env, "Failed to create DirectInput"); return; @@ -202,9 +205,9 @@ ShutdownMouse(); return; } - /* Aquire the Mouse */ - ret = IDirectInputDevice_Acquire(mDIDevice); - if(FAILED(ret)) { + /* Aquire the Mouse */ + ret = IDirectInputDevice_Acquire(mDIDevice); + if(FAILED(ret)) { printfDebug("Failed to acquire mouse\n"); } created = true; @@ -222,12 +225,12 @@ } void handleMouseMoved(int x, int y) { - int dx; - int dy; + int dx; + int dy; if(created) { y = transformY(y); - dx = x - last_x; - dy = y - last_y; + dx = x - last_x; + dy = y - last_y; accum_dx += dx; accum_dy += dy; last_x = x; @@ -243,6 +246,8 @@ void handleMouseButton(int button, int state) { if(created) { putMouseEvent(button, state, 0); + if (button < BUTTON_STATES_SIZE) + win32_message_button_states[button] = state != 0 : JNI_TRUE: JNI_FALSE; } } @@ -291,15 +296,15 @@ HRESULT ret; - ret = IDirectInputDevice_Acquire(mDIDevice); + ret = IDirectInputDevice_Acquire(mDIDevice); if (ret != DI_OK && ret != S_FALSE) return; - ret = IDirectInputDevice_GetDeviceData(mDIDevice, - sizeof(DIDEVICEOBJECTDATA), - rgdod, - &num_di_events, - 0); + ret = IDirectInputDevice_GetDeviceData(mDIDevice, + sizeof(DIDEVICEOBJECTDATA), + rgdod, + &num_di_events, + 0); if (ret == DI_OK) { copyDXEvents(num_di_events, rgdod); @@ -323,8 +328,8 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Win32Display_readMouse (JNIEnv * env, jobject self, jobject buffer_obj, jint buffer_position) { - jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer_obj) + buffer_position; - int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer_obj))/sizeof(jint) - buffer_position; + jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer_obj) + buffer_position; + int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer_obj))/sizeof(jint) - buffer_position; if (mouse_grabbed) { readDXBuffer(); } else { @@ -342,13 +347,11 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_setNativeCursor (JNIEnv *env, jobject self, jobject handle_buffer) { - HCURSOR *cursor_handle; - HCURSOR cursor; - if (mDIDevice == NULL) - throwException(env, "null device!"); + HCURSOR *cursor_handle; + HCURSOR cursor; if (handle_buffer != NULL) { - cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer); - cursor = *cursor_handle; + cursor_handle = (HCURSOR *)(*env)->GetDirectBufferAddress(env, handle_buffer); + cursor = *cursor_handle; SetClassLong(getCurrentHWND(), GCL_HCURSOR, (LONG)cursor); SetCursor(cursor); } else { @@ -374,46 +377,25 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_pollMouse(JNIEnv * env, jobject self, jobject coord_buffer_obj, jobject button_buffer_obj) { - IDirectInputDevice_Acquire(mDIDevice); - UpdateMouseFields(env, coord_buffer_obj, button_buffer_obj); + UpdateMouseFields(env, coord_buffer_obj, button_buffer_obj); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse (JNIEnv * env, jobject self, jboolean grab) { HRESULT di_res; - IDirectInputDevice_Unacquire(mDIDevice); if(grab) { if (!mouse_grabbed) { mouse_grabbed = true; ShowCursor(false); - mouseMask = DISCL_EXCLUSIVE | DISCL_FOREGROUND; + IDirectInputDevice_Acquire(mDIDevice); } } else { if (mouse_grabbed) { mouse_grabbed = false; ShowCursor(true); - mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; + IDirectInputDevice_Unacquire(mDIDevice); } } - di_res = IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask); - switch (di_res) { - case DI_OK: - break; - case DIERR_INVALIDPARAM: - throwException(env, "Could not set the CooperativeLevel (DIERR_INVALIDPARAM)."); - return; - case DIERR_NOTINITIALIZED: - throwException(env, "Could not set the CooperativeLevel (DIERR_NOTINITIALIZED)."); - return; - case E_HANDLE: - throwException(env, "Could not set the CooperativeLevel (E_HANDLE)."); - return; - default: - printfDebugJava(env, "Failed to set cooperative level with unknown error code %x", di_res); - throwException(env, "Could not set the CooperativeLevel (Unknown error code)."); - return; - } - IDirectInputDevice_Acquire(mDIDevice); initEventQueue(&event_queue, EVENT_SIZE); } @@ -423,14 +405,15 @@ static void ShutdownMouse() { // release device if (mDIDevice != NULL) { - IDirectInputDevice_Unacquire(mDIDevice); - IDirectInputDevice_Release(mDIDevice); + printfDebug("Releasing mouse DI device\n"); + IDirectInputDevice_Unacquire(mDIDevice); + IDirectInputDevice_Release(mDIDevice); mDIDevice = NULL; } // Release DirectInput if (lpdi != NULL) { - printfDebug("Destroying directinput\n"); - IDirectInput_Release(lpdi); + printfDebug("Releasing directinput\n"); + IDirectInput_Release(lpdi); lpdi = NULL; } created = false; @@ -441,11 +424,11 @@ */ static BOOL CALLBACK EnumMouseObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef) { printfDebug("found %s\n", lpddoi->tszName); - if(IsEqualGUID(&lpddoi->guidType, &GUID_Button)) { + if(IsEqualGUID(&lpddoi->guidType, &GUID_Button)) { mButtoncount++; - } else if(IsEqualGUID(&lpddoi->guidType, &GUID_XAxis)) { - } else if(IsEqualGUID(&lpddoi->guidType, &GUID_YAxis)) { - } else if(IsEqualGUID(&lpddoi->guidType, &GUID_ZAxis)) { + } else if(IsEqualGUID(&lpddoi->guidType, &GUID_XAxis)) { + } else if(IsEqualGUID(&lpddoi->guidType, &GUID_YAxis)) { + } else if(IsEqualGUID(&lpddoi->guidType, &GUID_ZAxis)) { mHaswheel = true; } else { printfDebug("Unhandled object found: %s\n", lpddoi->tszName); @@ -468,13 +451,13 @@ static void UpdateMouseFields(JNIEnv *env, jobject coord_buffer_obj, jobject button_buffer_obj) { HRESULT hRes; DIMOUSESTATE diMouseState; // State of Mouse - int i, j; + int i, j; - int *coords = (int *)(*env)->GetDirectBufferAddress(env, coord_buffer_obj); - int coords_length = (int)(*env)->GetDirectBufferCapacity(env, coord_buffer_obj); - unsigned char *buttons_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, button_buffer_obj); - int num_buttons; - int buttons_length = (int)(*env)->GetDirectBufferCapacity(env, button_buffer_obj); + int *coords = (int *)(*env)->GetDirectBufferAddress(env, coord_buffer_obj); + int coords_length = (int)(*env)->GetDirectBufferCapacity(env, coord_buffer_obj); + unsigned char *buttons_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, button_buffer_obj); + int num_buttons; + int buttons_length = (int)(*env)->GetDirectBufferCapacity(env, button_buffer_obj); if (coords_length < 3) { printfDebug("ERROR: Not enough space in coords array: %d < 3\n", coords_length); return; @@ -482,46 +465,42 @@ handleMessages(); - // get data from the Mouse - hRes = IDirectInputDevice_GetDeviceState(mDIDevice, sizeof(DIMOUSESTATE), &diMouseState); - if (hRes != DI_OK) { - // Don't allow the mouse to drift when failed - diMouseState.lX = 0; - diMouseState.lY = 0; - diMouseState.lZ = 0; - // did the read fail because we lost input for some reason? - // if so, then attempt to reacquire. - if(hRes == DIERR_INPUTLOST || hRes == DIERR_NOTACQUIRED) { - hRes = IDirectInputDevice_Acquire(mDIDevice); - if (hRes != DI_OK) + if (mouse_grabbed) { + hRes = IDirectInputDevice_GetDeviceState(mDIDevice, sizeof(DIMOUSESTATE), &diMouseState); + if (hRes != DI_OK) { + // Don't allow the mouse to drift when failed + diMouseState.lX = 0; + diMouseState.lY = 0; + diMouseState.lZ = 0; + // did the read fail because we lost input for some reason? + // if so, then attempt to reacquire. + if(hRes == DIERR_INPUTLOST || hRes == DIERR_NOTACQUIRED) { + hRes = IDirectInputDevice_Acquire(mDIDevice); + if (hRes != DI_OK) + return; + } else { + printfDebug("Error getting mouse state: %d\n", hRes); return; - } else { - printfDebug("Error getting mouse state: %d\n", hRes); - return; + } } - } - if (mouse_grabbed) { coords[0] = diMouseState.lX; coords[1] = -diMouseState.lY; coords[2] = diMouseState.lZ; + num_buttons = mButtoncount; + if (num_buttons > buttons_length) + num_buttons = buttons_length; + 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; + 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]; } - - for (i = 0; i < mButtoncount; i++) { - if (diMouseState.rgbButtons[i] != 0) { - diMouseState.rgbButtons[i] = JNI_TRUE; - } else { - diMouseState.rgbButtons[i] = JNI_FALSE; - } - } - num_buttons = mButtoncount; - if (num_buttons > buttons_length) - num_buttons = buttons_length; - for (j = 0; j < num_buttons; j++) - buttons_buffer[j] = (unsigned char)diMouseState.rgbButtons[j]; } |
|
From: Elias N. <eli...@us...> - 2005-01-10 08:19:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20677/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: Removed enableBuffer() and enableTranslation() from the public API. Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- Display.java 6 Jan 2005 14:22:25 -0000 1.37 +++ Display.java 10 Jan 2005 08:19:27 -0000 1.38 @@ -565,7 +565,6 @@ if (!Mouse.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Display.nomouse")) { try { Mouse.create(); - Mouse.enableBuffer(); } catch (LWJGLException e) { if (Sys.DEBUG) { e.printStackTrace(System.err); @@ -577,8 +576,6 @@ if (!Keyboard.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Display.nokeyboard")) { try { Keyboard.create(); - Keyboard.enableBuffer(); - Keyboard.enableTranslation(); } catch (LWJGLException e) { if (Sys.DEBUG) { e.printStackTrace(System.err); |
|
From: Elias N. <eli...@us...> - 2005-01-10 08:19:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20677/src/java/org/lwjgl/test/input Modified Files: KeyboardTest.java Log Message: Removed enableBuffer() and enableTranslation() from the public API. Index: KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- KeyboardTest.java 22 Jul 2004 14:56:40 -0000 1.29 +++ KeyboardTest.java 10 Jan 2005 08:19:28 -0000 1.30 @@ -127,8 +127,6 @@ private void createKeyboard() { try { Keyboard.create(); - Keyboard.enableBuffer(); - Keyboard.enableTranslation(); } catch (Exception e) { e.printStackTrace(); System.exit(-1); |
|
From: Elias N. <eli...@us...> - 2005-01-10 08:19:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20677/src/java/org/lwjgl/input Modified Files: Keyboard.java Mouse.java Log Message: Removed enableBuffer() and enableTranslation() from the public API. Index: Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- Keyboard.java 25 Nov 2004 22:16:46 -0000 1.55 +++ Keyboard.java 10 Jan 2005 08:19:26 -0000 1.56 @@ -48,8 +48,6 @@ * <br> * A raw Keyboard interface. This can be used to poll the current state of the * keys, or read all the keyboard presses / releases since the last read. - * Buffering must be explicitly enabled; the size of the buffer is determined - * by the native implementation at its discretion. * * @author cix_foo <ci...@us...> * @author elias_naur <eli...@us...> @@ -244,7 +242,7 @@ /** * The key events from the last read: a sequence of pairs of key number, - * followed by state. If translation is enabled, the state is followed by + * followed by state. The state is followed by * a 2 byte java char representing the translated character. */ private static IntBuffer readBuffer; @@ -295,6 +293,8 @@ return; Display.getImplementation().createKeyboard(); created = true; + enableBuffer(); + enableTranslation(); } /** @@ -318,11 +318,9 @@ * Polls the keyboard for its current state. Access the polled values using the * <code>isKeyDown</code> method. * By using this method, it is possible to "miss" keyboard keys if you don't - * poll fast enough. To receive all events, enable buffering by calling - * <code>enableBuffer</code>. + * poll fast enough. * - * This method also reads all keyboard events since last read if keyboard buffering is enabled. - * To use these values, you have to call <code>next</code> for each event you + * To use buffered values, you have to call <code>next</code> for each event you * want to read. You can query which key caused the event by using * <code>getEventKey</code>. To get the state of that key, for that event, use * <code>getEventKeyState</code> - finally use <code>getEventCharacter</code> to get the @@ -331,7 +329,6 @@ * @see org.lwjgl.input.Keyboard#isKeyDown(int key) * @see org.lwjgl.input.Keyboard#isStateKeySet(int key) * @see org.lwjgl.input.Keyboard#next() - * @see org.lwjgl.input.Keyboard#enableBuffer() * @see org.lwjgl.input.Keyboard#getEventKey() * @see org.lwjgl.input.Keyboard#getEventKeyState() * @see org.lwjgl.input.Keyboard#getEventCharacter() @@ -355,7 +352,7 @@ * Enable keyboard translation. Must be called after the keyboard is created, * and keyboard buffering must be enabled. */ - public static void enableTranslation() throws LWJGLException { + private static void enableTranslation() throws LWJGLException { if (!created) throw new IllegalStateException("Keyboard must be created before you can read events"); if (readBuffer == null) @@ -367,7 +364,7 @@ /** * Enable keyboard buffering. Must be called after the keyboard is created. */ - public static void enableBuffer() throws LWJGLException { + private static void enableBuffer() throws LWJGLException { if (!created) throw new IllegalStateException("Keyboard must be created before you can enable buffering"); readBuffer = BufferUtils.createIntBuffer(EVENT_SIZE*BUFFER_SIZE); @@ -387,20 +384,6 @@ } /** - * @return true if buffering is enabled - */ - public static boolean isBuffered() { - return readBuffer != null; - } - - /** - * @return true if translation is enabled - */ - public static boolean isTranslationEnabled() { - return translationEnabled; - } - - /** * Checks whether one of the state keys are "active" * * @param key State key to test (KEY_CAPITAL | KEY_NUMLOCK | KEY_SYSRQ) Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- Mouse.java 7 Dec 2004 21:50:30 -0000 1.71 +++ Mouse.java 10 Jan 2005 08:19:27 -0000 1.72 @@ -270,6 +270,7 @@ if (currentCursor != null) setNativeCursor(currentCursor); setGrabbed(isGrabbed); + enableBuffer(); } /** @@ -280,13 +281,6 @@ } /** - * @return true if buffering is enabled - */ - public static boolean isBuffered() { - return readBuffer != null; - } - - /** * "Destroy" the mouse. */ public static void destroy() { @@ -302,11 +296,9 @@ * Polls the mouse for its current state. Access the polled values using the * get<value> methods. * By using this method, it is possible to "miss" mouse click events if you don't - * poll fast enough. To receive all button events, enable buffering by calling - * <code>enableBuffer</code>. + * poll fast enough. * - * If buffering is enabled, this method also reads all button events since last read. - * To use these values, you have to call <code>next</code> for each event you + * To use buffered values, you have to call <code>next</code> for each event you * want to read. You can query which button caused the event by using * <code>getEventButton</code>. To get the state of that button, for that event, use * <code>getEventButtonState</code>. @@ -320,7 +312,6 @@ * @see org.lwjgl.input.Mouse#getDX() * @see org.lwjgl.input.Mouse#getDY() * @see org.lwjgl.input.Mouse#getDWheel() - * @see org.lwjgl.input.Mouse#enableBuffer() */ public static void poll() { if (!created) throw new IllegalStateException("Mouse must be created before you can poll it"); @@ -396,7 +387,7 @@ /** * Enable mouse button buffering. Must be called after the mouse is created. */ - public static void enableBuffer() throws LWJGLException { + private static void enableBuffer() throws LWJGLException { if (!created) throw new IllegalStateException("Mouse must be created before you can enable buffering"); readBuffer = BufferUtils.createIntBuffer(EVENT_SIZE * BUFFER_SIZE); readBuffer.limit(0); |
|
From: Mark B. <cap...@us...> - 2005-01-09 23:59:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19243/src/java/org/lwjgl/test/devil Modified Files: BasicTest.java Log Message: iluGetImageInfo now working. Index: BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil/BasicTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- BasicTest.java 9 Jan 2005 04:59:50 -0000 1.5 +++ BasicTest.java 9 Jan 2005 23:59:33 -0000 1.6 @@ -39,7 +39,7 @@ import java.nio.IntBuffer; /** * $Id$ - * <p>The core DevIL API.</p> + * <p>The core DevIL and ILU API.</p> * * @author Mark Bernard <cap...@us...> * @version $Revision$ @@ -54,8 +54,7 @@ e.printStackTrace(); System.exit(0); } - String err = ILU.iluErrorString(IL.ilGetError()); - System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); System.out.println("ilGenImages"); IntBuffer im = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); IL.ilGenImages(1, im); @@ -63,21 +62,18 @@ IL.ilBindImage(im.get(0)); IL.ilEnable(IL.IL_ORIGIN_SET); IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); - err = ILU.iluErrorString(IL.ilGetError()); - System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); String imageFile = "F:/Apps/Java/eclipse/workspace/LWJGL/res/ILtest.tga"; URL imageURL = BasicTest.class.getResource("/res/ILtest.tga"); System.out.println("ilLoadFromURL " + imageURL); System.out.println("load lump = " + IL.ilLoadFromURL(imageURL)); - err = ILU.iluErrorString(IL.ilGetError()); - System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); int newIm = IL.ilCloneCurImage(); IL.ilCopyImage(im.get(0)); IL.ilBindImage(newIm); ByteBuffer buf = IL.ilGetData(); System.out.println("ilGetData"); - err = ILU.iluErrorString(IL.ilGetError()); - System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); int limit = buf.limit(); System.out.println("limit = " + limit); for(int i=0;i<buf.limit();i+=3) { @@ -86,7 +82,30 @@ System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); - err = ILU.iluErrorString(IL.ilGetError()); - System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + + ILinfo info = new ILinfo(); + ILU.iluGetImageInfo(info); + System.out.println("info.id = " + info.id); + System.out.println("info.width = " + info.width); + System.out.println("info.height = " + info.height); + System.out.println("info.depth = " + info.depth); + System.out.println("info.bpp = " + info.bpp); + System.out.println("info.sizeOfData = " + info.sizeOfData); + System.out.println("info.format = " + info.format); + System.out.println("info.type = " + info.type); + System.out.println("info.origin = " + info.origin); + System.out.println("info.palType = " + info.palType); + System.out.println("info.palSize = " + info.palSize); + System.out.println("info.numNext = " + info.numNext); + System.out.println("info.numMips = " + info.numMips); + System.out.println("info.numLayers = " + info.numLayers); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + +// ILpointf pointf[] = new ILpointf[3]; +// ILU.iluRegionfv(pointf, pointf.length); +// for(int i=0;i<pointf.length;i++) { +// System.out.println("point[" + i + "] x = " + pointf[i].x + " y = " + pointf[i].y); +// } } } |
|
From: Mark B. <cap...@us...> - 2005-01-09 23:59:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19243/src/java/org/lwjgl/devil Modified Files: ILinfo.java ILpointf.java ILU.java ILpointi.java Log Message: iluGetImageInfo now working. Index: ILinfo.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILinfo.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ILinfo.java 9 Jan 2005 04:59:50 -0000 1.1 +++ ILinfo.java 9 Jan 2005 23:59:32 -0000 1.2 @@ -32,25 +32,29 @@ package org.lwjgl.devil; /** - * @author Mark Bernard - * date: 3-Jan-2005 + * $Id$ + * + * ILinfo information holding class. + * + * @author captainjester <cap...@us...> + * @version $Revision$ */ public class ILinfo { - public int Id; // the image's id - public byte Data[]; // the image's data - public int Width; // the image's width - public int Height; // the image's height - public int Depth; // the image's depth - public byte Bpp; // bytes per pixel (not bits) of the image - public int SizeOfData; // the total size of the data (in bytes) - public int Format; // image format (in IL enum style) - public int Type; // image type (in IL enum style) - public int Origin; // origin of the image - public byte Palette[]; // the image's palette - public int PalType; // palette type - public int PalSize; // palette size - public int CubeFlags; // flags for what cube map sides are present - public int NumNext; // number of images following - public int NumMips; // number of mipmaps - public int NumLayers; // number of layers + public int id; // the image's id + public byte data[]; // the image's data + public int width; // the image's width + public int height; // the image's height + public int depth; // the image's depth + public byte bpp; // bytes per pixel (not bits) of the image + public int sizeOfData; // the total size of the data (in bytes) + public int format; // image format (in IL enum style) + public int type; // image type (in IL enum style) + public int origin; // origin of the image + public byte palette[]; // the image's palette + public int palType; // palette type + public int palSize; // palette size + public int cubeFlags; // flags for what cube map sides are present + public int numNext; // number of images following + public int numMips; // number of mipmaps + public int numLayers; // number of layers } Index: ILpointi.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILpointi.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ILpointi.java 9 Jan 2005 04:59:50 -0000 1.1 +++ ILpointi.java 9 Jan 2005 23:59:33 -0000 1.2 @@ -32,8 +32,12 @@ package org.lwjgl.devil; /** - * @author Mark Bernard - * date: 3-Jan-2005 + * $Id$ + * + * ILpointi information holding class. + * + * @author captainjester <cap...@us...> + * @version $Revision$ */ public class ILpointi { public int x; Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ILU.java 9 Jan 2005 04:59:50 -0000 1.1 +++ ILU.java 9 Jan 2005 23:59:33 -0000 1.2 @@ -37,8 +37,12 @@ import org.lwjgl.LWJGLException; /** - * @author Mark Bernard - * date: 3-Jan-2005 + * $Id$ + * + * The DevIL ILU API. + * + * @author captainjester <cap...@us...> + * @version $Revision$ */ public class ILU { /** Have we been created? */ @@ -111,9 +115,7 @@ public static native boolean iluFlipImage(); public static native boolean iluGammaCorrect(float gamma); public static native int iluGenImage(); - // TODO result placed in a pointer - // TODO implement -// public static native void iluGetImageInfo(ILinfo info[]); + public static native void iluGetImageInfo(ILinfo info); public static native int iluGetInteger(int mode); public static void iluGetIntegerv(int mode, IntBuffer param) { BufferChecks.checkDirect(param); @@ -130,11 +132,9 @@ public static native boolean iluNoisify(float tolerance); public static native boolean iluPixelize(int pixSize); // TODO result placed in a pointer - // TODO implement // public static native void iluRegionfv(ILpointf points[], int n); // TODO result placed in a pointer - // TODO implement -// public static native void iluRegioniv(ILpointi points[], int n); +// public static native void iluRegioniv(ILpointi points[], int n); public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); public static native boolean iluRotate(float angle); Index: ILpointf.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILpointf.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ILpointf.java 9 Jan 2005 04:59:50 -0000 1.1 +++ ILpointf.java 9 Jan 2005 23:59:33 -0000 1.2 @@ -32,8 +32,12 @@ package org.lwjgl.devil; /** - * @author Mark Bernard - * date: 3-Jan-2005 + * $Id$ + * + * ILpointf information holding class. + * + * @author captainjester <cap...@us...> + * @version $Revision$ */ public class ILpointf { public float x; |
|
From: Mark B. <cap...@us...> - 2005-01-09 05:00:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238/src/native/common/devil Modified Files: extil.h .cvsignore Added Files: org_lwjgl_devil_ILU.c Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. Index: .cvsignore =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .cvsignore 7 Nov 2004 16:35:16 -0000 1.1 +++ .cvsignore 9 Jan 2005 04:59:48 -0000 1.2 @@ -1 +1,2 @@ org_lwjgl_devil_IL.h +org_lwjgl_devil_ILU.h Index: extil.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- extil.h 12 Dec 2004 10:13:54 -0000 1.3 +++ extil.h 9 Jan 2005 04:59:48 -0000 1.4 @@ -5,7 +5,9 @@ #include <stdio.h> #include <string.h> #include <IL/il.h> +#include <IL/ilu.h> #include "org_lwjgl_devil_IL.h" +#include "org_lwjgl_devil_ILU.h" #include "common_tools.h" --- NEW FILE: org_lwjgl_devil_ILU.c --- #include "extil.h" /* * Class: org_lwjgl_devil_ILU * Method: iluAlienify * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluAlienify(JNIEnv *env, jclass clazz) { return iluAlienify(); } /* * Class: org_lwjgl_devil_ILU * Method: iluBlurAvg * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBlurAvg(JNIEnv *env, jclass clazz, jint iter) { return iluBlurAvg((ILuint)iter); } /* * Class: org_lwjgl_devil_ILU * Method: iluBlurGaussian * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBlurGaussian(JNIEnv *env, jclass clazz, jint iter) { return iluBlurGaussian((ILuint)iter); } /* * Class: org_lwjgl_devil_ILU * Method: iluBuildMipmaps * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluBuildMipmaps(JNIEnv *env, jclass clazz) { return iluBuildMipmaps(); } /* * Class: org_lwjgl_devil_ILU * Method: iluColoursUsed * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluColoursUsed(JNIEnv *env, jclass clazz) { return iluColoursUsed(); } /* * Class: org_lwjgl_devil_ILU * Method: iluCompareImage * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluCompareImage(JNIEnv *env, jclass clazz, jint comp) { return iluCompareImage((ILuint)comp); } /* * Class: org_lwjgl_devil_ILU * Method: iluContrast * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluContrast(JNIEnv *env, jclass clazz, jfloat contrast) { return iluContrast((ILfloat)contrast); } /* * Class: org_lwjgl_devil_ILU * Method: iluCrop * Signature: (IIIIII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluCrop(JNIEnv *env, jclass clazz, jint xOff, jint yOff, jint zOff, jint width, jint height, jint depth) { return iluCrop((ILuint)xOff, (ILuint)yOff, (ILuint)zOff, (ILuint)width, (ILuint)height, (ILuint)depth); } /* * Class: org_lwjgl_devil_ILU * Method: iluDeleteImage * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluDeleteImage(JNIEnv *env, jclass clazz, jint id) { iluDeleteImage((ILuint)id); } /* * Class: org_lwjgl_devil_ILU * Method: iluEdgeDetectE * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectE(JNIEnv *env, jclass clazz) { return iluEdgeDetectE(); } /* * Class: org_lwjgl_devil_ILU * Method: iluEdgeDetectP * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectP(JNIEnv *env, jclass clazz) { return iluEdgeDetectP(); } /* * Class: org_lwjgl_devil_ILU * Method: iluEdgeDetectS * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEdgeDetectS(JNIEnv *env, jclass clazz) { return iluEdgeDetectS(); } /* * Class: org_lwjgl_devil_ILU * Method: iluEmboss * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEmboss(JNIEnv *env, jclass clazz) { return iluEmboss(); } /* * Class: org_lwjgl_devil_ILU * Method: iluEnlargeCanvas * Signature: (III)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEnlargeCanvas(JNIEnv *env, jclass clazz, jint width, jint height, jint depth) { return iluEnlargeCanvas((ILuint)width, (ILuint)height, (ILuint)depth); } /* * Class: org_lwjgl_devil_ILU * Method: iluEnlargeImage * Signature: (FFF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEnlargeImage(JNIEnv *env, jclass clazz, jfloat xDim, jfloat yDim, jfloat zDim) { return iluEnlargeImage((ILfloat)xDim, (ILfloat)yDim, (ILfloat)zDim); } /* * Class: org_lwjgl_devil_ILU * Method: iluEqualize * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluEqualize(JNIEnv *env, jclass clazz) { return iluEqualize(); } /* * Class: org_lwjgl_devil_ILU * Method: iluErrorString * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILU_iluErrorString(JNIEnv *env, jclass clazz, jint error) { return NewStringNative(env, iluErrorString((ILenum)error)); } /* * Class: org_lwjgl_devil_ILU * Method: iluFlipImage * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluFlipImage(JNIEnv *env, jclass clazz) { return iluFlipImage(); } /* * Class: org_lwjgl_devil_ILU * Method: iluGammaCorrect * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluGammaCorrect(JNIEnv *env, jclass clazz, jfloat gamma) { return iluGammaCorrect((ILfloat)gamma); } /* * Class: org_lwjgl_devil_ILU * Method: iluGenImage * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluGenImage(JNIEnv *env, jclass clazz) { return iluGenImage(); } /* * Class: org_lwjgl_devil_ILU * Method: iluGetImageInfo * Signature: ([Lorg/lwjgl/devil/ILinfo;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluGetImageInfo(JNIEnv *env, jclass clazz, jobjectArray info) { } /* * Class: org_lwjgl_devil_ILU * Method: iluGetInteger * Signature: (I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluGetInteger(JNIEnv *env, jclass clazz, jint mode) { return iluGetInteger((ILenum)mode); } /* * Class: org_lwjgl_devil_ILU * Method: iluGetIntegerv * Signature: (ILjava/nio/IntBuffer;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluGetIntegerv(JNIEnv *env, jclass clazz, jint mode, jobject param_buffer, jint param_offset) { ILbyte *lists = (ILbyte *) safeGetBufferAddress(env, param_buffer, param_offset); ilGenImages((ILsizei)mode, (ILuint *)lists); } /* * Class: org_lwjgl_devil_ILU * Method: iluGetString * Signature: (I)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILU_iluGetString(JNIEnv *env, jclass clazz, jint stringName) { return NewStringNative(env, iluGetString((ILenum)stringName)); } /* * Class: org_lwjgl_devil_ILU * Method: iluImageParameter * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluImageParameter(JNIEnv *env, jclass clazz, jint pName, jint param) { iluImageParameter((ILenum)pName, (ILenum)param); } /* * Class: org_lwjgl_devil_ILU * Method: iluInit * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluInit(JNIEnv *env, jclass clazz) { iluInit(); } /* * Class: org_lwjgl_devil_ILU * Method: iluInvertAlpha * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluInvertAlpha(JNIEnv *env, jclass clazz) { return iluInvertAlpha(); } /* * Class: org_lwjgl_devil_ILU * Method: iluLoadImage * Signature: (Ljava/lang/String;)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_devil_ILU_iluLoadImage(JNIEnv *env, jclass clazz, jstring fileName) { char *strFileName = GetStringNativeChars(env, fileName); jint result = iluLoadImage((const ILstring)strFileName); free(strFileName); return result; } /* * Class: org_lwjgl_devil_ILU * Method: iluMirror * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluMirror(JNIEnv *env, jclass clazz) { return iluMirror(); } /* * Class: org_lwjgl_devil_ILU * Method: iluNegative * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluNegative(JNIEnv *env, jclass clazz) { return iluNegative(); } /* * Class: org_lwjgl_devil_ILU * Method: iluNoisify * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluNoisify(JNIEnv *env, jclass clazz, jfloat factor) { return iluNoisify((ILclampf)factor); } /* * Class: org_lwjgl_devil_ILU * Method: iluPixelize * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluPixelize(JNIEnv *env, jclass clazz, jint pixSize) { return iluPixelize((ILuint)pixSize); } /* * Class: org_lwjgl_devil_ILU * Method: iluRegionfv * Signature: ([Lorg/lwjgl/devil/ILpointf;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluRegionfv(JNIEnv *env, jclass clazz, jobjectArray points, jint n) { } /* * Class: org_lwjgl_devil_ILU * Method: iluRegioniv * Signature: ([Lorg/lwjgl/devil/ILpointi;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluRegioniv(JNIEnv *env, jclass clazz, jobjectArray points, jint n) { } /* * Class: org_lwjgl_devil_ILU * Method: iluReplaceColour * Signature: (BBBF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluReplaceColour(JNIEnv *env, jclass clazz, jbyte red, jbyte green, jbyte blue, jfloat tolerence) { } /* * Class: org_lwjgl_devil_ILU * Method: iluRotate * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluRotate(JNIEnv *env, jclass clazz, jfloat angle) { return iluRotate((ILfloat)angle); } /* * Class: org_lwjgl_devil_ILU * Method: iluSaturate1f * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSaturate1f(JNIEnv *env, jclass clazz, jfloat saturation) { return iluSaturate1f((ILfloat)saturation); } /* * Class: org_lwjgl_devil_ILU * Method: iluSaturate4f * Signature: (FFFF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSaturate4f(JNIEnv *env, jclass clazz, jfloat r, jfloat g, jfloat b, jfloat saturation) { return iluSaturate4f((ILfloat)r, (ILfloat)g, (ILfloat)b, (ILfloat)saturation); } /* * Class: org_lwjgl_devil_ILU * Method: iluScale * Signature: (III)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluScale(JNIEnv *env, jclass clazz, jint width, jint height, jint depth) { return iluScale((ILuint)width, (ILuint)height, (ILuint)depth); } /* * Class: org_lwjgl_devil_ILU * Method: iluScaleColours * Signature: (FFF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluScaleColours(JNIEnv *env, jclass clazz, jfloat r, jfloat g, jfloat b) { return iluScaleColours((ILfloat)r, (ILfloat)g, (ILfloat)b); } /* * Class: org_lwjgl_devil_ILU * Method: iluSharpen * Signature: (FI)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSharpen(JNIEnv *env, jclass clazz, jfloat factor, jint iter) { return iluSharpen((ILfloat)factor, (ILuint)iter); } /* * Class: org_lwjgl_devil_ILU * Method: iluSwapColours * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluSwapColours(JNIEnv *env, jclass clazz) { return iluSwapColours(); } /* * Class: org_lwjgl_devil_ILU * Method: iluWave * Signature: (F)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluWave(JNIEnv *env, jclass clazz, jfloat wave) { return iluWave((ILfloat)wave); } /* * Class: org_lwjgl_devil_ILU * Method: nCreate * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_nCreate(JNIEnv *env, jclass clazz) { /*if (!extilu_Open(env)) { throwException(env, "Failed to load DevIL library"); return; }*/ } #ifdef __cplusplus extern "C" { #endif /* * Class: org_lwjgl_devil_ILU * Method: initNativeStubs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_initNativeStubs(JNIEnv *env, jclass clazz) { /* JavaMethodAndExtFunction functions[] = { {"iluAlienify", "()Z", (void*)&Java_org_lwjgl_devil_IL_iluAlienify, "iluAlienify", (void*)&iluAlienify}, }; int num_functions = NUMFUNCTIONS(functions); extil_InitializeClass(env, clazz, num_functions, functions); */ } #ifdef __cplusplus } #endif |
|
From: Mark B. <cap...@us...> - 2005-01-09 05:00:45
|
Update of /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238/platform_build/win32_ms_cmdline Modified Files: build-devil.bat Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. Index: build-devil.bat =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/platform_build/win32_ms_cmdline/build-devil.bat,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- build-devil.bat 13 Dec 2004 17:05:50 -0000 1.3 +++ build-devil.bat 9 Jan 2005 04:59:48 -0000 1.4 @@ -6,7 +6,7 @@ if "%DEVILHOME%" == "" goto errordevilhome set COPTIONS=/I"%DEVILHOME%\include" /I"%PLTSDKHOME%\include" /I"%CHOME%\include" /I"%JAVA_HOME%\include" /I"%JAVA_HOME%\include\win32" /I"..\..\src\native\common" /Ox /Ob2 /Oi /Ot /Oy /FD /EHsc /MT /Gy /W0 /nologo /c /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "LWJGL_EXPORTS" /D "_WINDLL" set LINKEROPTS=/link /LIBPATH:"%PLTSDKHOME%\Lib" /LIBPATH:"%CHOME%\Lib" /LIBPATH:"%DEVILHOME%\Lib" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /MACHINE:X86 /NOLOGO /DLL -set LIBS=user32.lib Gdi32.lib Advapi32.lib DevIL.lib +set LIBS=user32.lib Gdi32.lib Advapi32.lib ILU.lib DevIL.lib for %%x in (..\..\src\native\common\devil\*.c) do cl %COPTIONS% %%x for %%x in (..\..\src\native\common\*common*.c) do cl %COPTIONS% %%x |
|
From: Mark B. <cap...@us...> - 2005-01-09 05:00:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238/src/java/org/lwjgl/test/devil Modified Files: BasicTest.java Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. Index: BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil/BasicTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BasicTest.java 11 Dec 2004 02:14:07 -0000 1.4 +++ BasicTest.java 9 Jan 2005 04:59:50 -0000 1.5 @@ -33,6 +33,7 @@ import org.lwjgl.devil.*; +import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; @@ -47,31 +48,35 @@ public static void main(String args[]) { try { IL.create(); + ILU.create(); } catch(Exception e) { e.printStackTrace(); System.exit(0); } - int err = IL.ilGetError(); + String err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); System.out.println("ilGenImages"); IntBuffer im = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); IL.ilGenImages(1, im); System.out.println("ilBindImage"); IL.ilBindImage(im.get(0)); - err = IL.ilGetError(); + IL.ilEnable(IL.IL_ORIGIN_SET); + IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); String imageFile = "F:/Apps/Java/eclipse/workspace/LWJGL/res/ILtest.tga"; - System.out.println("ilLoadImage " + imageFile); - System.out.println("load lump = " + IL.ilLoadFromURL(BasicTest.class.getResource("/res/ILtest.tga"))); - err = IL.ilGetError(); + URL imageURL = BasicTest.class.getResource("/res/ILtest.tga"); + System.out.println("ilLoadFromURL " + imageURL); + System.out.println("load lump = " + IL.ilLoadFromURL(imageURL)); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); int newIm = IL.ilCloneCurImage(); IL.ilCopyImage(im.get(0)); IL.ilBindImage(newIm); ByteBuffer buf = IL.ilGetData(); System.out.println("ilGetData"); - err = IL.ilGetError(); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); int limit = buf.limit(); System.out.println("limit = " + limit); @@ -81,7 +86,7 @@ System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); - err = IL.ilGetError(); + err = ILU.iluErrorString(IL.ilGetError()); System.out.println("err = " + err + " IL_NO_ERROR = " + IL.IL_NO_ERROR); } } |
|
From: Mark B. <cap...@us...> - 2005-01-09 04:59:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238/src/java/org/lwjgl/devil Added Files: ILinfo.java ILpointf.java ILU.java ILpointi.java Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. --- NEW FILE: ILinfo.java --- /* * 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. */ package org.lwjgl.devil; /** * @author Mark Bernard * date: 3-Jan-2005 */ public class ILinfo { public int Id; // the image's id public byte Data[]; // the image's data public int Width; // the image's width public int Height; // the image's height public int Depth; // the image's depth public byte Bpp; // bytes per pixel (not bits) of the image public int SizeOfData; // the total size of the data (in bytes) public int Format; // image format (in IL enum style) public int Type; // image type (in IL enum style) public int Origin; // origin of the image public byte Palette[]; // the image's palette public int PalType; // palette type public int PalSize; // palette size public int CubeFlags; // flags for what cube map sides are present public int NumNext; // number of images following public int NumMips; // number of mipmaps public int NumLayers; // number of layers } --- NEW FILE: ILpointi.java --- /* * 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. */ package org.lwjgl.devil; /** * @author Mark Bernard * date: 3-Jan-2005 */ public class ILpointi { public int x; public int y; } --- NEW FILE: ILU.java --- /* * 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. */ package org.lwjgl.devil; import java.nio.IntBuffer; import org.lwjgl.BufferChecks; import org.lwjgl.LWJGLException; /** * @author Mark Bernard * date: 3-Jan-2005 */ public class ILU { /** Have we been created? */ protected static boolean created; public static final int ILU_VERSION_1_6_7 = 1; public static final int ILU_VERSION = 167; public static final int ILU_FILTER = 0x2600; public static final int ILU_NEAREST = 0x2601; public static final int ILU_LINEAR = 0x2602; public static final int ILU_BILINEAR = 0x2603; public static final int ILU_SCALE_BOX = 0x2604; public static final int ILU_SCALE_TRIANGLE = 0x2605; public static final int ILU_SCALE_BELL = 0x2606; public static final int ILU_SCALE_BSPLINE = 0x2607; public static final int ILU_SCALE_LANCZOS3 = 0x2608; public static final int ILU_SCALE_MITCHELL = 0x2609; // Error types public static final int ILU_INVALID_ENUM = 0x0501; public static final int ILU_OUT_OF_MEMORY = 0x0502; public static final int ILU_INTERNAL_ERROR = 0x0504; public static final int ILU_INVALID_VALUE = 0x0505; public static final int ILU_ILLEGAL_OPERATION = 0x0506; public static final int ILU_INVALID_PARAM = 0x0509; // Values public static final int ILU_PLACEMENT = 0x0700; public static final int ILU_LOWER_LEFT = 0x0701; public static final int ILU_LOWER_RIGHT = 0x0702; public static final int ILU_UPPER_LEFT = 0x0703; public static final int ILU_UPPER_RIGHT = 0x0704; public static final int ILU_CENTER = 0x0705; public static final int ILU_CONVOLUTION_MATRIX = 0x0710; // public static final int ILU_VERSION_NUM = IL_VERSION_NUM; // public static final int ILU_VENDOR = IL_VENDOR; static { System.loadLibrary("ILU"); System.loadLibrary("lwjgl-devil"); } /** * @return true if DevIL has been created */ public static boolean isCreated() { return created; } public static native void initNativeStubs() throws LWJGLException; public static native boolean iluAlienify(); public static native boolean iluBlurAvg(int iter); public static native boolean iluBlurGaussian(int iter); public static native boolean iluBuildMipmaps(); public static native int iluColoursUsed(); public static native boolean iluCompareImage(int comp); public static native boolean iluContrast(float contrast); public static native boolean iluCrop(int xOff, int yOff, int zOff, int width, int height, int depth); public static native void iluDeleteImage(int id); public static native boolean iluEdgeDetectE(); public static native boolean iluEdgeDetectP(); public static native boolean iluEdgeDetectS(); public static native boolean iluEmboss(); public static native boolean iluEnlargeCanvas(int width, int height, int depth); public static native boolean iluEnlargeImage(float xDim, float yDim, float zDim); public static native boolean iluEqualize(); public static native String iluErrorString(int error); public static native boolean iluFlipImage(); public static native boolean iluGammaCorrect(float gamma); public static native int iluGenImage(); // TODO result placed in a pointer // TODO implement // public static native void iluGetImageInfo(ILinfo info[]); public static native int iluGetInteger(int mode); public static void iluGetIntegerv(int mode, IntBuffer param) { BufferChecks.checkDirect(param); niluGetIntegerv(mode, param, param.position()); } public static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); public static native String iluGetString(int stringName); public static native void iluImageParameter(int pName, int param); public static native void iluInit(); public static native boolean iluInvertAlpha(); public static native int iluLoadImage(String fileName); public static native boolean iluMirror(); public static native boolean iluNegative(); public static native boolean iluNoisify(float tolerance); public static native boolean iluPixelize(int pixSize); // TODO result placed in a pointer // TODO implement // public static native void iluRegionfv(ILpointf points[], int n); // TODO result placed in a pointer // TODO implement // public static native void iluRegioniv(ILpointi points[], int n); public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); public static native boolean iluRotate(float angle); // TODO Not implemented in the native lib // public static native boolean iluRotate3D(float x, float y, float z, float Angle); public static native boolean iluSaturate1f(float saturation); public static native boolean iluSaturate4f(float r, float g, float b, float saturation); public static native boolean iluScale(int width, int height, int depth); public static native boolean iluScaleColours(float r, float g, float b); public static native boolean iluSharpen(float factor, int iter); public static native boolean iluSwapColours(); public static native boolean iluWave(float angle); /** * */ public static void create() throws LWJGLException { if (!created) { nCreate(); ILU.initNativeStubs(); ILU.iluInit(); created = true; } } public static native void nCreate(); //DevIL lib allows both spellings of colour. //Will do the same this way. public static void iluColorsUsed() { iluColoursUsed(); } public static void iluSwapColors() { iluSwapColours(); } public static void iluReplaceColor(byte red, byte green, byte blue, float tolerance) { iluReplaceColour(red, green, blue, tolerance); } public static void iluScaleColors(float r, float g, float b) { iluScaleColours(r, g, b); } } --- NEW FILE: ILpointf.java --- /* * 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. */ package org.lwjgl.devil; /** * @author Mark Bernard * date: 3-Jan-2005 */ public class ILpointf { public float x; public float y; } |
|
From: Mark B. <cap...@us...> - 2005-01-09 04:59:58
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238 Modified Files: build.xml Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- build.xml 13 Dec 2004 17:28:08 -0000 1.45 +++ build.xml 9 Jan 2005 04:59:49 -0000 1.46 @@ -419,6 +419,7 @@ <!-- devil --> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.headers}/devil" force="yes"> <class name="org.lwjgl.devil.IL"/> + <class name="org.lwjgl.devil.ILU"/> </javah> </target> |
|
From: Mark B. <cap...@us...> - 2005-01-09 04:59:57
|
Update of /cvsroot/java-game-lib/LWJGL/res In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7238/res Added Files: ILtest.jpg ILtest.gif ILtest.bmp ILtest.tga Log Message: First pass at ILU portion of DevIL. Only basic testing is one. No dynamic loading yet. 3 methods not implemented yet. --- NEW FILE: ILtest.bmp --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ILtest.tga --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ILtest.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ILtest.jpg --- (This appears to be a binary file; contents omitted.) |
|
From: Elias N. <eli...@us...> - 2005-01-06 14:22:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13712/src/java/org/lwjgl/opengl Modified Files: Display.java Log Message: call setLocation _after_ window has been created Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Display.java 27 Dec 2004 21:38:50 -0000 1.36 +++ Display.java 6 Jan 2005 14:22:25 -0000 1.37 @@ -201,13 +201,13 @@ * A native context must exist, and it will be attached to the window. */ private static void createWindow() throws LWJGLException { - // if no display location set, center window - if(x == -1 && y == -1) { - setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2), - Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2)); - } - display_impl.createWindow(current_mode, fullscreen, (fullscreen) ? 0 : x, (fullscreen) ? 0 : y); + // if no display location set, center window + if(x == -1 && y == -1) { + setLocation(Math.max(0, (initial_mode.getWidth() - current_mode.getWidth()) / 2), + Math.max(0, (initial_mode.getHeight() - current_mode.getHeight()) / 2)); + } + setTitle(title); initControls(); setVSyncEnabled(vsync); |
|
From: Elias N. <eli...@us...> - 2005-01-06 14:03:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9406/src/native/linux Modified Files: org_lwjgl_input_Mouse.c org_lwjgl_opengl_Display.c Log Message: Linux: Moved trivial methods from native to java Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_opengl_Display.c 12 Dec 2004 19:02:43 -0000 1.17 +++ org_lwjgl_opengl_Display.c 6 Jan 2005 14:03:48 -0000 1.18 @@ -115,7 +115,7 @@ if (env != NULL) throwException(env, error_message); else - printfDebugJava(env, error_message); + printfDebug(error_message); return false; } else return true; @@ -691,14 +691,6 @@ return initDisplay(env, getCurrentScreen()); } -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getAdapter(JNIEnv *env , jobject this) { - return NULL; -} - -JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getVersion(JNIEnv *env, jobject this) { - return NULL; -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_createContext(JNIEnv *env, jobject this, jobject pixel_format) { Display *disp = incDisplay(env); if (disp == NULL) { Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- org_lwjgl_input_Mouse.c 11 Dec 2004 20:18:18 -0000 1.28 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 14:03:48 -0000 1.29 @@ -236,10 +236,6 @@ return width_return > height_return ? height_return : width_return; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_hasWheel(JNIEnv *env , jobject this) { - return JNI_TRUE; -} - JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getButtonCount(JNIEnv *env, jobject this) { return NUM_BUTTONS; } |
|
From: Elias N. <eli...@us...> - 2005-01-06 14:03:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9406/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Moved trivial methods from native to java Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- LinuxDisplay.java 25 Nov 2004 22:31:38 -0000 1.6 +++ LinuxDisplay.java 6 Jan 2005 14:03:39 -0000 1.7 @@ -55,8 +55,15 @@ public native void resetDisplayMode(); public native int getGammaRampLength(); public native void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException; - public native String getAdapter(); - public native String getVersion(); + + public String getAdapter() { + return null; + } + + public String getVersion() { + return null; + } + public native DisplayMode init(); public native void setTitle(String title); public native boolean isCloseRequested(); @@ -72,7 +79,10 @@ public native void reshape(int x, int y, int width, int height); public native DisplayMode[] getAvailableDisplayModes(); /* Mouse */ - public native boolean hasWheel(); + public boolean hasWheel() { + return true; + } + public native int getButtonCount(); public native void createMouse(); public native void destroyMouse(); |
|
From: Elias N. <eli...@us...> - 2005-01-06 13:07:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29294/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Clean up mouse error handling 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_input_Mouse.c 6 Jan 2005 13:06:41 -0000 1.5 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 13:07:30 -0000 1.6 @@ -190,12 +190,12 @@ //check for first time initialization - need to detect capabilities if (mFirstTimeInitialization) { - mFirstTimeInitialization = false; /* Enumerate capabilities of Mouse */ if (!EnumerateMouseCapabilities(env)) { ShutdownMouse(); return; } + mFirstTimeInitialization = false; } /* Do setup of Mouse */ if (!SetupMouse(env)) { |
|
From: Elias N. <eli...@us...> - 2005-01-06 13:06:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29125/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Win32: Clean up mouse error handling 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.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_input_Mouse.c 6 Jan 2005 11:41:49 -0000 1.4 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 13:06:41 -0000 1.5 @@ -55,8 +55,8 @@ static int mButtoncount = 0; // Temporary buttoncount static bool mHaswheel; // Temporary wheel check -static bool mCreate_success; // bool used to determine successfull creation static bool mFirstTimeInitialization = true; // boolean to determine first time initialization +static bool created = false; static bool mouse_grabbed; static int mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; @@ -72,11 +72,8 @@ static bool buffer_enabled; // Function prototypes (defined in the cpp file, since header file is generic across platforms -void EnumerateMouseCapabilities(); BOOL CALLBACK EnumMouseObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef); void ShutdownMouse(); -void CreateMouse(); -void SetupMouse(); void InitializeMouseFields(); void UpdateMouseFields(JNIEnv *env, jobject coord_buffer_obj, jobject button_buffer_obj); @@ -111,6 +108,65 @@ } /** + * Enumerates the capabilities of the Mouse attached to the system + */ +static bool EnumerateMouseCapabilities(JNIEnv *env) { + HRESULT hr; + hr = IDirectInputDevice_EnumObjects(mDIDevice, EnumMouseObjectsCallback, NULL, DIDFT_ALL); + if FAILED(hr) { + throwException(env, "EnumObjects failed"); + return false; + } + + //check for > 4 buttons - need to clamp since we're using dx 5 + if(mButtoncount > 4) { + mButtoncount = 4; + printfDebug("WARNING: Clamping to 4 mouse buttons\n"); + } + return true; +} + +/** + * Creates the specified device as a Mouse + */ +static bool CreateMouse(JNIEnv *env) { + HRESULT hr; + hr = IDirectInput_CreateDevice(lpdi, &GUID_SysMouse, &mDIDevice, NULL); + if FAILED(hr) { + throwException(env, "CreateDevice failed"); + return false; + } else + return true; +} + +/** + * Sets up the Mouse properties + */ +static bool SetupMouse(JNIEnv *env) { + DIPROPDWORD dipropdw; + // set Mouse data format + if(IDirectInputDevice_SetDataFormat(mDIDevice, &c_dfDIMouse) != DI_OK) { + throwException(env, "SetDataFormat failed"); + return false; + } + + dipropdw.diph.dwSize = sizeof(DIPROPDWORD); + dipropdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipropdw.diph.dwObj = 0; + dipropdw.diph.dwHow = DIPH_DEVICE; + dipropdw.dwData = EVENT_BUFFER_SIZE; + IDirectInputDevice_SetProperty(mDIDevice, DIPROP_BUFFERSIZE, &dipropdw.diph); + + // set the cooperative level + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { + throwException(env, "SetCooperativeLevel failed"); + return false; + } + resetCursorPos(); + return true; +} + +/** * Called when the Mouse instance is to be created */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_createMouse(JNIEnv *env, jobject self) { @@ -129,31 +185,29 @@ } /* skip enumeration, since we only want system mouse */ - CreateMouse(); + if (!CreateMouse(env)) + return; //check for first time initialization - need to detect capabilities if (mFirstTimeInitialization) { mFirstTimeInitialization = false; /* Enumerate capabilities of Mouse */ - EnumerateMouseCapabilities(); - if (!mCreate_success) { - throwException(env, "Failed to enumerate."); + if (!EnumerateMouseCapabilities(env)) { ShutdownMouse(); return; } - /* Do setup of Mouse */ - SetupMouse(); - } else { - if(mCreate_success) { - /* Do setup of Mouse */ - SetupMouse(); - } + } + /* Do setup of Mouse */ + if (!SetupMouse(env)) { + ShutdownMouse(); + return; } /* Aquire the Mouse */ ret = IDirectInputDevice_Acquire(mDIDevice); if(FAILED(ret)) { printfDebug("Failed to acquire mouse\n"); } + created = true; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_enableMouseBuffer(JNIEnv * env, jobject self) { @@ -161,7 +215,7 @@ } void handleMouseScrolled(int event_dwheel) { - if(mCreate_success) { + if(created) { accum_dwheel += event_dwheel; putMouseEvent(-1, 0, event_dwheel); } @@ -170,7 +224,7 @@ void handleMouseMoved(int x, int y) { int dx; int dy; - if(mCreate_success) { + if(created) { y = transformY(y); dx = x - last_x; dy = y - last_y; @@ -187,7 +241,7 @@ } void handleMouseButton(int button, int state) { - if(mCreate_success) { + if(created) { putMouseEvent(button, state, 0); } } @@ -341,7 +395,6 @@ mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; } } - IDirectInputDevice_Unacquire(mDIDevice); di_res = IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask); switch (di_res) { case DI_OK: @@ -356,7 +409,7 @@ throwException(env, "Could not set the CooperativeLevel (E_HANDLE)."); return; default: - printfDebugJava(env, "Failed to set cooperative level with unknown error code %d\n", di_res); + printfDebugJava(env, "Failed to set cooperative level with unknown error code %x", di_res); throwException(env, "Could not set the CooperativeLevel (Unknown error code)."); return; } @@ -380,27 +433,7 @@ IDirectInput_Release(lpdi); lpdi = NULL; } - mCreate_success = false; -} -/** - * Enumerates the capabilities of the Mouse attached to the system - */ -static void EnumerateMouseCapabilities() { - HRESULT hr; - hr = IDirectInputDevice_EnumObjects(mDIDevice, EnumMouseObjectsCallback, NULL, DIDFT_ALL); - if FAILED(hr) { - printfDebug("EnumObjects failed\n"); - mCreate_success = false; - return; - } - - //check for > 4 buttons - need to clamp since we're using dx 5 - if(mButtoncount > 4) { - mButtoncount = 4; - printfDebug("WARNING: Clamping to 4 mouse buttons\n"); - } - - mCreate_success = true; + created = false; } /** @@ -420,49 +453,6 @@ return DIENUM_CONTINUE; } -/** - * Creates the specified device as a Mouse - */ -static void CreateMouse() { - HRESULT hr; - hr = IDirectInput_CreateDevice(lpdi, &GUID_SysMouse, &mDIDevice, NULL); - if FAILED(hr) { - printfDebug("CreateDevice failed\n"); - mCreate_success = false; - return; - } - mCreate_success = true; -} - -/** - * Sets up the Mouse properties - */ -static void SetupMouse() { - DIPROPDWORD dipropdw; - // set Mouse data format - if(IDirectInputDevice_SetDataFormat(mDIDevice, &c_dfDIMouse) != DI_OK) { - printfDebug("SetDataFormat failed\n"); - mCreate_success = false; - return; - } - - dipropdw.diph.dwSize = sizeof(DIPROPDWORD); - dipropdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); - dipropdw.diph.dwObj = 0; - dipropdw.diph.dwHow = DIPH_DEVICE; - dipropdw.dwData = EVENT_BUFFER_SIZE; - IDirectInputDevice_SetProperty(mDIDevice, DIPROP_BUFFERSIZE, &dipropdw.diph); - - // set the cooperative level - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { - printfDebug("SetCooperativeLevel failed\n"); - mCreate_success = false; - return; - } - mCreate_success = true; - resetCursorPos(); -} - static int cap(int val, int min, int max) { if (val < min) return min; |
|
From: Elias N. <eli...@us...> - 2005-01-06 11:41:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11346/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: More debug output 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.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Mouse.c 6 Jan 2005 09:18:25 -0000 1.3 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 11:41:49 -0000 1.4 @@ -356,7 +356,8 @@ throwException(env, "Could not set the CooperativeLevel (E_HANDLE)."); return; default: - throwException(env, "Could not set the CooperativeLevel (Unkown error code)."); + printfDebugJava(env, "Failed to set cooperative level with unknown error code %d\n", di_res); + throwException(env, "Could not set the CooperativeLevel (Unknown error code)."); return; } IDirectInputDevice_Acquire(mDIDevice); |
|
From: Elias N. <eli...@us...> - 2005-01-06 09:18:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15505/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Added debugging 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Mouse.c 6 Jan 2005 08:56:31 -0000 1.2 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 09:18:25 -0000 1.3 @@ -359,10 +359,6 @@ throwException(env, "Could not set the CooperativeLevel (Unkown error code)."); return; } - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { - throwException(env, "Could not set the CooperativeLevel."); - return; - } IDirectInputDevice_Acquire(mDIDevice); initEventQueue(&event_queue, EVENT_SIZE); } |
|
From: Elias N. <eli...@us...> - 2005-01-06 08:56:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10917/src/native/win32 Modified Files: org_lwjgl_input_Mouse.c Log Message: Added debugging 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Mouse.c 9 Dec 2004 15:36:13 -0000 1.1 +++ org_lwjgl_input_Mouse.c 6 Jan 2005 08:56:31 -0000 1.2 @@ -325,8 +325,9 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Win32Display_grabMouse - (JNIEnv * env, jobject self, jboolean grab) { - IDirectInputDevice_Unacquire(mDIDevice); +(JNIEnv * env, jobject self, jboolean grab) { + HRESULT di_res; + IDirectInputDevice_Unacquire(mDIDevice); if(grab) { if (!mouse_grabbed) { mouse_grabbed = true; @@ -340,12 +341,29 @@ mouseMask = DISCL_NONEXCLUSIVE | DISCL_FOREGROUND; } } - IDirectInputDevice_Unacquire(mDIDevice); - if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { - throwException(env, "Could not set the CooperativeLevel."); + IDirectInputDevice_Unacquire(mDIDevice); + di_res = IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask); + switch (di_res) { + case DI_OK: + break; + case DIERR_INVALIDPARAM: + throwException(env, "Could not set the CooperativeLevel (DIERR_INVALIDPARAM)."); + return; + case DIERR_NOTINITIALIZED: + throwException(env, "Could not set the CooperativeLevel (DIERR_NOTINITIALIZED)."); + return; + case E_HANDLE: + throwException(env, "Could not set the CooperativeLevel (E_HANDLE)."); + return; + default: + throwException(env, "Could not set the CooperativeLevel (Unkown error code)."); + return; + } + if (IDirectInputDevice_SetCooperativeLevel(mDIDevice, getCurrentHWND(), mouseMask) != DI_OK) { + throwException(env, "Could not set the CooperativeLevel."); return; } - IDirectInputDevice_Acquire(mDIDevice); + IDirectInputDevice_Acquire(mDIDevice); initEventQueue(&event_queue, EVENT_SIZE); } |
|
From: Brian M. <ma...@us...> - 2005-01-03 06:34:14
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11331 Modified Files: installation.php Log Message: fixed output Index: installation.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/installation.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- installation.php 3 Jan 2005 06:32:31 -0000 1.8 +++ installation.php 3 Jan 2005 06:34:04 -0000 1.9 @@ -24,7 +24,10 @@ A window should appear and you should see the following output:<br/><br/> <pre>Found <number> display modes 240, 320, WindowCreationTest -Display created</pre> +Display created +Moving to 100, 100 +Window created +600, 800, Game</pre> </li> <li> Should you wish to place the dll's in some other directory than you're class files (say /native as opposed to /classes) you could do so, by using the java.library.path property. For example:<br/><br/> @@ -83,7 +86,10 @@ A window should appear and you should see the following output:<br/><br/> <pre>Found <number> display modes 240, 320, WindowCreationTest -Display created</pre> +Display created +Moving to 100, 100 +Window created +600, 800, Game</pre> </li> <li> Should you wish to place the files in some other directory than you're class files (say /native as opposed to /classes) you could do so, by using the java.library.path property. For example:<br/><br/> |
|
From: Brian M. <ma...@us...> - 2005-01-03 06:32:41
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11170 Modified Files: installation.php Log Message: lwjgl_util.jar needed on classpath too Index: installation.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/installation.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- installation.php 27 Nov 2004 16:02:05 -0000 1.7 +++ installation.php 3 Jan 2005 06:32:31 -0000 1.8 @@ -15,11 +15,12 @@ <pre>lwjgl.dll lwjglaudio.dll lwjgl.jar +lwjgl_util.jar lwjgl_test.jar</pre> </li> <li> Test LWJGL by opening a command prompt, and navigating to the folder where the archive was extracted. Once navigated, issue the following command:<br/><br/> - <pre>java -cp lwjgl.jar;lwjgl_test.jar; org.lwjgl.test.WindowCreationTest</pre> + <pre>java -cp lwjgl.jar;lwjgl_util.jar;lwjgl_test.jar; org.lwjgl.test.WindowCreationTest</pre> A window should appear and you should see the following output:<br/><br/> <pre>Found <number> display modes 240, 320, WindowCreationTest @@ -41,17 +42,21 @@ <pre>liblwjgl.so libopenal.so lwjgl.jar +lwjgl_util.jar lwjgl_test.jar</pre> </li> <li> Test LWJGL by opening a command prompt, and navigating to the folder where the archive was extracted. Once navigated, issue the following command:<br/><br/> - <pre>java -cp lwjgl.jar:lwjgl_test.jar: org.lwjgl.test.WindowCreationTest</pre> + <pre>java -cp lwjgl.jar:lwjgl_util.jar:lwjgl_test.jar: org.lwjgl.test.WindowCreationTest</pre> Should library loading fail, try using -Djava.library.path to specify the path. For example:<br/><br/> - <pre>java -cp lwjgl.jar:lwjgl_test.jar: -Djava.library.path=/home/lwjgluser/lwjgl/ org.lwjgl.test.WindowCreationTest</pre> + <pre>java -cp lwjgl.jar:lwjgl_util.jar:lwjgl_test.jar: -Djava.library.path=/home/lwjgluser/lwjgl/ org.lwjgl.test.WindowCreationTest</pre> A window should appear and you should see the following output:<br/><br/> <pre>Found <number> display modes 240, 320, WindowCreationTest -Display created</pre> +Display created +Moving to 100, 100 +Window created +600, 800, Game</pre> </li> <li> Should you wish to place the so files in some other directory than you're class files (say /native as opposed to /classes) you could do so, by using the java.library.path property. For example:<br/><br/> @@ -69,11 +74,12 @@ <pre>liblwjgl.jnilib libopenal.dylib lwjgl.jar +lwjgl_util.jar lwjgl_test.jar</pre> </li> <li> Test LWJGL by opening a command prompt, and navigating to the folder where the archive was extracted. Once navigated, issue the following command:<br/><br/> - <pre>java -cp lwjgl.jar:lwjgl_test.jar: org.lwjgl.test.WindowCreationTest</pre> + <pre>java -cp lwjgl.jar:lwjgl_util.jar:lwjgl_test.jar: org.lwjgl.test.WindowCreationTest</pre> A window should appear and you should see the following output:<br/><br/> <pre>Found <number> display modes 240, 320, WindowCreationTest |