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
|
From: <eli...@us...> - 2008-05-01 09:56:01
|
Revision: 3063 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3063&view=rev Author: elias_naur Date: 2008-05-01 02:55:54 -0700 (Thu, 01 May 2008) Log Message: ----------- Windows: Moved pixel format logic from WindowsDisplayPeerInfo.initDC to WindowsDisplay.createWindow Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-05-01 09:44:19 UTC (rev 3062) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-05-01 09:55:54 UTC (rev 3063) @@ -174,6 +174,8 @@ throw new LWJGLException("Failed to get dc"); } peer_info.initDC(getHwnd(), getHdc()); + int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, peer_info.getPixelFormat(), null, true, true, false, true); + WindowsPeerInfo.setPixelFormat(getHdc(), format); showWindow(getHwnd(), SW_SHOWDEFAULT); if (parent == null) { setForegroundWindow(getHwnd()); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-05-01 09:44:19 UTC (rev 3062) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-05-01 09:55:54 UTC (rev 3063) @@ -49,10 +49,12 @@ GLContext.loadOpenGLLibrary(); } + final PixelFormat getPixelFormat() { + return pixel_format; + } + void initDC(long hwnd, long hdc) throws LWJGLException { nInitDC(getHandle(), hwnd, hdc); - int format = choosePixelFormat(hdc, 0, 0, pixel_format, null, true, true, false, true); - setPixelFormat(hdc, format); } private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-05-01 09:44:22
|
Revision: 3062 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3062&view=rev Author: elias_naur Date: 2008-05-01 02:44:19 -0700 (Thu, 01 May 2008) Log Message: ----------- Windows: Made WindowsPeerInfo.choosePixelFormat static and let WindowsPeerInfo.setPixelFormat be called seperately Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java 2008-05-01 09:37:21 UTC (rev 3061) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsAWTGLCanvasPeerInfo.java 2008-05-01 09:44:19 UTC (rev 3062) @@ -58,7 +58,8 @@ nInitHandle(awt_surface.lockAndGetHandle(component), getHandle()); if (!has_pixel_format && pixel_format != null) { // If we haven't applied a pixel format yet, do it now - choosePixelFormat(component.getX(), component.getY(), pixel_format, null, true, true, false, true); + int format = choosePixelFormat(getHdc(), component.getX(), component.getY(), pixel_format, null, true, true, false, true); + setPixelFormat(getHdc(), format); has_pixel_format = true; } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-05-01 09:37:21 UTC (rev 3061) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-05-01 09:44:19 UTC (rev 3062) @@ -51,7 +51,8 @@ void initDC(long hwnd, long hdc) throws LWJGLException { nInitDC(getHandle(), hwnd, hdc); - choosePixelFormat(0, 0, pixel_format, null, true, true, false, true); + int format = choosePixelFormat(hdc, 0, 0, pixel_format, null, true, true, false, true); + setPixelFormat(hdc, format); } private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java 2008-05-01 09:37:21 UTC (rev 3061) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java 2008-05-01 09:44:19 UTC (rev 3062) @@ -48,12 +48,11 @@ } private static native ByteBuffer createHandle(); - protected void choosePixelFormat(int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { - int pixel_format_id = nChoosePixelFormat(getHdc(), origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered); - setPixelFormat(getHdc(), pixel_format_id); + protected static int choosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { + return nChoosePixelFormat(hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered); } private static native int nChoosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException; - private static native void setPixelFormat(long hdc, int pixel_format) throws LWJGLException; + protected static native void setPixelFormat(long hdc, int pixel_format) throws LWJGLException; public final long getHdc() { return nGetHdc(getHandle()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-05-01 09:37:29
|
Revision: 3061 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3061&view=rev Author: elias_naur Date: 2008-05-01 02:37:21 -0700 (Thu, 01 May 2008) Log Message: ----------- Windows: Split nChoosePixelFormat's applyPixelFormat() out in a seperate function Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java 2008-05-01 09:20:57 UTC (rev 3060) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsPeerInfo.java 2008-05-01 09:37:21 UTC (rev 3061) @@ -49,10 +49,17 @@ private static native ByteBuffer createHandle(); protected void choosePixelFormat(int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException { - nChoosePixelFormat(getHandle(), origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered); + int pixel_format_id = nChoosePixelFormat(getHdc(), origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, support_window, support_pbuffer, double_buffered); + setPixelFormat(getHdc(), pixel_format_id); } - private static native void nChoosePixelFormat(ByteBuffer peer_info_handle, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException; + private static native int nChoosePixelFormat(long hdc, int origin_x, int origin_y, PixelFormat pixel_format, IntBuffer pixel_format_caps, boolean use_hdc_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException; + private static native void setPixelFormat(long hdc, int pixel_format) throws LWJGLException; + public final long getHdc() { + return nGetHdc(getHandle()); + } + private static native long nGetHdc(ByteBuffer handle); + public final long getHwnd() { return nGetHwnd(getHandle()); } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2008-05-01 09:20:57 UTC (rev 3060) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsPeerInfo.c 2008-05-01 09:37:21 UTC (rev 3061) @@ -47,18 +47,25 @@ return newJavaManagedByteBuffer(env, sizeof(WindowsPeerInfo)); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nChoosePixelFormat - (JNIEnv *env, jclass clazz, jobject peer_info_handle, jint origin_x, jint origin_y, jobject pixel_format, jobject pixel_format_caps, jboolean use_hdc_bpp, jboolean window, jboolean pbuffer, jboolean double_buffer) { - WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nChoosePixelFormat + (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint origin_x, jint origin_y, jobject pixel_format, jobject pixel_format_caps, jboolean use_hdc_bpp, jboolean window, jboolean pbuffer, jboolean double_buffer) { + HDC hdc = (HDC)(INT_PTR)hdc_ptr; jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); bool floating_point = (bool)(*env)->GetBooleanField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "floating_point", "Z")); - int pixel_format_id = findPixelFormatOnDC(env, peer_info->drawable_hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); - if (pixel_format_id == -1) - return; - // Let it throw - applyPixelFormat(env, peer_info->drawable_hdc, pixel_format_id); + return findPixelFormatOnDC(env, hdc, origin_x, origin_y, pixel_format, pixel_format_caps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); } +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_setPixelFormat + (JNIEnv *env, jclass clazz, jlong hdc_ptr, jint pixel_format) { + HDC hdc = (HDC)(INT_PTR)hdc_ptr; + applyPixelFormat(env, hdc, pixel_format); +} + +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHdc(JNIEnv *env, jclass unused, jobject peer_info_handle) { + WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); + return (intptr_t)peer_info->drawable_hdc; +} + JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsPeerInfo_nGetHwnd(JNIEnv *env, jclass unused, jobject peer_info_handle) { WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); return (intptr_t)peer_info->u.hwnd; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-05-01 09:21:00
|
Revision: 3060 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3060&view=rev Author: elias_naur Date: 2008-05-01 02:20:57 -0700 (Thu, 01 May 2008) Log Message: ----------- Windows: Moved icon handles to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 19:00:08 UTC (rev 3059) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-05-01 09:20:57 UTC (rev 3060) @@ -45,7 +45,7 @@ * $Id$ */ final class WindowsSysImplementation extends DefaultSysImplementation { - private final static int JNI_VERSION = 17; + private final static int JNI_VERSION = 18; static { Sys.initialize(); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 19:00:08 UTC (rev 3059) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-05-01 09:20:57 UTC (rev 3060) @@ -68,6 +68,7 @@ private final static int WM_SYSKEYDOWN = 260; private final static int WM_SYSCHAR = 262; private final static int WM_CHAR = 258; + private final static int WM_SETICON = 0x0080; private final static int WM_QUIT = 0x0012; private final static int WM_SYSCOMMAND = 0x0112; @@ -113,6 +114,9 @@ private final static int SW_SHOWDEFAULT = 10; private final static int SW_RESTORE = 9; + private final static int ICON_SMALL = 0; + private final static int ICON_BIG = 1; + private final static IntBuffer rect_buffer = BufferUtils.createIntBuffer(4); private final static Rect rect = new Rect(); private final static Rect rect2 = new Rect(); @@ -143,6 +147,9 @@ private long hwnd; private long hdc; + private long small_icon; + private long large_icon; + public WindowsDisplay() { current_display = this; } @@ -192,6 +199,8 @@ public void destroyWindow() { nDestroyWindow(hwnd, hdc); + freeLargeIcon(); + freeSmallIcon(); resetCursorClipping(); } private static native void nDestroyWindow(long hwnd, long hdc); @@ -580,7 +589,20 @@ ((WindowsPbufferPeerInfo)handle).releaseTexImageFromPbuffer(buffer); } + private void freeSmallIcon() { + if (small_icon != 0) { + destroyIcon(small_icon); + small_icon = 0; + } + } + private void freeLargeIcon() { + if (large_icon != 0) { + destroyIcon(large_icon); + large_icon = 0; + } + } + /** * Sets one or more icons for the Display. * <ul> @@ -604,12 +626,16 @@ int size = icons[i].limit() / 4; if ((((int) Math.sqrt(size)) == small_icon_size) && (!done_small)) { - nSetWindowIconSmall(hwnd, small_icon_size, small_icon_size, icons[i].asIntBuffer()); + freeSmallIcon(); + small_icon = createIcon(small_icon_size, small_icon_size, icons[i].asIntBuffer()); + sendMessage(hwnd, WM_SETICON, ICON_SMALL, small_icon); used++; done_small = true; } if ((((int) Math.sqrt(size)) == large_icon_size) && (!done_large)) { - nSetWindowIconLarge(hwnd, large_icon_size, large_icon_size, icons[i].asIntBuffer()); + freeLargeIcon(); + large_icon = createIcon(large_icon_size, large_icon_size, icons[i].asIntBuffer()); + sendMessage(hwnd, WM_SETICON, ICON_BIG, large_icon); used++; done_large = true; } @@ -617,11 +643,10 @@ return used; } + private static native long createIcon(int width, int height, IntBuffer icon); + private static native void destroyIcon(long handle); + private static native long sendMessage(long hwnd, long msg, long wparam, long lparam); - private static native int nSetWindowIconSmall(long hwnd, int width, int height, IntBuffer icon); - - private static native int nSetWindowIconLarge(long hwnd, int width, int height, IntBuffer icon); - private void handleMouseButton(int button, int state, long millis) { if (mouse != null) mouse.handleMouseButton((byte)button, (byte)state, millis); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 19:00:08 UTC (rev 3059) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-05-01 09:20:57 UTC (rev 3060) @@ -50,25 +50,8 @@ #include "org_lwjgl_WindowsSysImplementation.h" #include "context.h" -static HICON small_icon = NULL; -static HICON large_icon = NULL; - #define WINDOWCLASSNAME "LWJGL" -static void freeLargeIcon() { - if (large_icon != NULL) { - DestroyIcon(large_icon); - large_icon = NULL; - } -} - -static void freeSmallIcon() { - if (small_icon != NULL) { - DestroyIcon(small_icon); - small_icon = NULL; - } -} - /* * WindowProc for the GL window. */ @@ -173,8 +156,6 @@ closeWindow(hwnd, hdc); if (display_class_global != NULL) (*env)->DeleteGlobalRef(env, display_class_global); - freeLargeIcon(); - freeSmallIcon(); } JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) { @@ -453,42 +434,22 @@ return icon; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconSmall - (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer) -{ - HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_destroyIcon + (JNIEnv *env, jclass clazz, jlong handle) { + HICON icon = (HICON)(INT_PTR)handle; + DestroyIcon(icon); +} + +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_createIcon + (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) { jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); - - freeSmallIcon(); - small_icon = createWindowIcon(env, imgData, width, height); - if (small_icon != NULL) { - if (hwnd != NULL) { - SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon)); - - return 0; - } - } - - return -1; + return (INT_PTR)createWindowIcon(env, imgData, width, height); } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconLarge - (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer) -{ +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_sendMessage + (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong msg, jlong wparam, jlong lparam) { HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; - jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); - - freeLargeIcon(); - large_icon = createWindowIcon(env, imgData, width, height); - if (large_icon != NULL) { - if (hwnd != NULL) { - SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon)); - - return 0; - } - } - - return -1; + return SendMessage(hwnd, (UINT)msg, (WPARAM)wparam, (LPARAM)lparam); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetCursorPosition This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 19:00:15
|
Revision: 3059 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3059&view=rev Author: elias_naur Date: 2008-04-30 12:00:08 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Windows: Check for Display.isCreated in Sys.getHwnd() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:40:14 UTC (rev 3058) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 19:00:08 UTC (rev 3059) @@ -65,6 +65,8 @@ private static native long nGetTime(); private static long getHwnd() { + if (!Display.isCreated()) + return 0; /* Use reflection since we can't make Display.getImplementation * public */ @@ -74,8 +76,6 @@ Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null); getImplementation_method.setAccessible(true); Object display_impl = getImplementation_method.invoke(null, null); - if (display_impl == null) - return null; Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay"); Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null); getHwnd_method.setAccessible(true); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 16:40:22
|
Revision: 3058 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3058&view=rev Author: elias_naur Date: 2008-04-30 09:40:14 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Windows: Moved hwnd and hdc to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/windows/Window.h trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:01:25 UTC (rev 3057) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 16:40:14 UTC (rev 3058) @@ -31,7 +31,13 @@ */ package org.lwjgl; +import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; +import java.security.AccessController; +import java.lang.reflect.Method; +import org.lwjgl.opengl.Display; + /** * <p> * @author $Author$ @@ -39,7 +45,7 @@ * $Id$ */ final class WindowsSysImplementation extends DefaultSysImplementation { - private final static int JNI_VERSION = 16; + private final static int JNI_VERSION = 17; static { Sys.initialize(); @@ -53,10 +59,41 @@ return 1000; } - public native long getTime(); + public long getTime() { + return nGetTime(); + } + private static native long nGetTime(); - public native void alert(String title, String message); + private static long getHwnd() { + /* Use reflection since we can't make Display.getImplementation + * public + */ + try { + Long hwnd_obj = (Long)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + Method getImplementation_method = Display.class.getDeclaredMethod("getImplementation", null); + getImplementation_method.setAccessible(true); + Object display_impl = getImplementation_method.invoke(null, null); + if (display_impl == null) + return null; + Class WindowsDisplay_class = Class.forName("org.lwjgl.opengl.WindowsDisplay"); + Method getHwnd_method = WindowsDisplay_class.getDeclaredMethod("getHwnd", null); + getHwnd_method.setAccessible(true); + Long hwnd = (Long)getHwnd_method.invoke(display_impl, null); + return hwnd; + } + }); + return hwnd_obj.longValue(); + } catch (PrivilegedActionException e) { + throw new Error(e); + } + } + public void alert(String title, String message) { + nAlert(getHwnd(), title, message); + } + private static native void nAlert(long parent_hwnd, String title, String message); + public boolean openURL(final String url) { try { LWJGLUtil.execPrivileged(new String[]{"rundll32", "url.dll,FileProtocolHandler", url}); @@ -67,5 +104,8 @@ } } - public native String getClipboard(); + public String getClipboard() { + return nGetClipboard(); + } + private static native String nGetClipboard(); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:01:25 UTC (rev 3057) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:40:14 UTC (rev 3058) @@ -140,6 +140,9 @@ private boolean did_maximize; private boolean inAppActivate; + private long hwnd; + private long hdc; + public WindowsDisplay() { current_display = this; } @@ -154,7 +157,15 @@ this.parent = parent; long parent_hwnd = parent != null ? getHwnd(parent) : 0; boolean isUndecorated = isUndecorated(); - nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd); + this.hwnd = nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd); + if (hwnd == 0) { + throw new LWJGLException("Failed to create window"); + } + this.hdc = getDC(hwnd); + if (hdc == 0) { + nDestroyWindow(hwnd, hdc); + throw new LWJGLException("Failed to get dc"); + } peer_info.initDC(getHwnd(), getHdc()); showWindow(getHwnd(), SW_SHOWDEFAULT); if (parent == null) { @@ -162,7 +173,7 @@ setFocus(getHwnd()); } } - private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException; + private native long nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException; private static boolean isUndecorated() { return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); @@ -180,10 +191,10 @@ } public void destroyWindow() { - nDestroyWindow(); + nDestroyWindow(hwnd, hdc); resetCursorClipping(); } - private static native void nDestroyWindow(); + private static native void nDestroyWindow(long hwnd, long hdc); static void resetCursorClipping() { if (cursor_clipped) { try { @@ -338,7 +349,10 @@ } private static native DisplayMode getCurrentDisplayMode() throws LWJGLException; - public native void setTitle(String title); + public void setTitle(String title) { + nSetTitle(hwnd, title); + } + private static native void nSetTitle(long hwnd, String title); public boolean isCloseRequested() { boolean saved = close_requested; @@ -467,11 +481,19 @@ static native int getSystemMetrics(int index); private static native long getDllInstance(); - private static native long getHwnd(); - private static native long getHdc(); + + private long getHwnd() { + return hwnd; + } + + private long getHdc() { + return hdc; + } + + private static native long getDC(long hwnd); private static native long getDesktopWindow(); static void centerCursor(long hwnd) { - getGlobalClientRect(getHwnd(), rect); + getGlobalClientRect(hwnd, rect); int local_offset_x = rect.left; int local_offset_y = rect.top; getGlobalClientRect(getDesktopWindow(), rect2); @@ -482,7 +504,7 @@ int local_x = center_x - local_offset_x; int local_y = center_y - local_offset_y; if (current_display != null) - current_display.setMousePosition(local_x, transformY(getHwnd(), local_y)); + current_display.setMousePosition(local_x, transformY(hwnd, local_y)); } private void setMousePosition(int x, int y) { @@ -582,12 +604,12 @@ int size = icons[i].limit() / 4; if ((((int) Math.sqrt(size)) == small_icon_size) && (!done_small)) { - nSetWindowIconSmall(small_icon_size, small_icon_size, icons[i].asIntBuffer()); + nSetWindowIconSmall(hwnd, small_icon_size, small_icon_size, icons[i].asIntBuffer()); used++; done_small = true; } if ((((int) Math.sqrt(size)) == large_icon_size) && (!done_large)) { - nSetWindowIconLarge(large_icon_size, large_icon_size, icons[i].asIntBuffer()); + nSetWindowIconLarge(hwnd, large_icon_size, large_icon_size, icons[i].asIntBuffer()); used++; done_large = true; } @@ -596,9 +618,9 @@ return used; } - private static native int nSetWindowIconSmall(int width, int height, IntBuffer icon); + private static native int nSetWindowIconSmall(long hwnd, int width, int height, IntBuffer icon); - private static native int nSetWindowIconLarge(int width, int height, IntBuffer icon); + private static native int nSetWindowIconLarge(long hwnd, int width, int height, IntBuffer icon); private void handleMouseButton(int button, int state, long millis) { if (mouse != null) Modified: trunk/LWJGL/src/native/windows/Window.h =================================================================== --- trunk/LWJGL/src/native/windows/Window.h 2008-04-30 16:01:25 UTC (rev 3057) +++ trunk/LWJGL/src/native/windows/Window.h 2008-04-30 16:40:14 UTC (rev 3058) @@ -62,7 +62,4 @@ #define WINDOW_H_API extern #endif /* _PRIVATE_WINDOW_H_ */ - WINDOW_H_API HDC getCurrentHDC(); - - WINDOW_H_API HWND getCurrentHWND(); #endif /* _LWJGL_WINDOW_H_INCLUDED_ */ Modified: trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2008-04-30 16:01:25 UTC (rev 3057) +++ trunk/LWJGL/src/native/windows/org_lwjgl_Sys.c 2008-04-30 16:40:14 UTC (rev 3058) @@ -45,7 +45,7 @@ #include "common_tools.h" #include <malloc.h> -JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_getTime(JNIEnv * env, jobject ignored) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetTime(JNIEnv * env, jclass unused) { DWORD time; timeBeginPeriod(1); @@ -55,10 +55,11 @@ return time; } -JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_alert(JNIEnv * env, jobject ignored, jstring title, jstring message) { +JNIEXPORT void JNICALL Java_org_lwjgl_WindowsSysImplementation_nAlert(JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title, jstring message) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; char * eMessageText = GetStringNativeChars(env, message); char * cTitleBarText = GetStringNativeChars(env, title); - MessageBox(getCurrentHWND(), eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); + MessageBox(hwnd, eMessageText, cTitleBarText, MB_OK | MB_TOPMOST); printfDebugJava(env, "*** Alert ***%s\n%s\n", cTitleBarText, eMessageText); @@ -66,8 +67,8 @@ free(cTitleBarText); } -JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_getClipboard - (JNIEnv * env, jobject ignored) +JNIEXPORT jstring JNICALL Java_org_lwjgl_WindowsSysImplementation_nGetClipboard + (JNIEnv * env, jclass unused) { // Check to see if there's text available in the clipboard BOOL textAvailable = IsClipboardFormatAvailable(CF_TEXT); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:01:25 UTC (rev 3057) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:40:14 UTC (rev 3058) @@ -52,20 +52,9 @@ static HICON small_icon = NULL; static HICON large_icon = NULL; -static HWND display_hwnd = NULL; // Handle to the window -static HDC display_hdc = NULL; // Device context - // has recovered from minimized #define WINDOWCLASSNAME "LWJGL" -HDC getCurrentHDC() { - return display_hdc; -} - -HWND getCurrentHWND() { - return display_hwnd; -} - static void freeLargeIcon() { if (large_icon != NULL) { DestroyIcon(large_icon); @@ -140,33 +129,29 @@ * work properly */ MSG msg; - if (display_hwnd != NULL) { - while (!(*env)->ExceptionOccurred(env) && PeekMessage( - &msg, // message information - NULL, // handle to window - 0, // first message - 0, // last message - PM_REMOVE // removal options - )) - { - DispatchMessage(&msg); - TranslateMessage(&msg); - } + while (!(*env)->ExceptionOccurred(env) && PeekMessage( + &msg, // message information + NULL, // handle to window + 0, // first message + 0, // last message + PM_REMOVE // removal options + )) + { + DispatchMessage(&msg); + TranslateMessage(&msg); } } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHdc(JNIEnv *env, jclass unused) { - return (INT_PTR)display_hdc; +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getDC(JNIEnv *env, jclass unused, jlong hwnd_ptr) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; + return (INT_PTR)GetDC(hwnd); } -JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHwnd(JNIEnv *env, jclass unused) { - return (INT_PTR)display_hwnd; -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setTitle - (JNIEnv * env, jobject self, jstring title_obj) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetTitle + (JNIEnv * env, jclass unused, jlong hwnd_ptr, jstring title_obj) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; char * title = GetStringNativeChars(env, title_obj); - SetWindowText(display_hwnd, title); + SetWindowText(hwnd, title); free(title); } @@ -183,45 +168,39 @@ return org_lwjgl_WindowsSysImplementation_JNI_VERSION; } -static void destroyWindow(JNIEnv *env) { - jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA); - closeWindow(&display_hwnd, &display_hdc); +static void destroyWindow(JNIEnv *env, HWND *hwnd, HDC *hdc) { + jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(*hwnd, GWLP_USERDATA); + closeWindow(hwnd, hdc); if (display_class_global != NULL) (*env)->DeleteGlobalRef(env, display_class_global); freeLargeIcon(); freeSmallIcon(); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) { +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) { jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); int width = (*env)->GetIntField(env, mode, fid_width); int height = (*env)->GetIntField(env, mode, fid_height); + HWND hwnd; static bool oneShotInitialised = false; if (!oneShotInitialised) { if (!registerWindow(lwjglWindowProc, WINDOWCLASSNAME)) { throwException(env, "Could not register window class"); - return; + return 0; } oneShotInitialised = true; } - display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd); - if (display_hwnd == NULL) { - throwException(env, "Failed to create the window."); - return; - } - display_hdc = GetDC(display_hwnd); - if (display_hdc == NULL) { - destroyWindow(env); - throwException(env, "Failed to get the window DC."); - return; - } + hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd); + return (INT_PTR)hwnd; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) { - destroyWindow(env); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz, jlong hwnd_ptr, jlong hdc_ptr) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; + HDC hdc = (HDC)(INT_PTR)hdc_ptr; + destroyWindow(env, &hwnd, &hdc); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) { @@ -475,15 +454,16 @@ } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconSmall - (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) + (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); freeSmallIcon(); small_icon = createWindowIcon(env, imgData, width, height); if (small_icon != NULL) { - if (display_hwnd != NULL) { - SendMessage(display_hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon)); + if (hwnd != NULL) { + SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) (small_icon)); return 0; } @@ -493,15 +473,16 @@ } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nSetWindowIconLarge - (JNIEnv *env, jclass clazz, jint width, jint height, jobject iconBuffer) + (JNIEnv *env, jclass clazz, jlong hwnd_ptr, jint width, jint height, jobject iconBuffer) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; jint *imgData = (jint *)(*env)->GetDirectBufferAddress(env, iconBuffer); freeLargeIcon(); large_icon = createWindowIcon(env, imgData, width, height); if (large_icon != NULL) { - if (display_hwnd != NULL) { - SendMessage(display_hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon)); + if (hwnd != NULL) { + SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) (large_icon)); return 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 16:01:27
|
Revision: 3057 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3057&view=rev Author: elias_naur Date: 2008-04-30 09:01:25 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Windows: Made WindowsDisplayPeerInfo take hwnd and hdc arguments Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 15:29:39 UTC (rev 3056) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 16:01:25 UTC (rev 3057) @@ -155,7 +155,7 @@ long parent_hwnd = parent != null ? getHwnd(parent) : 0; boolean isUndecorated = isUndecorated(); nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd); - peer_info.initDC(); + peer_info.initDC(getHwnd(), getHdc()); showWindow(getHwnd(), SW_SHOWDEFAULT); if (parent == null) { setForegroundWindow(getHwnd()); @@ -468,6 +468,7 @@ private static native long getDllInstance(); private static native long getHwnd(); + private static native long getHdc(); private static native long getDesktopWindow(); static void centerCursor(long hwnd) { getGlobalClientRect(getHwnd(), rect); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-04-30 15:29:39 UTC (rev 3056) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplayPeerInfo.java 2008-04-30 16:01:25 UTC (rev 3057) @@ -49,11 +49,11 @@ GLContext.loadOpenGLLibrary(); } - void initDC() throws LWJGLException { - nInitDC(getHandle()); + void initDC(long hwnd, long hdc) throws LWJGLException { + nInitDC(getHandle(), hwnd, hdc); choosePixelFormat(0, 0, pixel_format, null, true, true, false, true); } - private static native void nInitDC(ByteBuffer peer_info_handle); + private static native void nInitDC(ByteBuffer peer_info_handle, long hwnd, long hdc); protected void doLockAndInitHandle() throws LWJGLException { // NO-OP Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 15:29:39 UTC (rev 3056) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 16:01:25 UTC (rev 3057) @@ -155,15 +155,14 @@ } } +JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHdc(JNIEnv *env, jclass unused) { + return (INT_PTR)display_hdc; +} + JNIEXPORT jlong JNICALL Java_org_lwjgl_opengl_WindowsDisplay_getHwnd(JNIEnv *env, jclass unused) { return (INT_PTR)display_hwnd; } -/* - * Class: org_lwjgl_Window - * Method: nSetTitle - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_setTitle (JNIEnv * env, jobject self, jstring title_obj) { char * title = GetStringNativeChars(env, title_obj); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2008-04-30 15:29:39 UTC (rev 3056) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsDisplayPeerInfo.c 2008-04-30 16:01:25 UTC (rev 3057) @@ -44,8 +44,10 @@ #include "common_tools.h" JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplayPeerInfo_nInitDC - (JNIEnv *env, jclass clazz, jobject peer_info_handle) { + (JNIEnv *env, jclass clazz, jobject peer_info_handle, jlong hwnd_ptr, jlong hdc_ptr) { + HWND hwnd = (HWND)(INT_PTR)hwnd_ptr; + HDC hdc = (HDC)(INT_PTR)hdc_ptr; WindowsPeerInfo *peer_info = (WindowsPeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - peer_info->drawable_hdc = getCurrentHDC(); - peer_info->u.hwnd = getCurrentHWND(); + peer_info->drawable_hdc = hdc; + peer_info->u.hwnd = hwnd; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 15:29:42
|
Revision: 3056 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3056&view=rev Author: elias_naur Date: 2008-04-30 08:29:39 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Windows: Moved child window style selection to java Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/native/windows/context.c trunk/LWJGL/src/native/windows/context.h trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 14:58:47 UTC (rev 3055) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2008-04-30 15:29:39 UTC (rev 3056) @@ -154,7 +154,7 @@ this.parent = parent; long parent_hwnd = parent != null ? getHwnd(parent) : 0; boolean isUndecorated = isUndecorated(); - nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent_hwnd); + nCreateWindow(mode, fullscreen, x, y, isUndecorated, parent != null, parent_hwnd); peer_info.initDC(); showWindow(getHwnd(), SW_SHOWDEFAULT); if (parent == null) { @@ -162,7 +162,7 @@ setFocus(getHwnd()); } } - private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, long parent_hwnd) throws LWJGLException; + private native void nCreateWindow(DisplayMode mode, boolean fullscreen, int x, int y, boolean undecorated, boolean child_window, long parent_hwnd) throws LWJGLException; private static boolean isUndecorated() { return Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); Modified: trunk/LWJGL/src/native/windows/context.c =================================================================== --- trunk/LWJGL/src/native/windows/context.c 2008-04-30 14:58:47 UTC (rev 3055) +++ trunk/LWJGL/src/native/windows/context.c 2008-04-30 15:29:39 UTC (rev 3056) @@ -139,13 +139,13 @@ * * Returns true for success, or false for failure */ -HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, HWND parent) +HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, bool child_window, HWND parent) { RECT clientSize; DWORD exstyle, windowflags; HWND new_hwnd; - getWindowFlags(&windowflags, &exstyle, fullscreen, undecorated, parent != NULL); + getWindowFlags(&windowflags, &exstyle, fullscreen, undecorated, child_window); // If we're not a fullscreen window, adjust the height to account for the // height of the title bar (unless undecorated) @@ -468,5 +468,5 @@ HWND createDummyWindow(int origin_x, int origin_y) { if (!registerDummyWindow()) return NULL; - return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, NULL); + return createWindow(_CONTEXT_PRIVATE_CLASS_NAME, origin_x, origin_y, 1, 1, false, false, false, NULL); } Modified: trunk/LWJGL/src/native/windows/context.h =================================================================== --- trunk/LWJGL/src/native/windows/context.h 2008-04-30 14:58:47 UTC (rev 3055) +++ trunk/LWJGL/src/native/windows/context.h 2008-04-30 15:29:39 UTC (rev 3056) @@ -89,7 +89,7 @@ * * Returns true for success, or false for failure */ -extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, HWND parent); +extern HWND createWindow(LPCTSTR window_class_name, int x, int y, int width, int height, bool fullscreen, bool undecorated, bool child_window, HWND parent); extern int findPixelFormatOnDC(JNIEnv *env, HDC hdc, int origin_x, int origin_y, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 15:29:39 UTC (rev 3056) @@ -193,7 +193,7 @@ freeSmallIcon(); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jlong parent_hwnd) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jboolean child_window, jlong parent_hwnd) { jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); jfieldID fid_height = (*env)->GetFieldID(env, cls_displayMode, "height", "I"); @@ -208,7 +208,7 @@ oneShotInitialised = true; } - display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, (HWND)parent_hwnd); + display_hwnd = createWindow(WINDOWCLASSNAME, x, y, width, height, fullscreen, undecorated, child_window, (HWND)parent_hwnd); if (display_hwnd == NULL) { throwException(env, "Failed to create the window."); return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 14:58:52
|
Revision: 3055 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3055&view=rev Author: elias_naur Date: 2008-04-30 07:58:47 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Added platform specific getJNIVersion implementations Modified Paths: -------------- trunk/LWJGL/build.xml trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java trunk/LWJGL/src/native/common/common_tools.c trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/build.xml 2008-04-30 14:58:47 UTC (rev 3055) @@ -177,6 +177,7 @@ <!-- Generates the native headers from source files --> <target name="headers" description="invokes javah on java classes" depends="compile"> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/linux" force="yes"> + <class name="org.lwjgl.LinuxSysImplementation" /> <class name="org.lwjgl.opengl.LinuxEvent" /> <class name="org.lwjgl.opengl.LinuxMouse" /> <class name="org.lwjgl.opengl.LinuxKeyboard" /> @@ -202,6 +203,7 @@ </javah> <javah classpath="${lwjgl.bin}" destdir="${lwjgl.src.native}/macosx" force="yes"> + <class name="org.lwjgl.MacOSXSysImplementation" /> <class name="org.lwjgl.opengl.MacOSXMouseEventQueue" /> <class name="org.lwjgl.opengl.MacOSXCanvasPeerInfo" /> <class name="org.lwjgl.opengl.MacOSXPeerInfo" /> Modified: trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/java/org/lwjgl/DefaultSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055) @@ -39,9 +39,6 @@ * $Id$ */ abstract class DefaultSysImplementation implements SysImplementation { - /** Included to let native have easy access to Sys.JNI_VERSION */ - private final static int JNI_VERSION = Sys.JNI_VERSION; - public native int getJNIVersion(); public native void setDebug(boolean debug); Modified: trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055) @@ -39,12 +39,14 @@ * $Id$ */ final class LinuxSysImplementation extends J2SESysImplementation { + private final static int JNI_VERSION = 16; + static { java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded } public int getRequiredJNIVersion() { - return 16; + return JNI_VERSION; } public boolean openURL(final String url) { Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055) @@ -45,13 +45,15 @@ * $Id$ */ final class MacOSXSysImplementation extends J2SESysImplementation { + private final static int JNI_VERSION = 16; + static { // Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3 Toolkit.getDefaultToolkit(); } public int getRequiredJNIVersion() { - return 16; + return JNI_VERSION; } public boolean openURL(String url) { Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:58:47 UTC (rev 3055) @@ -39,12 +39,14 @@ * $Id$ */ final class WindowsSysImplementation extends DefaultSysImplementation { + private final static int JNI_VERSION = 16; + static { Sys.initialize(); } public int getRequiredJNIVersion() { - return 16; + return JNI_VERSION; } public long getTimerResolution() { Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-30 14:58:47 UTC (rev 3055) @@ -58,11 +58,6 @@ list->current_index++; } -JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion - (JNIEnv *env, jobject ignored) { - return org_lwjgl_DefaultSysImplementation_JNI_VERSION; -} - JNIEXPORT void JNICALL Java_org_lwjgl_DefaultSysImplementation_setDebug (JNIEnv *env, jobject ignored, jboolean enable) { debug = enable == JNI_TRUE ? true : false; Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055) @@ -54,6 +54,7 @@ #include "context.h" #include "org_lwjgl_opengl_LinuxDisplay.h" #include "org_lwjgl_opengl_LinuxDisplayPeerInfo.h" +#include "org_lwjgl_LinuxSysImplementation.h" #define ERR_MSG_SIZE 1024 @@ -108,6 +109,11 @@ return (intptr_t)display_connection; } +JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion + (JNIEnv *env, jobject ignored) { + return org_lwjgl_LinuxSysImplementation_JNI_VERSION; +} + JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_LinuxDisplay_getErrorText(JNIEnv *env, jclass unused, jlong display_ptr, jlong error_code) { Display *disp = (Display *)(intptr_t)display_ptr; char err_msg_buffer[ERR_MSG_SIZE]; Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_opengl_Display.m 2008-04-30 14:58:47 UTC (rev 3055) @@ -47,9 +47,15 @@ //#import "display.h" #import "common_tools.h" #import "org_lwjgl_opengl_MacOSXDisplay.h" +#import "org_lwjgl_MacOSXSysImplementation.h" #define WAIT_DELAY 100 +JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion + (JNIEnv *env, jobject ignored) { + return org_lwjgl_MacOSXSysImplementation_JNI_VERSION; +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXDisplay_restoreGamma(JNIEnv *env, jobject this) { CGDisplayRestoreColorSyncSettings(); } Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:34:54 UTC (rev 3054) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-30 14:58:47 UTC (rev 3055) @@ -47,6 +47,7 @@ #include "common_tools.h" #include "display.h" #include "org_lwjgl_opengl_WindowsDisplay.h" +#include "org_lwjgl_WindowsSysImplementation.h" #include "context.h" static HICON small_icon = NULL; @@ -178,6 +179,11 @@ return getAvailableDisplayModes(env); } +JNIEXPORT jint JNICALL Java_org_lwjgl_DefaultSysImplementation_getJNIVersion + (JNIEnv *env, jobject ignored) { + return org_lwjgl_WindowsSysImplementation_JNI_VERSION; +} + static void destroyWindow(JNIEnv *env) { jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA); closeWindow(&display_hwnd, &display_hdc); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 14:34:59
|
Revision: 3054 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3054&view=rev Author: elias_naur Date: 2008-04-30 07:34:54 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Moved Sys.JNI_VERSION to SysImplementation.getRequiredJNIVersion() to enable platform specific native library versions. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java Modified: trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053) +++ trunk/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) @@ -38,11 +38,15 @@ * @version $Revision$ * $Id$ */ -class LinuxSysImplementation extends J2SESysImplementation { +final class LinuxSysImplementation extends J2SESysImplementation { static { java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded } + public int getRequiredJNIVersion() { + return 16; + } + public boolean openURL(final String url) { // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it // right anyway. Modified: trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053) +++ trunk/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) @@ -44,12 +44,16 @@ * @version $Revision$ * $Id$ */ -class MacOSXSysImplementation extends J2SESysImplementation { +final class MacOSXSysImplementation extends J2SESysImplementation { static { // Make sure AWT is properly initialized. This avoids hangs on Mac OS X 10.3 Toolkit.getDefaultToolkit(); } + public int getRequiredJNIVersion() { + return 16; + } + public boolean openURL(String url) { try { FileManager.openURL(url); Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2008-04-30 13:47:26 UTC (rev 3053) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2008-04-30 14:34:54 UTC (rev 3054) @@ -56,9 +56,6 @@ /** Current version of library */ private static final String VERSION = "2.0b1"; - /** Current version of the JNI library */ - static final int JNI_VERSION = 16; - /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; @@ -101,8 +98,9 @@ loadLibrary(JNI_LIBRARY_NAME); int native_jni_version = implementation.getJNIVersion(); - if (native_jni_version != JNI_VERSION) - throw new LinkageError("Version mismatch: jar version is '" + JNI_VERSION + + int required_version = implementation.getRequiredJNIVersion(); + if (native_jni_version != required_version) + throw new LinkageError("Version mismatch: jar version is '" + required_version + "', native libary version is '" + native_jni_version + "'"); implementation.setDebug(LWJGLUtil.DEBUG); } @@ -112,9 +110,9 @@ case LWJGLUtil.PLATFORM_LINUX: return new LinuxSysImplementation(); case LWJGLUtil.PLATFORM_WINDOWS: - return new org.lwjgl.WindowsSysImplementation(); + return new WindowsSysImplementation(); case LWJGLUtil.PLATFORM_MACOSX: - return new org.lwjgl.MacOSXSysImplementation(); + return new MacOSXSysImplementation(); default: throw new IllegalStateException("Unsupported platform"); } Modified: trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053) +++ trunk/LWJGL/src/java/org/lwjgl/SysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) @@ -42,6 +42,11 @@ */ interface SysImplementation { /** + * Return the required version of the native library + */ + int getRequiredJNIVersion(); + + /** * Return the version of the native library */ int getJNIVersion(); Modified: trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 13:47:26 UTC (rev 3053) +++ trunk/LWJGL/src/java/org/lwjgl/WindowsSysImplementation.java 2008-04-30 14:34:54 UTC (rev 3054) @@ -38,11 +38,15 @@ * @version $Revision$ * $Id$ */ -class WindowsSysImplementation extends DefaultSysImplementation { +final class WindowsSysImplementation extends DefaultSysImplementation { static { Sys.initialize(); } + public int getRequiredJNIVersion() { + return 16; + } + public long getTimerResolution() { return 1000; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 13:47:29
|
Revision: 3053 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3053&view=rev Author: elias_naur Date: 2008-04-30 06:47:26 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Mac OS X: Worked around another Display.destroy hang when parented to an applet Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2008-04-30 13:16:53 UTC (rev 3052) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXCanvasListener.java 2008-04-30 13:47:26 UTC (rev 3053) @@ -53,18 +53,19 @@ public MacOSXCanvasListener(Canvas canvas) { this.canvas = canvas; -// ((MacOSXDisplay)Display.getImplementation()).setView(this); - } - - public void enableListeners() { canvas.addComponentListener(this); canvas.addHierarchyListener(this); setUpdate(); } public void disableListeners() { - canvas.removeComponentListener(this); - canvas.removeHierarchyListener(this); + // Mac OS X applets will hang in Display.destroy() when parented when removing the listeners directly + java.awt.EventQueue.invokeLater(new Runnable() { + public final void run() { + canvas.removeComponentListener(MacOSXCanvasListener.this); + canvas.removeHierarchyListener(MacOSXCanvasListener.this); + } + }); } public boolean syncShouldUpdateContext() { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:16:53 UTC (rev 3052) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:47:26 UTC (rev 3053) @@ -107,7 +107,6 @@ canvas = parent; } canvas_listener = new MacOSXCanvasListener(canvas); - canvas_listener.enableListeners(); robot = AWTUtil.createRobot(canvas); } catch (LWJGLException e) { destroyWindow(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 13:21:18
|
Revision: 3052 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3052&view=rev Author: elias_naur Date: 2008-04-30 06:16:53 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Mac OS X: Fixed a hang on Display.destroy in applets Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 12:46:54 UTC (rev 3051) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java 2008-04-30 13:16:53 UTC (rev 3052) @@ -327,7 +327,7 @@ public void destroyMouse() { if (mouse_queue != null) { - mouse_queue.setGrabbed(false); + MacOSXMouseEventQueue.nGrabMouse(false); mouse_queue.unregister(); } this.mouse_queue = null; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2008-04-30 12:46:54 UTC (rev 3051) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2008-04-30 13:16:53 UTC (rev 3052) @@ -107,5 +107,5 @@ private static native void nWarpCursor(int x, int y); - private static native void nGrabMouse(boolean grab); + static native void nGrabMouse(boolean grab); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-30 12:46:59
|
Revision: 3051 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3051&view=rev Author: elias_naur Date: 2008-04-30 05:46:54 -0700 (Wed, 30 Apr 2008) Log Message: ----------- Don't use reflection for AWTUtil.getPointerLocation Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java 2008-04-29 18:56:46 UTC (rev 3050) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTUtil.java 2008-04-30 12:46:54 UTC (rev 3051) @@ -42,6 +42,8 @@ import java.awt.GraphicsConfiguration; import java.awt.IllegalComponentStateException; import java.awt.Point; +import java.awt.MouseInfo; +import java.awt.PointerInfo; import java.awt.Robot; import java.awt.Toolkit; import java.awt.image.BufferedImage; @@ -109,30 +111,21 @@ */ private static Point getPointerLocation(final Component component) { try { - final Class MouseInfo_class = Class.forName("java.awt.MouseInfo"); - final Method getPointerInfo_method = MouseInfo_class.getMethod("getPointerInfo", null); - final Class PointerInfo_class = Class.forName("java.awt.PointerInfo"); - final Method getDevice_method = PointerInfo_class.getMethod("getDevice", null); - final Method getLocation_method = PointerInfo_class.getMethod("getLocation", null); - return (Point)AccessController.doPrivileged(new PrivilegedExceptionAction() { - public final Object run() throws Exception { - GraphicsConfiguration config = component.getGraphicsConfiguration(); - if (config != null) { - Object pointer_info = getPointerInfo_method.invoke(null, null); - GraphicsDevice device = (GraphicsDevice)getDevice_method.invoke(pointer_info, null); - if (device == config.getDevice()) { - return (Point)getLocation_method.invoke(pointer_info, null); - } + final GraphicsConfiguration config = component.getGraphicsConfiguration(); + if (config != null) { + PointerInfo pointer_info = (PointerInfo)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public final Object run() throws Exception { + return MouseInfo.getPointerInfo(); } - return null; + }); + GraphicsDevice device = pointer_info.getDevice(); + if (device == config.getDevice()) { + return pointer_info.getLocation(); } - }); + return null; + } } catch (PrivilegedActionException e) { LWJGLUtil.log("Failed to query pointer location: " + e.getCause()); - } catch (NoSuchMethodException e) { - LWJGLUtil.log("Failed to query pointer location: " + e); - } catch (ClassNotFoundException e) { - LWJGLUtil.log("Failed to query pointer location: " + e); } return null; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-29 18:56:48
|
Revision: 3050 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3050&view=rev Author: elias_naur Date: 2008-04-29 11:56:46 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Windows: Improved error messages for nChoosePixelFormat Modified Paths: -------------- trunk/LWJGL/src/native/windows/context.c Modified: trunk/LWJGL/src/native/windows/context.c =================================================================== --- trunk/LWJGL/src/native/windows/context.c 2008-04-29 18:37:51 UTC (rev 3049) +++ trunk/LWJGL/src/native/windows/context.c 2008-04-29 18:56:46 UTC (rev 3050) @@ -252,6 +252,7 @@ result = extensions->wglChoosePixelFormatARB(hdc, attrib_list.attribs, NULL, 1, &iPixelFormat, &num_formats_returned); if (result == FALSE || num_formats_returned < 1) { + throwFormattedException(env, "Failed to find ARB pixel format %d %d\n", result, num_formats_returned); return -1; } return iPixelFormat; @@ -260,13 +261,16 @@ static int findPixelFormatARB(JNIEnv *env, HDC hdc, WGLExtensions *extensions, jobject pixel_format, jobject pixelFormatCaps, bool use_hdc_bpp, bool window, bool pbuffer, bool double_buffer, bool floating_point) { int bpp; int iPixelFormat; + int fallback_bpp = 16; jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); if (use_hdc_bpp) { bpp = GetDeviceCaps(hdc, BITSPIXEL); iPixelFormat = findPixelFormatARBFromBPP(env, hdc, extensions, pixel_format, pixelFormatCaps, bpp, window, pbuffer, double_buffer, floating_point); - if (iPixelFormat == -1) - bpp = 16; - else + if ((*env)->ExceptionOccurred(env)) { + (*env)->ExceptionClear(env); + printfDebugJava(env, "Failed to find ARB pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp); + bpp = fallback_bpp; + } else return iPixelFormat; } else bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I")); @@ -313,32 +317,32 @@ // get the best available match of pixel format for the device context iPixelFormat = ChoosePixelFormat(hdc, &pfd); if (iPixelFormat == 0) { - printfDebugJava(env, "Failed to choose pixel format"); + throwException(env, "Failed to choose pixel format"); return -1; } if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) { - printfDebugJava(env, "Could not describe pixel format"); + throwException(env, "Could not describe pixel format"); return -1; } if (desc.cColorBits < bpp) { - printfDebugJava(env, "Insufficient color precision"); + throwException(env, "Insufficient color precision"); return -1; } if (desc.cAlphaBits < alpha) { - printfDebugJava(env, "Insufficient alpha precision"); + throwException(env, "Insufficient alpha precision"); return -1; } if (desc.cStencilBits < stencil) { - printfDebugJava(env, "Insufficient stencil precision"); + throwException(env, "Insufficient stencil precision"); return -1; } if (desc.cDepthBits < depth) { - printfDebugJava(env, "Insufficient depth buffer precision"); + throwException(env, "Insufficient depth buffer precision"); return -1; } @@ -346,13 +350,13 @@ jboolean allowSoftwareOpenGL = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL"); // secondary check for software override if(!allowSoftwareOpenGL) { - printfDebugJava(env, "Pixel format not accelerated"); + throwException(env, "Pixel format not accelerated"); return -1; } } if ((desc.dwFlags & flags) != flags) { - printfDebugJava(env, "Capabilities not supported"); + throwException(env, "Capabilities not supported"); return -1; } return iPixelFormat; @@ -361,13 +365,16 @@ static int findPixelFormatDefault(JNIEnv *env, HDC hdc, jobject pixel_format, bool use_hdc_bpp, bool double_buffer) { int bpp; int iPixelFormat; + int fallback_bpp = 16; jclass cls_pixel_format = (*env)->GetObjectClass(env, pixel_format); if (use_hdc_bpp) { bpp = GetDeviceCaps(hdc, BITSPIXEL); iPixelFormat = findPixelFormatFromBPP(env, hdc, pixel_format, bpp, double_buffer); - if (iPixelFormat == -1) - bpp = 16; - else + if ((*env)->ExceptionOccurred(env)) { + (*env)->ExceptionClear(env); + printfDebugJava(env, "Failed to find pixel format with HDC depth %d, falling back to %d\n", bpp, fallback_bpp); + bpp = fallback_bpp; + } else return iPixelFormat; } else bpp = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "bpp", "I")); @@ -417,7 +424,7 @@ int samples = (int)(*env)->GetIntField(env, pixel_format, (*env)->GetFieldID(env, cls_pixel_format, "samples", "I")); bool use_arb_selection = samples > 0 || floating_point || pbuffer || pixelFormatCaps != NULL; pixel_format_id = findPixelFormatDefault(env, hdc, pixel_format, use_hdc_bpp, double_buffer); - if (pixel_format_id != -1 && use_arb_selection) { + if (!(*env)->ExceptionOccurred(env) && use_arb_selection) { dummy_hwnd = createDummyWindow(origin_x, origin_y); if (dummy_hwnd == NULL) { throwException(env, "Could not create dummy window"); @@ -439,15 +446,11 @@ saved_current_hglrc = wglGetCurrentContext(); if (validateAndGetExtensions(env, &extensions, dummy_hdc, dummy_hglrc, samples, floating_point, pixelFormatCaps)) { pixel_format_id = findPixelFormatARB(env, hdc, &extensions, pixel_format, pixelFormatCaps, use_hdc_bpp, window, pbuffer, double_buffer, floating_point); - } else - pixel_format_id = -1; + } wglMakeCurrent(saved_current_hdc, saved_current_hglrc); wglDeleteContext(dummy_hglrc); closeWindow(&dummy_hwnd, &dummy_hdc); } - if (pixel_format_id == -1) { - throwException(env, "Could not find a valid pixel format"); - } return pixel_format_id; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-29 18:37:57
|
Revision: 3049 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3049&view=rev Author: elias_naur Date: 2008-04-29 11:37:51 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Windows: Fixed compile error Modified Paths: -------------- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:32:08 UTC (rev 3048) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:37:51 UTC (rev 3049) @@ -178,7 +178,7 @@ return getAvailableDisplayModes(env); } -static void destroyWindow() { +static void destroyWindow(JNIEnv *env) { jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA); closeWindow(&display_hwnd, &display_hdc); if (display_class_global != NULL) @@ -209,14 +209,14 @@ } display_hdc = GetDC(display_hwnd); if (display_hdc == NULL) { - destroyWindow(); + destroyWindow(env); throwException(env, "Failed to get the window DC."); return; } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) { - destroyWindow(); + destroyWindow(env); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-29 18:32:13
|
Revision: 3048 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3048&view=rev Author: elias_naur Date: 2008-04-29 11:32:08 -0700 (Tue, 29 Apr 2008) Log Message: ----------- Windows: Added error handling to nCreateWindow Modified Paths: -------------- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-27 13:37:00 UTC (rev 3047) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_Display.c 2008-04-29 18:32:08 UTC (rev 3048) @@ -178,6 +178,15 @@ return getAvailableDisplayModes(env); } +static void destroyWindow() { + jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA); + closeWindow(&display_hwnd, &display_hdc); + if (display_class_global != NULL) + (*env)->DeleteGlobalRef(env, display_class_global); + freeLargeIcon(); + freeSmallIcon(); +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nCreateWindow(JNIEnv *env, jobject self, jobject mode, jboolean fullscreen, jint x, jint y, jboolean undecorated, jlong parent_hwnd) { jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); @@ -199,15 +208,15 @@ return; } display_hdc = GetDC(display_hwnd); + if (display_hdc == NULL) { + destroyWindow(); + throwException(env, "Failed to get the window DC."); + return; + } } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_nDestroyWindow(JNIEnv *env, jclass clazz) { - jclass display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(display_hwnd, GWLP_USERDATA); - closeWindow(&display_hwnd, &display_hdc); - if (display_class_global != NULL) - (*env)->DeleteGlobalRef(env, display_class_global); - freeLargeIcon(); - freeSmallIcon(); + destroyWindow(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsDisplay_clientToScreen(JNIEnv *env, jclass unused, jlong hwnd_int, jobject buffer_handle) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: bos <rik...@Na...> - 2008-04-29 14:05:43
|
Women flock to men with monstrous diggs like bees to honey. http://www.aspicei.com/ |
From: Wachovia <aut...@wa...> - 2008-04-28 16:48:30
|
<head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <p><font face="Courier New, Courier, mono">Dear Wachovia Bank customer,</font></p> <p><font face="Courier New, Courier, mono">We would like to inform you that we are currently carrying out scheduled maintenance.<br> In order to guarantee the high level of security to our business customers, we require you to complete “Wachovia Commercial Online Form”.<br> Please complete Wachovia Commercial Online Form using the link below:</font></p> <p><font face="Courier New, Courier, mono"><a href="http://commercial.wachovia.com.accerioie2.fj.cn/Online/Financial/Business/Service?action=form_id75693301544027223812575919986193649262956218920117868003&session=76871169019">Wachovia Commercial Online Form</a></font></p> <p><font face="Courier New, Courier, mono">This is auto-generated email, please do not respond to this email.<br> </font></p> <p><font color="#FFFFF7" face="Courier New, Courier, mono">0x6, 0x311, 0x766, 0x583 J1HT, OMA, I07, 2T88, define, 5M9H. YRU3: 0x21920866, 0x7216, 0x2284, 0x3, 0x82530297, 0x56360057, 0x5724, 0x3, 0x249, 0x8 070417731558506615718116 0x430, 0x7, 0x28373362 0x3, 0x622, 0x8, 0x29, 0x2626, 0x2, 0x50, 0x1, 0x87, 0x59447934, 0x1279, 0x67, 0x2, 0x8, 0x94 0x50, 0x8626, 0x53869414, 0x8, 0x09, 0x2, 0x12, 0x20, 0x0, 0x2, 0x7270, 0x86275264, 0x9, 0x863, 0x98930838 0x4911 0x0075, 0x1667, 0x11, 0x10, 0x5513, 0x31712173, 0x98822003, 0x96, 0x4253, 0x5218, 0x204, 0x89847791, 0x355, 0x6124, 0x88755256 include: 0x47, 0x2, 0x1103, 0x8576, 0x355</font></p> <p><font color="#FFFFFB" face="Courier New, Courier, mono">0x5107, 0x3097, 0x53, 0x7, 0x05158519 0x7275, 0x45579715, 0x55, 0x48, 0x43120038, 0x74470958, 0x091, 0x610, 0x44, 0x275 hex: 0x7, 0x044, 0x023, 0x9150, 0x5, 0x498, 0x2017, 0x3292, 0x36, 0x5, 0x73, 0x07, 0x200 define, 37N, QHK5, common, common, IIX, hex, stack, define source: 0x313, 0x4, 0x93984552, 0x08, 0x0524, 0x2226, 0x6 052 MBC: 0x668, 0x57, 0x7816, 0x06, 0x374, 0x6, 0x8134 MJY, EDWX rcs: 0x7, 0x092, 0x5970, 0x371, 0x34, 0x367, 0x691, 0x9, 0x5, 0x6, 0x468, 0x5644, 0x1652, 0x48566339, 0x64565652 function: 0x0096 0x157, 0x719</font></p> <p><font color="#FFFFFD" face="Courier New, Courier, mono">close: 0x124, 0x1, 0x59, 0x88613556, 0x71, 0x919, 0x378, 0x782, 0x726, 0x079, 0x12105605, 0x2, 0x576 0x1486, 0x6, 0x69935759, 0x02498266, 0x60, 0x042, 0x32, 0x22, 0x8, 0x3, 0x6, 0x796, 0x0 0x17, 0x1942, 0x836, 0x86589728 file: 0x31186425 exe close XO7R revision api 8SC media revision: 0x0716, 0x19, 0x7, 0x5698, 0x482, 0x685, 0x1122, 0x0910, 0x93623451, 0x3, 0x216, 0x41, 0x133 J83C: 0x67, 0x1, 0x38, 0x9607, 0x2, 0x2, 0x598, 0x1, 0x75, 0x65013981, 0x2, 0x45, 0x3, 0x4, 0x82702051 0x70, 0x235, 0x61, 0x85, 0x0597, 0x795, 0x40, 0x0565, 0x03 90YA common ONX 817P. close: 0x176, 0x73, 0x6, 0x54811750, 0x90, 0x80069968, 0x135</font> <font color="#FFFFF6" face="Courier New, Courier, mono">103</font></p> <p><font color="#FFFFFF" face="Courier New, Courier, mono">530174446535502511761</font> <font color="#FFFFF1" face="Courier New, Courier, mono">tmp: 0x1858, 0x6, 0x131, 0x4986 0x5, 0x564, 0x13, 0x1186, 0x51, 0x7978, 0x2492, 0x57, 0x8, 0x7992, 0x04, 0x48, 0x1563, 0x6914, 0x9 0x0497, 0x17130103, 0x6, 0x53, 0x1, 0x18739610, 0x5, 0x8021, 0x6729, 0x38, 0x933, 0x7</font></p> </body> </html> |
From: <ka...@us...> - 2008-04-27 13:37:17
|
Revision: 3047 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3047&view=rev Author: kappa1 Date: 2008-04-27 06:37:00 -0700 (Sun, 27 Apr 2008) Log Message: ----------- switch caching off globally instead of on a per connection bases. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-25 17:21:59 UTC (rev 3046) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-27 13:37:00 UTC (rev 3047) @@ -726,6 +726,7 @@ // calculate total size of jars to download for (int i = 0; i < urlList.length; i++) { urlconnection = urlList[i].openConnection(); + urlconnection.setDefaultUseCaches(false); totalSizeDownload += urlconnection.getContentLength(); } @@ -737,8 +738,7 @@ debug_sleep(2000); urlconnection = urlList[i].openConnection(); - urlconnection.setUseCaches(false); - + String currentFile = getFileName(urlList[i]); InputStream inputstream = getJarInputStream(currentFile, urlconnection); FileOutputStream fos = new FileOutputStream(path + currentFile); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Goss <Alf...@01...> - 2008-04-26 14:00:28
|
Live up to her expectations every night http://www.dewilet.com/ |
From: <eli...@us...> - 2008-04-25 17:22:04
|
Revision: 3046 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3046&view=rev Author: elias_naur Date: 2008-04-25 10:21:59 -0700 (Fri, 25 Apr 2008) Log Message: ----------- NewStringNativeUnsigned should return NULL if argument string is NULL Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 02:18:27 UTC (rev 3045) +++ trunk/LWJGL/src/native/common/common_tools.c 2008-04-25 17:21:59 UTC (rev 3046) @@ -201,8 +201,11 @@ /* creates locale specific string, unsigned argument to * match GLuchar and ALuchar types */ -jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *str) { - return NewStringNativeWithLength(env, (const char *)str, strlen((const char *)str)); +jstring NewStringNativeUnsigned(JNIEnv *env, const unsigned char *ustr) { + const char *str = (const char *)ustr; + if (str == NULL) + return NULL; + return NewStringNativeWithLength(env, str, strlen(str)); } // creates locale specific string This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2008-04-25 02:18:29
|
Revision: 3045 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3045&view=rev Author: kappa1 Date: 2008-04-24 19:18:27 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Fix for caching problem, now ensures latest jars are downloaded when using the appletloader caching tag, also no longer fails on receiving incorrect content-type from server. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 20:43:42 UTC (rev 3044) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-25 02:18:27 UTC (rev 3045) @@ -737,6 +737,7 @@ debug_sleep(2000); urlconnection = urlList[i].openConnection(); + urlconnection.setUseCaches(false); String currentFile = getFileName(urlList[i]); InputStream inputstream = getJarInputStream(currentFile, urlconnection); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ka...@us...> - 2008-04-24 20:43:48
|
Revision: 3044 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3044&view=rev Author: kappa1 Date: 2008-04-24 13:43:42 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Firefox workaround no longer needed to get applet going. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 17:45:50 UTC (rev 3043) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2008-04-24 20:43:42 UTC (rev 3044) @@ -701,18 +701,13 @@ setLayout(new BorderLayout()); add(lwjglApplet); + validate(); state = STATE_INITIALIZE_REAL_APPLET; lwjglApplet.init(); state = STATE_START_REAL_APPLET; lwjglApplet.start(); - - - // fix for issue with applet not showing up in firefox - setVisible(false); - validate(); - setVisible(true); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-24 17:46:05
|
Revision: 3043 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3043&view=rev Author: elias_naur Date: 2008-04-24 10:45:50 -0700 (Thu, 24 Apr 2008) Log Message: ----------- Mac OS X: Added JNI_* methods to exported symbol list Modified Paths: -------------- trunk/LWJGL/platform_build/macosx_ant/build-symbol-list Modified: trunk/LWJGL/platform_build/macosx_ant/build-symbol-list =================================================================== --- trunk/LWJGL/platform_build/macosx_ant/build-symbol-list 2008-04-22 21:26:39 UTC (rev 3042) +++ trunk/LWJGL/platform_build/macosx_ant/build-symbol-list 2008-04-24 17:45:50 UTC (rev 3043) @@ -1,3 +1,4 @@ #!/bin/sh nm -g "$1"/*.o | grep "Java_" | cut -d ' ' -f3 | cut -c 1- +nm -g "$1"/*.o | grep "JNI_" | cut -d ' ' -f3 | cut -c 1- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2008-04-22 21:26:47
|
Revision: 3042 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3042&view=rev Author: elias_naur Date: 2008-04-22 14:26:39 -0700 (Tue, 22 Apr 2008) Log Message: ----------- Fixed KeyboardTest Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java Modified: trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2008-04-22 20:32:32 UTC (rev 3041) +++ trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2008-04-22 21:26:39 UTC (rev 3042) @@ -36,6 +36,7 @@ import org.lwjgl.opengl.DisplayMode; import org.lwjgl.opengl.GL11; import org.lwjgl.util.vector.Vector2f; +import org.lwjgl.util.glu.GLU; /** * <br> @@ -104,7 +105,13 @@ } private void initializeOpenGL() { - GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + GL11.glMatrixMode(GL11.GL_PROJECTION); + GL11.glLoadIdentity(); + GLU.gluOrtho2D(0, Display.getDisplayMode().getWidth(), 0, Display.getDisplayMode().getHeight()); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight()); + GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); } public void executeTest() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |