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
(10) |
3
(47) |
|
4
(12) |
5
(15) |
6
(14) |
7
(5) |
8
|
9
(1) |
10
|
|
11
(6) |
12
|
13
|
14
|
15
(3) |
16
(3) |
17
(5) |
|
18
|
19
(2) |
20
|
21
(11) |
22
(12) |
23
(5) |
24
(12) |
|
25
(6) |
26
(13) |
27
(2) |
28
(2) |
29
(9) |
30
(4) |
31
(2) |
|
From: Elias N. <eli...@us...> - 2004-07-25 14:51:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26316/src/native/win32 Modified Files: org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Pbuffer.cpp Log Message: Win32 part of ByteBuffer handles for Pbuffer and Cursor Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- org_lwjgl_input_Mouse.cpp 15 Jul 2004 16:07:13 -0000 1.57 +++ org_lwjgl_input_Mouse.cpp 25 Jul 2004 14:51:28 -0000 1.58 @@ -223,12 +223,14 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor - (JNIEnv *env, jclass clazz, jlong cursor_handle) + (JNIEnv *env, jclass clazz, jobject handle_buffer) { if (mDIDevice == NULL) throwException(env, "null device!"); - if (cursor_handle != 0) { - HCURSOR cursor = (HCURSOR)cursor_handle; + if (handle_buffer != NULL) { + HCURSOR *cursor_handle = (HCURSOR *)env->GetDirectBufferAddress(handle_buffer); + HCURSOR cursor = *cursor_handle; +// HCURSOR cursor = (HCURSOR)cursor_handle; SetClassLong(display_hwnd, GCL_HCURSOR, (LONG)cursor); SetCursor(cursor); } else { Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_input_Cursor.cpp 6 Jul 2004 07:50:32 -0000 1.12 +++ org_lwjgl_input_Cursor.cpp 25 Jul 2004 14:51:28 -0000 1.13 @@ -44,14 +44,13 @@ #include "Window.h" #include "common_tools.h" -/* - * Class: org_lwjgl_input_Cursor - * Method: nCreateCursor - * Signature: (IIIIIIIII)I - */ -JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) +JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor + (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { + if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(HCURSOR)) { + throwException(env, "Handle buffer not large enough"); + return; + } int *pixels = (int *)env->GetDirectBufferAddress(image_buffer) + images_offset; BITMAPINFO bitmapInfo; @@ -78,7 +77,7 @@ char *dstPtr = ptrCursorImage; if (!dstPtr) { throwException(env, "Could not allocate DIB section."); - return 0; + return; } for (y = 0; y < height; y++ ) { for (x = 0; x < width; x++ ) { @@ -137,7 +136,8 @@ DeleteObject(cursorMask); delete[] maskPixels; - return (jint)cursor; + HCURSOR *cursor_handle = (HCURSOR *)env->GetDirectBufferAddress(handle_buffer); + *cursor_handle = cursor; } /* @@ -146,8 +146,9 @@ * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor - (JNIEnv *env, jclass clazz, jlong cursor_handle) + (JNIEnv *env, jclass clazz, jobject handle_buffer) { - HCURSOR cursor = (HCURSOR)cursor_handle; - DestroyCursor(cursor); +// HCURSOR cursor = (HCURSOR)cursor_handle; + HCURSOR *cursor_handle = (HCURSOR *)env->GetDirectBufferAddress(handle_buffer); + DestroyCursor(*cursor_handle); } Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_opengl_Pbuffer.cpp 24 Jul 2004 22:06:43 -0000 1.15 +++ org_lwjgl_opengl_Pbuffer.cpp 25 Jul 2004 14:51:28 -0000 1.16 @@ -137,11 +137,15 @@ return Pbuffer_context; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate - (JNIEnv *env, jclass clazz, jboolean use_display_context, +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate + (JNIEnv *env, jclass clazz, jobject buffer_handle, jboolean use_display_context, jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) { + if (env->GetDirectBufferCapacity(buffer_handle) < sizeof(PbufferInfo)) { + throwException(env, "Buffer handle not large enough"); + return; + } HPBUFFERARB Pbuffer; const int *pBufferAttribs_ptr; if ( pBufferAttribs != NULL ) { @@ -158,14 +162,14 @@ if (Pbuffer == NULL) { throwException(env, "Could not create Pbuffer."); - return (jint)NULL; + return; } HDC Pbuffer_dc = wglGetPbufferDCARB(Pbuffer); if (Pbuffer_dc == NULL) { wglDestroyPbufferARB(Pbuffer); throwException(env, "Could not get Pbuffer dc."); - return (jint)NULL; + return; } HGLRC Pbuffer_context; if (use_display_context) { @@ -175,50 +179,54 @@ if (Pbuffer_context == NULL) { wglReleasePbufferDCARB(Pbuffer, Pbuffer_dc); wglDestroyPbufferARB(Pbuffer); - return (jint)NULL; + return; } } - PbufferInfo *Pbuffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); Pbuffer_info->Pbuffer = Pbuffer; Pbuffer_info->Pbuffer_context = Pbuffer_context; Pbuffer_info->Pbuffer_dc = Pbuffer_dc; Pbuffer_info->use_display_context = use_display_context == JNI_TRUE; - return (jint)Pbuffer_info; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject buffer_handle) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; BOOL buffer_lost; wglQueryPbufferARB(Pbuffer_info->Pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); return buffer_lost ? JNI_TRUE : JNI_FALSE; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject buffer_handle) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; if (!wglMakeCurrent(Pbuffer_info->Pbuffer_dc, Pbuffer_info->Pbuffer_context)) throwException(env, "Could not make pbuffer context current"); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject buffer_handle) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; if (!Pbuffer_info->use_display_context) wglDeleteContext(Pbuffer_info->Pbuffer_context); wglReleasePbufferDCARB(Pbuffer_info->Pbuffer, Pbuffer_info->Pbuffer_dc); wglDestroyPbufferARB(Pbuffer_info->Pbuffer); - free(Pbuffer_info); +// free(Pbuffer_info); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib - (JNIEnv *env, jclass clazz, jint handle, jint attrib, jint value) + (JNIEnv *env, jclass clazz, jobject buffer_handle, jint attrib, jint value) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; int attribs[3]; @@ -230,15 +238,17 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage - (JNIEnv *env, jclass clazz, jint handle, jint buffer) + (JNIEnv *env, jclass clazz, jobject buffer_handle, jint buffer) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; wglBindTexImageARB(Pbuffer_info->Pbuffer, buffer); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage - (JNIEnv *env, jclass clazz, jint handle, jint buffer) + (JNIEnv *env, jclass clazz, jobject buffer_handle, jint buffer) { - PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; + PbufferInfo *Pbuffer_info = (PbufferInfo *)env->GetDirectBufferAddress(buffer_handle); +// PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; wglReleaseTexImageARB(Pbuffer_info->Pbuffer, buffer); } |
|
From: Elias N. <eli...@us...> - 2004-07-25 14:29:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23226/src/native/common Modified Files: org_lwjgl_input_Cursor.h org_lwjgl_input_Mouse.h org_lwjgl_opengl_Pbuffer.h Log Message: Converted Cursor and Pbuffer handles to ByteBuffers Index: org_lwjgl_opengl_Pbuffer.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Pbuffer.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_opengl_Pbuffer.h 24 Jul 2004 19:44:40 -0000 1.9 +++ org_lwjgl_opengl_Pbuffer.h 25 Jul 2004 14:28:50 -0000 1.10 @@ -41,21 +41,23 @@ #define org_lwjgl_opengl_Pbuffer_BACK_RIGHT_BUFFER 8326L #undef org_lwjgl_opengl_Pbuffer_DEPTH_BUFFER #define org_lwjgl_opengl_Pbuffer_DEPTH_BUFFER 8359L +#undef org_lwjgl_opengl_Pbuffer_HANDLE_SIZE +#define org_lwjgl_opengl_Pbuffer_HANDLE_SIZE 24L /* * Class: org_lwjgl_opengl_Pbuffer * Method: nIsBufferLost - * Signature: (I)Z + * Signature: (Ljava/nio/ByteBuffer;)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost - (JNIEnv *, jclass, jint); + (JNIEnv *, jclass, jobject); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nMakeCurrent - * Signature: (I)V + * Signature: (Ljava/nio/ByteBuffer;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent - (JNIEnv *, jclass, jint); + (JNIEnv *, jclass, jobject); /* * Class: org_lwjgl_opengl_Pbuffer @@ -68,42 +70,42 @@ /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate - * Signature: (ZIILorg/lwjgl/opengl/PixelFormat;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I + * Signature: (Ljava/nio/ByteBuffer;ZIILorg/lwjgl/opengl/PixelFormat;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)V */ -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate - (JNIEnv *, jclass, jboolean, jint, jint, jobject, jobject, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate + (JNIEnv *, jclass, jobject, jboolean, jint, jint, jobject, jobject, jobject); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nDestroy - * Signature: (I)V + * Signature: (Ljava/nio/ByteBuffer;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy - (JNIEnv *, jclass, jint); + (JNIEnv *, jclass, jobject); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nSetAttrib - * Signature: (III)V + * Signature: (Ljava/nio/ByteBuffer;II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib - (JNIEnv *, jclass, jint, jint, jint); + (JNIEnv *, jclass, jobject, jint, jint); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nBindTexImage - * Signature: (II)V + * Signature: (Ljava/nio/ByteBuffer;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage - (JNIEnv *, jclass, jint, jint); + (JNIEnv *, jclass, jobject, jint); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nReleaseTexImage - * Signature: (II)V + * Signature: (Ljava/nio/ByteBuffer;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage - (JNIEnv *, jclass, jint, jint); + (JNIEnv *, jclass, jobject, jint); #ifdef __cplusplus } Index: org_lwjgl_input_Mouse.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_input_Mouse.h 23 May 2004 14:46:07 -0000 1.16 +++ org_lwjgl_input_Mouse.h 25 Jul 2004 14:28:50 -0000 1.17 @@ -13,10 +13,19 @@ #define org_lwjgl_input_Mouse_CURSOR_8_BIT_ALPHA 2L #undef org_lwjgl_input_Mouse_CURSOR_ANIMATION #define org_lwjgl_input_Mouse_CURSOR_ANIMATION 4L +#undef org_lwjgl_input_Mouse_MAX_SENSITIVITY +#define org_lwjgl_input_Mouse_MAX_SENSITIVITY 8L +#undef org_lwjgl_input_Mouse_MIN_SENSITIVITY +#define org_lwjgl_input_Mouse_MIN_SENSITIVITY 1L +/* Inaccessible static: sensitivity */ +/* Inaccessible static: width */ +/* Inaccessible static: height */ /* Inaccessible static: created */ /* Inaccessible static: buttons */ /* Inaccessible static: x */ /* Inaccessible static: y */ +/* Inaccessible static: scrollX */ +/* Inaccessible static: scrollY */ /* Inaccessible static: coord_buffer */ /* Inaccessible static: dx */ /* Inaccessible static: dy */ @@ -33,6 +42,7 @@ #undef org_lwjgl_input_Mouse_BUFFER_SIZE #define org_lwjgl_input_Mouse_BUFFER_SIZE 50L /* Inaccessible static: isGrabbed */ +/* Inaccessible static: trackingEnabled */ /* * Class: org_lwjgl_input_Mouse * Method: nGetNativeCursorCaps @@ -44,10 +54,10 @@ /* * Class: org_lwjgl_input_Mouse * Method: nSetNativeCursor - * Signature: (J)V + * Signature: (Ljava/nio/ByteBuffer;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jobject); /* * Class: org_lwjgl_input_Mouse Index: org_lwjgl_input_Cursor.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Cursor.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_input_Cursor.h 23 May 2004 14:46:07 -0000 1.9 +++ org_lwjgl_input_Cursor.h 25 Jul 2004 14:28:50 -0000 1.10 @@ -7,21 +7,23 @@ #ifdef __cplusplus extern "C" { #endif +#undef org_lwjgl_input_Cursor_HANDLE_SIZE +#define org_lwjgl_input_Cursor_HANDLE_SIZE 8L /* * Class: org_lwjgl_input_Cursor * Method: nCreateCursor - * Signature: (IIIIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)J + * Signature: (Ljava/nio/ByteBuffer;IIIIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;I)V */ -JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *, jclass, jint, jint, jint, jint, jint, jobject, jint, jobject, jint); +JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor + (JNIEnv *, jclass, jobject, jint, jint, jint, jint, jint, jobject, jint, jobject, jint); /* * Class: org_lwjgl_input_Cursor * Method: nDestroyCursor - * Signature: (J)V + * Signature: (Ljava/nio/ByteBuffer;)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor - (JNIEnv *, jclass, jlong); + (JNIEnv *, jclass, jobject); #ifdef __cplusplus } |
|
From: Elias N. <eli...@us...> - 2004-07-25 14:29:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23226/src/native/linux Modified Files: org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Pbuffer.cpp Log Message: Converted Cursor and Pbuffer handles to ByteBuffers Index: org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- org_lwjgl_input_Mouse.cpp 24 Jul 2004 19:44:41 -0000 1.57 +++ org_lwjgl_input_Mouse.cpp 25 Jul 2004 14:28:50 -0000 1.58 @@ -202,10 +202,11 @@ return caps; } -JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor (JNIEnv *env, jclass clazz, jlong cursor_handle) { - if (cursor_handle != 0) { - Cursor cursor = (Cursor)cursor_handle; - current_cursor = cursor; +JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nSetNativeCursor(JNIEnv *env, jclass clazz, jobject cursor_handle) { + if (cursor_handle != NULL) { + Cursor *cursor = (Cursor *)env->GetDirectBufferAddress(cursor_handle); +// Cursor cursor = (Cursor)cursor_handle; + current_cursor = *cursor; } else current_cursor = None; updateCursor(); Index: org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_input_Cursor.cpp 7 Jul 2004 10:31:26 -0000 1.13 +++ org_lwjgl_input_Cursor.cpp 25 Jul 2004 14:28:50 -0000 1.14 @@ -44,17 +44,16 @@ #include "Window.h" #include "common_tools.h" -/* - * Class: org_lwjgl_input_Cursor - * Method: nCreateCursor - * Signature: (IIIIIII)I - */ -JNIEXPORT jlong JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) +JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor + (JNIEnv *env, jclass clazz, jobject handle_buffer, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jobject image_buffer, jint images_offset, jobject delay_buffer, jint delays_offset) { + if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(Cursor)) { + throwException(env, "Handle buffer not large enough"); + return; + } Display *disp = incDisplay(env); if (disp == NULL) - return 0; + return; const int *delays = NULL; if (delay_buffer != NULL) delays = (const int *)env->GetDirectBufferAddress(delay_buffer) + delays_offset; @@ -74,20 +73,16 @@ cursor_image->delay = delays[i]; cursor_images->images[i] = cursor_image; } - Cursor cursor = XcursorImagesLoadCursor(disp, cursor_images); + Cursor *cursor = (Cursor *)env->GetDirectBufferAddress(handle_buffer); + *cursor = XcursorImagesLoadCursor(disp, cursor_images); XcursorImagesDestroy(cursor_images); - return (jlong)cursor; } -/* - * Class: org_lwjgl_input_Cursor - * Method: nDestroyCursor - * Signature: (I)V - */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Cursor_nDestroyCursor - (JNIEnv *env, jclass clazz, jlong cursor_handle) + (JNIEnv *env, jclass clazz, jobject cursor_handle_buffer) { - Cursor cursor = (Cursor)cursor_handle; - XFreeCursor(getDisplay(), cursor); + Cursor *cursor = (Cursor *)env->GetDirectBufferAddress(cursor_handle_buffer); +// Cursor cursor = (Cursor)cursor_handle; + XFreeCursor(getDisplay(), *cursor); decDisplay(); } Index: org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- org_lwjgl_opengl_Pbuffer.cpp 24 Jul 2004 21:19:08 -0000 1.22 +++ org_lwjgl_opengl_Pbuffer.cpp 25 Jul 2004 14:28:50 -0000 1.23 @@ -52,7 +52,7 @@ } PbufferInfo; JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject handle_buffer) { // The buffer is never lost, because of the GLX_PRESERVED_CONTENTS flag return JNI_FALSE; @@ -71,7 +71,7 @@ glXDestroyPbuffer(getDisplay(), buffer); if (!buffer_info->use_display_context) glXDestroyContext(getDisplay(), context); - free(buffer_info); +// free(buffer_info); decDisplay(); } @@ -147,17 +147,17 @@ return true; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass clazz, jboolean use_display_context, jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate(JNIEnv *env, jclass clazz, jobject handle_buffer, jboolean use_display_context, jint width, jint height, jobject pixel_format, jobject pixelFormatCaps, jobject pBufferAttribs) { Display *disp = incDisplay(env); if (disp == NULL) { - return -1; + return; } int current_screen = XDefaultScreen(disp); if (!extgl_InitGLX(env, disp, current_screen)) { decDisplay(); throwException(env, "Could not init GLX"); - return -1; + return; } const int buffer_attribs[] = {GLX_PBUFFER_WIDTH, width, @@ -166,7 +166,12 @@ GLX_LARGEST_PBUFFER, False, None, None}; - PbufferInfo *buffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); + if (env->GetDirectBufferCapacity(handle_buffer) < sizeof(PbufferInfo)) { + throwException(env, "Handle buffer not large enough"); + return; + } + PbufferInfo *buffer_info = (PbufferInfo *)env->GetDirectBufferAddress(handle_buffer); +// PbufferInfo *buffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); buffer_info->use_display_context = use_display_context; bool result; if (use_display_context) { @@ -175,18 +180,18 @@ result = createPbufferUsingUniqueContext(env, buffer_info, pixel_format, width, height, buffer_attribs); } if (!result) - return -1; + return; if (!checkXError(env)) { destroyPbuffer(buffer_info); - return -1; + return; } - return (jint)buffer_info; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject handle_buffer) { - PbufferInfo *buffer_info = (PbufferInfo *)handle; + PbufferInfo *buffer_info = (PbufferInfo *)env->GetDirectBufferAddress(handle_buffer); + //PbufferInfo *buffer_info = (PbufferInfo *)handle; GLXPbuffer buffer = buffer_info->buffer; GLXContext context = buffer_info->context; if (glXMakeContextCurrent(getDisplay(), buffer, buffer, context) == False) { @@ -200,26 +205,27 @@ * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy - (JNIEnv *env, jclass clazz, jint handle) + (JNIEnv *env, jclass clazz, jobject handle_buffer) { - PbufferInfo *buffer_info = (PbufferInfo *)handle; + PbufferInfo *buffer_info = (PbufferInfo *)env->GetDirectBufferAddress(handle_buffer); + //PbufferInfo *buffer_info = (PbufferInfo *)handle; destroyPbuffer(buffer_info); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nSetAttrib - (JNIEnv *env, jclass clazz, jint handle, jint attrib, jint value) + (JNIEnv *env, jclass clazz, jobject handle_buffer, jint attrib, jint value) { throwException(env, "The render-to-texture extension is not supported."); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nBindTexImage - (JNIEnv *env, jclass clazz, jint handle, jint buffer) + (JNIEnv *env, jclass clazz, jobject handle_buffer, jint buffer) { throwException(env, "The render-to-texture extension is not supported."); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseTexImage - (JNIEnv *env, jclass clazz, jint handle, jint buffer) + (JNIEnv *env, jclass clazz, jobject handle_buffer, jint buffer) { throwException(env, "The render-to-texture extension is not supported."); } |
|
From: Elias N. <eli...@us...> - 2004-07-25 14:28:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23226/src/java/org/lwjgl/opengl Modified Files: Pbuffer.java Log Message: Converted Cursor and Pbuffer handles to ByteBuffers Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Pbuffer.java 25 Jul 2004 07:00:55 -0000 1.25 +++ Pbuffer.java 25 Jul 2004 14:28:49 -0000 1.26 @@ -32,9 +32,11 @@ package org.lwjgl.opengl; import org.lwjgl.Sys; +import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import java.nio.IntBuffer; +import java.nio.ByteBuffer; /** * $Id$ @@ -135,9 +137,14 @@ public static final int DEPTH_BUFFER = RenderTexture.WGL_DEPTH_COMPONENT_NV; /** + * The maximum number of bytes in the native handle + */ + private final static int HANDLE_SIZE = 24; + + /** * Handle to the native GL rendering context */ - private final int handle; + private final ByteBuffer handle; /** * Width @@ -183,7 +190,7 @@ public static Pbuffer createPbufferUsingDisplayContext(int width, int height, RenderTexture renderTexture) throws LWJGLException { if (!Display.isCreated()) throw new IllegalStateException("The Display must be created before a shared Pbuffer can be created that use the Display context"); - int handle = createPbuffer(true, width, height, null, renderTexture); + ByteBuffer handle = createPbuffer(true, width, height, null, renderTexture); return new Pbuffer(width, height, Display.getContext(), handle); } @@ -206,26 +213,28 @@ * @param renderTexture */ public static Pbuffer createPbufferUsingUniqueContext(int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException { - int handle = createPbuffer(false, width, height, pixel_format, renderTexture); + ByteBuffer handle = createPbuffer(false, width, height, pixel_format, renderTexture); return new Pbuffer(width, height, null, handle); } - private Pbuffer(int width, int height, Object display_context, int handle) { + private Pbuffer(int width, int height, Object display_context, ByteBuffer handle) { this.width = width; this.height = height; this.display_context = display_context; this.handle = handle; } - private static int createPbuffer(boolean use_display_context, int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException { + private static ByteBuffer createPbuffer(boolean use_display_context, int width, int height, PixelFormat pixel_format, RenderTexture renderTexture) throws LWJGLException { GLContext.loadOpenGLLibrary(); try { + ByteBuffer handle = BufferUtils.createByteBuffer(HANDLE_SIZE); if ( renderTexture == null ) - return nCreate(use_display_context, width, height, pixel_format, null, null); + nCreate(handle, use_display_context, width, height, pixel_format, null, null); else - return nCreate(use_display_context, width, height, pixel_format, + nCreate(handle, use_display_context, width, height, pixel_format, renderTexture.pixelFormatCaps, renderTexture.pBufferAttribs); + return handle; } catch (LWJGLException e) { GLContext.unloadOpenGLLibrary(); throw e; @@ -246,7 +255,7 @@ /** * Native method to test for buffer integrity */ - private static native boolean nIsBufferLost(int handle); + private static native boolean nIsBufferLost(ByteBuffer handle); /** * Method to make the Pbuffer context current. All subsequent OpenGL calls will go to this buffer. @@ -263,7 +272,7 @@ /** * Native method to make a pbuffer current. */ - private static native void nMakeCurrent(int handle) throws LWJGLException; + private static native void nMakeCurrent(ByteBuffer handle) throws LWJGLException; /** * Gets the Pbuffer capabilities. @@ -275,7 +284,7 @@ /** * Native method to create a Pbuffer */ - private static native int nCreate(boolean shared, int width, int height, PixelFormat pixel_format, + private static native void nCreate(ByteBuffer handle, boolean shared, int width, int height, PixelFormat pixel_format, IntBuffer pixelFormatCaps, IntBuffer pBufferAttribs) throws LWJGLException; @@ -300,7 +309,7 @@ /** * Natively destroy any GL-related stuff */ - private static native void nDestroy(int handle); + private static native void nDestroy(ByteBuffer handle); // ----------------------------------------------------------------------------------------- // ------------------------------- Render-to-Texture Methods ------------------------------- @@ -322,7 +331,7 @@ nSetAttrib(handle, attrib, value); } - private static native void nSetAttrib(int handle, int attrib, int value); + private static native void nSetAttrib(ByteBuffer handle, int attrib, int value); /** * Binds the currently bound texture to the buffer specified. The buffer can be one of the following: @@ -335,7 +344,7 @@ nBindTexImage(handle, buffer); } - private static native void nBindTexImage(int handle, int buffer); + private static native void nBindTexImage(ByteBuffer handle, int buffer); /** * Releases the currently bound texture from the buffer specified. @@ -346,7 +355,7 @@ nReleaseTexImage(handle, buffer); } - private static native void nReleaseTexImage(int handle, int buffer); + private static native void nReleaseTexImage(ByteBuffer handle, int buffer); /** * @return Returns the height. |
|
From: Elias N. <eli...@us...> - 2004-07-25 14:28:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23226/src/java/org/lwjgl/input Modified Files: Cursor.java Mouse.java Log Message: Converted Cursor and Pbuffer handles to ByteBuffers Index: Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Cursor.java 5 Jul 2004 14:06:39 -0000 1.27 +++ Cursor.java 25 Jul 2004 14:28:49 -0000 1.28 @@ -32,10 +32,10 @@ package org.lwjgl.input; import java.nio.ByteBuffer; -import java.nio.ByteOrder; import java.nio.IntBuffer; import org.lwjgl.LWJGLException; +import org.lwjgl.BufferUtils; import org.lwjgl.Sys; /** @@ -49,8 +49,9 @@ */ public class Cursor { + private final static int HANDLE_SIZE = 8; /** First element to display */ - private CursorElement[] cursors = null; + private final CursorElement[] cursors; /** Index into list of cursors */ private int index = 0; @@ -88,15 +89,15 @@ yHotspot = height - 1 - yHotspot; // create cursor (or cursors if multiple images supplied) - createCursors(width, height, xHotspot, yHotspot, numImages, images, delays); + cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays); } /** * Creates the actual cursor, using a platform specific class */ - private void createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { + private static CursorElement[] createCursors(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException { // create copy and flip images to match ogl - IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + IntBuffer images_copy = BufferUtils.createIntBuffer(images.remaining()); flipImages(width, height, numImages, images, images_copy); // Win32 doesn't (afaik) allow for animation based cursors, except when they're @@ -107,25 +108,30 @@ // might want to split it into a X/Win/Mac cursor if it gets too cluttered String osName = System.getProperty("os.name", ""); + CursorElement[] cursors; if (osName.startsWith("Win")) { // create our cursor elements cursors = new CursorElement[numImages]; for(int i=0; i<numImages; i++) { - cursors[i] = new CursorElement(); - cursors[i].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); - cursors[i].delay = (delays != null) ? delays.get(i) : 0; - cursors[i].timeout = System.currentTimeMillis(); + ByteBuffer handle = BufferUtils.createByteBuffer(HANDLE_SIZE); + nCreateCursor(handle, width, height, xHotspot, yHotspot, 1, images_copy, images_copy.position(), null, 0); + long delay = (delays != null) ? delays.get(i) : 0; + long timeout = System.currentTimeMillis(); + cursors[i] = new CursorElement(handle, delay, timeout); // offset to next image images_copy.position(width*height*(i+1)); } } else if (osName.startsWith("Lin")) { // create our cursor elements - cursors = new CursorElement[1]; - cursors[0] = new CursorElement(); - cursors[0].cursorHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1); + ByteBuffer handle = BufferUtils.createByteBuffer(HANDLE_SIZE); + nCreateCursor(handle, width, height, xHotspot, yHotspot, numImages, images_copy, images_copy.position(), delays, delays != null ? delays.position() : -1); + CursorElement cursor_element = new CursorElement(handle, -1, -1); + cursors = new CursorElement[]{cursor_element}; } else { + throw new RuntimeException("Unknown OS"); } + return cursors; } /** @@ -168,7 +174,7 @@ /** * Gets the native handle associated with the cursor object. */ - public long getHandle() { + ByteBuffer getHandle() { return cursors[index].cursorHandle; } @@ -215,24 +221,30 @@ /** * Native method to create a native cursor */ - private static native long nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset); + private static native void nCreateCursor(ByteBuffer handle, int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, int images_offset, IntBuffer delays, int delays_offset) throws LWJGLException; /** * Native method to destroy a native cursor */ - private static native void nDestroyCursor(long cursorHandle); + private static native void nDestroyCursor(ByteBuffer cursorHandle); /** * A single cursor element, used when animating */ - protected class CursorElement { + private static class CursorElement { /** Handle to cursor */ - long cursorHandle; + final ByteBuffer cursorHandle; /** How long a delay this element should have */ - long delay; + final long delay; /** Absolute time this element times out */ long timeout; + + CursorElement(ByteBuffer cursorHandle, long delay, long timeout) { + this.cursorHandle = cursorHandle; + this.delay = delay; + this.timeout = timeout; + } } } Index: Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- Mouse.java 17 Jul 2004 09:38:20 -0000 1.63 +++ Mouse.java 25 Jul 2004 14:28:49 -0000 1.64 @@ -200,14 +200,14 @@ nSetNativeCursor(currentCursor.getHandle()); currentCursor.setTimeout(); } else { - nSetNativeCursor(0); + nSetNativeCursor(null); } } return oldCursor; } /** Native method to set the native cursor */ - private static native void nSetNativeCursor(long handle) throws LWJGLException; + private static native void nSetNativeCursor(ByteBuffer handle) throws LWJGLException; /** * Gets the minimum size of a native cursor. Can only be called if |
|
From: Elias N. <eli...@us...> - 2004-07-25 07:01:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26242/src/java/org/lwjgl/opengl Modified Files: Pbuffer.java Log Message: Make Pbuffer.createPbufferUsingDisplayContext take a RenderTexture parameter Index: Pbuffer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Pbuffer.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Pbuffer.java 24 Jul 2004 20:05:51 -0000 1.24 +++ Pbuffer.java 25 Jul 2004 07:00:55 -0000 1.25 @@ -171,7 +171,7 @@ * Create an instance of a Pbuffer using the Display context. The buffer is double-buffered, like the Display. * <p/> * NOTE: The Pbuffer will use the same context as the Display and requires that the Display has been created. Therefore, - * no pixel format or render to texture parameters can be specified. All OpenGL state, + * no separate pixel format can be specified. All OpenGL state, * including display lists, textures etc. is shared between the Pbuffer and the Display. If the Display is destroyed, * the Pbuffer will not be usable, even if the Display is created again. * <p/> @@ -180,10 +180,10 @@ * @param width Pbuffer width * @param height Pbuffer height */ - public static Pbuffer createPbufferUsingDisplayContext(int width, int height) throws LWJGLException { + public static Pbuffer createPbufferUsingDisplayContext(int width, int height, RenderTexture renderTexture) throws LWJGLException { if (!Display.isCreated()) throw new IllegalStateException("The Display must be created before a shared Pbuffer can be created that use the Display context"); - int handle = createPbuffer(true, width, height, null, null); + int handle = createPbuffer(true, width, height, null, renderTexture); return new Pbuffer(width, height, Display.getContext(), handle); } |