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
(14) |
3
|
4
(5) |
5
(3) |
|
6
|
7
(1) |
8
|
9
|
10
(3) |
11
|
12
|
|
13
|
14
|
15
(1) |
16
(2) |
17
|
18
|
19
|
|
20
(4) |
21
(18) |
22
(10) |
23
(6) |
24
(3) |
25
|
26
|
|
27
|
28
(4) |
29
|
30
|
|
|
|
|
From: Elias N. <eli...@us...> - 2005-11-22 14:30:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28193/src/native/linux Modified Files: org_lwjgl_input_Mouse.c org_lwjgl_opengl_Display.c Log Message: Linux: Ignore events from old windows Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- org_lwjgl_opengl_Display.c 22 Nov 2005 13:53:13 -0000 1.41 +++ org_lwjgl_opengl_Display.c 22 Nov 2005 14:30:00 -0000 1.42 @@ -246,12 +246,13 @@ void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode, jobject current_mode) { XEvent event; -/* Window win; - int revert_mode;*/ while (XPending(getDisplay()) > 0) { XNextEvent(getDisplay(), &event); if (XFilterEvent(&event, None) == True) continue; + // Ignore events from old windows + if (event.xany.window != getCurrentWindow()) + continue; switch (event.type) { case ClientMessage: if (event.xclient.message_type == warp_atom) { @@ -259,16 +260,6 @@ } else if ((event.xclient.format == 32) && ((Atom)event.xclient.data.l[0] == delete_atom)) closerequested = true; break; -/* case FocusOut: - XGetInputFocus(getDisplay(), &win, &revert_mode); - if (win != current_win) { - releaseInput(); - focused = false; - } - break; - case FocusIn: - checkInput(); - break;*/ case MapNotify: dirty = true; minimized = false; Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- org_lwjgl_input_Mouse.c 22 Nov 2005 11:06:21 -0000 1.41 +++ org_lwjgl_input_Mouse.c 22 Nov 2005 14:30:00 -0000 1.42 @@ -184,6 +184,7 @@ static void doWarpPointer(int center_x, int center_y) { XEvent warp_event; warp_event.type = ClientMessage; + warp_event.xclient.window = getCurrentWindow(); warp_event.xclient.message_type = getWarpAtom(); warp_event.xclient.format = 32; warp_event.xclient.data.l[0] = center_x; @@ -316,7 +317,7 @@ } void handlePointerMotion(XMotionEvent *event) { - doHandlePointerMotion(event->root, event->window, event->x_root, event->y_root, event->x, event->y); + doHandlePointerMotion(event->root, getCurrentWindow(), event->x_root, event->y_root, event->x, event->y); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nPollMouse(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { |
|
From: Elias N. <eli...@us...> - 2005-11-22 14:04:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18784/src/native/linux Modified Files: extgl_glx.c Log Message: Converted some static local variables to stack localvariables Index: extgl_glx.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extgl_glx.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- extgl_glx.c 20 Nov 2005 13:20:40 -0000 1.9 +++ extgl_glx.c 22 Nov 2005 14:03:52 -0000 1.10 @@ -151,7 +151,7 @@ bool extgl_Open(JNIEnv *env) { #define BUFFER_SIZE 2000 - static char buffer[BUFFER_SIZE]; + char buffer[BUFFER_SIZE]; if (lib_gl_handle != NULL) return true; lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); |
|
From: Elias N. <eli...@us...> - 2005-11-22 14:04:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18784/src/native/common Modified Files: common_tools.c Log Message: Converted some static local variables to stack localvariables Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- common_tools.c 17 Aug 2005 22:05:12 -0000 1.26 +++ common_tools.c 22 Nov 2005 14:03:51 -0000 1.27 @@ -80,7 +80,7 @@ void printfDebugJava(JNIEnv *env, const char *format, ...) { #define BUFFER_SIZE 4000 - static char buffer[BUFFER_SIZE]; + char buffer[BUFFER_SIZE]; jstring str; jclass org_lwjgl_LWJGLUtil_class; jmethodID log_method; |
|
From: Elias N. <eli...@us...> - 2005-11-22 13:53:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15159/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: More native code refactoring Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- display.h 22 Nov 2005 11:23:37 -0000 1.14 +++ display.h 22 Nov 2005 13:53:13 -0000 1.15 @@ -45,7 +45,7 @@ #include <jni.h> #include "common_tools.h" -extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode); -extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode); +extern bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode); +extern void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- display.c 22 Nov 2005 11:23:37 -0000 1.23 +++ display.c 22 Nov 2005 13:53:13 -0000 1.24 @@ -68,11 +68,11 @@ int event_base, error_base; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { - printfDebugJava(env, "XF86VidMode extension not available"); + throwException(env, "XF86VidMode extension not available"); return false; } if (!XF86VidModeQueryVersion(disp, major, minor)) { - printfDebugJava(env, "Could not query XF86VidMode version"); + throwException(env, "Could not query XF86VidMode version"); return false; } printfDebugJava(env, "XF86VidMode extension version %i.%i", *major, *minor); @@ -83,11 +83,11 @@ int event_base, error_base; if (!XRRQueryExtension(disp, &event_base, &error_base)) { - printfDebugJava(env, "Xrandr extension not available"); + throwException(env, "Xrandr extension not available"); return false; } if (!XRRQueryVersion(disp, major, minor)) { - printfDebugJava(env, "Could not query Xrandr version"); + throwException(env, "Could not query Xrandr version"); return false; } printfDebugJava(env, "Xrandr extension version %i.%i", *major, *minor); @@ -108,12 +108,12 @@ return major_ver >= 2; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXrandrSupported(JNIEnv *env, jclass unused) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXrandrSupported(JNIEnv *env, jclass unused) { jboolean result = isXrandrSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } -JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXF86VidModeSupported(JNIEnv *env, jclass unused) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsXF86VidModeSupported(JNIEnv *env, jclass unused) { jboolean result = isXF86VidModeSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } @@ -262,7 +262,7 @@ static int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) { int ramp_size; if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { - printfDebugJava(env, "XF86VidModeGetGammaRampSize call failed"); + throwException(env, "XF86VidModeGetGammaRampSize call failed"); return 0; } return ramp_size; @@ -304,6 +304,8 @@ } static void setGamma(JNIEnv *env, Display *disp, int screen, jobject ramp_buffer) { + if (ramp_buffer == NULL) + return; unsigned short *ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer); jlong capacity = (*env)->GetDirectBufferCapacity(env, ramp_buffer); int size = capacity/(sizeof(unsigned short)*3); @@ -314,7 +316,7 @@ } } -static void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer) { +void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer) { Display * disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); @@ -324,7 +326,7 @@ XCloseDisplay(disp); } -static bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode) { +bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode) { if (mode == NULL) { throwException(env, "mode must be non-null"); return false; @@ -350,18 +352,6 @@ return true; } -void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject current_gamma_ramp, jobject current_mode) { - switchDisplayMode(env, screen, extension, current_mode); - // Don't propagate error to caller - setGammaRamp(env, screen, current_gamma_ramp); -} - -void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject saved_gamma_ramp, jobject saved_mode) { - if (!switchDisplayMode(env, screen, extension, saved_mode)) - return; - setGammaRamp(env, screen, saved_gamma_ramp); -} - static jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) { int num_modes, i; mode_info *avail_modes; @@ -393,10 +383,6 @@ switchDisplayMode(env, getCurrentScreen(), extension, mode); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp, jobject saved_mode) { - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode); -} - JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { return (jint)getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); } Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- org_lwjgl_opengl_Display.c 22 Nov 2005 11:23:37 -0000 1.40 +++ org_lwjgl_opengl_Display.c 22 Nov 2005 13:53:13 -0000 1.41 @@ -190,7 +190,8 @@ updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode); + switchDisplayMode(env, getCurrentScreen(), extension, saved_mode); + setGammaRamp(env, getCurrentScreen(), gamma_ramp); } return true; } @@ -202,7 +203,8 @@ setRepeatMode(env, AutoRepeatModeOff); updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { - temporaryRestoreMode(env, getCurrentScreen(), extension, gamma_ramp, mode); + switchDisplayMode(env, getCurrentScreen(), extension, mode); + setGammaRamp(env, getCurrentScreen(), gamma_ramp); } } @@ -345,7 +347,7 @@ Atom netwm_supported_atom = XInternAtom(getDisplay(), "_NET_SUPPORTED", False); int result = XGetWindowProperty(getDisplay(), RootWindow(getDisplay(), getCurrentScreen()), netwm_supported_atom, 0, 10000, False, AnyPropertyType, &actual_type, &actual_format, &nitems, &bytes_after, (void *)&supported_list); if (result != Success) { - printfDebugJava(env, "Unable to query _NET_SUPPORTED window property"); + throwException(env, "Unable to query _NET_SUPPORTED window property"); return false; } Atom fullscreen_atom = XInternAtom(getDisplay(), "_NET_WM_STATE_FULLSCREEN", False); |
|
From: Elias N. <eli...@us...> - 2005-11-22 13:53:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15159/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: More native code refactoring Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- LinuxDisplay.java 22 Nov 2005 11:23:36 -0000 1.36 +++ LinuxDisplay.java 22 Nov 2005 13:53:13 -0000 1.37 @@ -95,7 +95,7 @@ if (isXF86VidModeSupported()) return nGetCurrentGammaRamp(); else - return BufferUtils.createByteBuffer(0); + return null; } finally { decDisplay(); } @@ -105,29 +105,58 @@ } private static native ByteBuffer nGetCurrentGammaRamp() throws LWJGLException; - private static int getBestDisplayModeExtension() throws LWJGLException { + private static int getBestDisplayModeExtension() { + int result; + if (isXrandrSupported()) { + LWJGLUtil.log("Using Xrandr for display mode switching"); + result = XRANDR; + } else if (isXF86VidModeSupported()) { + LWJGLUtil.log("Using XF86VidMode for display mode switching"); + result = XF86VIDMODE; + } else { + LWJGLUtil.log("No display mode extensions available"); + result = NONE; + } + return result; + } + + private static boolean isXrandrSupported() { + if (System.getenv("LWJGL_DISABLE_XRANDR") != null) + return false; lockAWT(); try { incDisplay(); - int result; - if (System.getenv("LWJGL_DISABLE_XRANDR") == null && isXrandrSupported()) { - LWJGLUtil.log("Using Xrandr for display mode switching"); - result = XRANDR; - } else if (isXF86VidModeSupported()) { - LWJGLUtil.log("Using XF86VidMode for display mode switching"); - result = XF86VIDMODE; - } else { - LWJGLUtil.log("No display mode extensions available"); - result = NONE; + try { + return nIsXrandrSupported(); + } finally { + decDisplay(); } - decDisplay(); - return result; + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while querying Xrandr support: " + e); + return false; } finally { unlockAWT(); } } - private static native boolean isXrandrSupported(); - private static native boolean isXF86VidModeSupported(); + private static native boolean nIsXrandrSupported() throws LWJGLException; + + private static boolean isXF86VidModeSupported() { + lockAWT(); + try { + incDisplay(); + try { + return nIsXF86VidModeSupported(); + } finally { + decDisplay(); + } + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while querying XF86VM support: " + e); + return false; + } finally { + unlockAWT(); + } + } + private static native boolean nIsXF86VidModeSupported() throws LWJGLException; private static boolean isNetWMFullscreenSupported() throws LWJGLException { if (System.getenv("LWJGL_DISABLE_NETWM") != null) @@ -135,14 +164,19 @@ lockAWT(); try { incDisplay(); - boolean supported = nIsNetWMFullscreenSupported(); - decDisplay(); - return supported; + try { + return nIsNetWMFullscreenSupported(); + } finally { + decDisplay(); + } + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while querying NetWM support: " + e); + return false; } finally { unlockAWT(); } } - private static native boolean nIsNetWMFullscreenSupported(); + private static native boolean nIsNetWMFullscreenSupported() throws LWJGLException; /* Since Xlib is not guaranteed to be thread safe, we need a way to synchronize LWJGL * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to @@ -250,8 +284,8 @@ public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); try { + nSwitchDisplayMode(current_displaymode_extension, mode); current_mode = mode; - nSwitchDisplayMode(current_displaymode_extension, current_mode); } finally { unlockAWT(); } @@ -261,27 +295,31 @@ public void resetDisplayMode() { lockAWT(); try { - nResetDisplayMode(current_displaymode_extension, saved_gamma, saved_mode); + switchDisplayMode(saved_mode); + if (isXF86VidModeSupported()) + doSetGamma(saved_gamma); } catch (LWJGLException e) { LWJGLUtil.log("Caught exception while resetting mode: " + e); } finally { unlockAWT(); } } - private static native void nResetDisplayMode(int extension, ByteBuffer gamma_ramp, DisplayMode saved_mode) throws LWJGLException; public int getGammaRampLength() { + if (!isXF86VidModeSupported()) + return 0; lockAWT(); try { try { incDisplay(); - int length; - if (isXF86VidModeSupported()) { - length = nGetGammaRampLength(); - } else - length = 0; - decDisplay(); - return length; + try { + return nGetGammaRampLength(); + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while querying gamma length: " + e); + return 0; + } finally { + decDisplay(); + } } catch (LWJGLException e) { LWJGLUtil.log("Failed to get gamma ramp length: " + e); return 0; @@ -290,18 +328,19 @@ unlockAWT(); } } - private static native int nGetGammaRampLength(); + private static native int nGetGammaRampLength() throws LWJGLException; public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException { + if (!isXF86VidModeSupported()) + throw new LWJGLException("No gamma ramp support (Missing XF86VM extension)"); + doSetGamma(convertToNativeRamp(gammaRamp)); + } + + private static void doSetGamma(ByteBuffer native_gamma) throws LWJGLException { lockAWT(); try { - incDisplay(); - boolean xf86_support = isXF86VidModeSupported(); - decDisplay(); - if (!xf86_support) - throw new LWJGLException("No gamma ramp support (Missing XF86VM extension)"); - current_gamma = convertToNativeRamp(gammaRamp); - nSetGammaRamp(current_gamma); + nSetGammaRamp(native_gamma); + current_gamma = native_gamma; } finally { unlockAWT(); } |
|
From: Elias N. <eli...@us...> - 2005-11-22 11:23:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7412/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Removed current_* mode cache from display.c Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- display.h 22 Nov 2005 09:32:15 -0000 1.13 +++ display.h 22 Nov 2005 11:23:37 -0000 1.14 @@ -45,7 +45,7 @@ #include <jni.h> #include "common_tools.h" -extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode, bool temporary); -extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp); +extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode); +extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- display.c 22 Nov 2005 09:32:15 -0000 1.22 +++ display.c 22 Nov 2005 11:23:37 -0000 1.23 @@ -64,10 +64,6 @@ } mode_data; } mode_info; -static int current_width; -static int current_height; -static int current_freq; - static bool getXF86VidModeVersion(JNIEnv *env, Display *disp, int *major, int *minor) { int event_base, error_base; @@ -226,7 +222,7 @@ return false; } -static bool setMode(JNIEnv *env, Display *disp, int screen, jint extension, int width, int height, int freq, bool temporary) { +static bool setMode(JNIEnv *env, Display *disp, int screen, jint extension, int width, int height, int freq) { int num_modes, i; mode_info *avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL) { @@ -255,11 +251,6 @@ continue; } result = true; - if (!temporary) { - current_width = width; - current_height = height; - current_freq = freq; - } break; } } @@ -323,7 +314,7 @@ } } -static void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen) { +static void setGammaRamp(JNIEnv *env, int screen, jobject gamma_ramp_buffer) { Display * disp = XOpenDisplay(NULL); if (disp == NULL) { throwException(env, "Could not open display"); @@ -333,20 +324,7 @@ XCloseDisplay(disp); } -void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject saved_gamma_ramp) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - printfDebugJava(env, "Could not open display"); - return; - } - if (!setMode(env, disp, screen, extension, current_width, current_height, current_freq, false)) - printfDebugJava(env, "Could not restore mode"); - XCloseDisplay(disp); - // Don't propagate error to caller - setGammaRamp(env, saved_gamma_ramp, screen); -} - -static bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode, bool temporary) { +static bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode) { if (mode == NULL) { throwException(env, "mode must be non-null"); return false; @@ -363,7 +341,7 @@ throwException(env, "Could not open display"); return false; } - if (!setMode(env, disp, screen, extension, width, height, freq, temporary)) { + if (!setMode(env, disp, screen, extension, width, height, freq)) { XCloseDisplay(disp); throwException(env, "Could not switch mode."); return false; @@ -372,10 +350,16 @@ return true; } -void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode, bool temporary) { - if (!switchDisplayMode(env, screen, extension, saved_mode, temporary)) +void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject current_gamma_ramp, jobject current_mode) { + switchDisplayMode(env, screen, extension, current_mode); + // Don't propagate error to caller + setGammaRamp(env, screen, current_gamma_ramp); +} + +void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject saved_gamma_ramp, jobject saved_mode) { + if (!switchDisplayMode(env, screen, extension, saved_mode)) return; - setGammaRamp(env, gamma_ramp, screen); + setGammaRamp(env, screen, saved_gamma_ramp); } static jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) { @@ -406,11 +390,11 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { - switchDisplayMode(env, getCurrentScreen(), extension, mode, false); + switchDisplayMode(env, getCurrentScreen(), extension, mode); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp, jobject saved_mode) { - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode, false); + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { @@ -418,6 +402,6 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jobject gamma_buffer) { - setGammaRamp(env, gamma_buffer, getCurrentScreen()); + setGammaRamp(env, getCurrentScreen(), gamma_buffer); } Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- org_lwjgl_opengl_Display.c 22 Nov 2005 10:32:17 -0000 1.39 +++ org_lwjgl_opengl_Display.c 22 Nov 2005 11:23:37 -0000 1.40 @@ -190,19 +190,19 @@ updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode, true); + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode); } return true; } -static void acquireInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp) { +static void acquireInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp, jobject mode) { if (isLegacyFullscreen(window_mode) || !input_released) return; input_released = false; setRepeatMode(env, AutoRepeatModeOff); updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { - temporaryRestoreMode(env, getCurrentScreen(), extension, gamma_ramp); + temporaryRestoreMode(env, getCurrentScreen(), extension, gamma_ramp, mode); } } @@ -229,12 +229,12 @@ } } -static void checkInput(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { +static void checkInput(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode, jobject current_mode) { Window win; int revert_mode; XGetInputFocus(getDisplay(), &win, &revert_mode); if (win == current_win) { - acquireInput(env, extension, window_mode, current_gamma); + acquireInput(env, extension, window_mode, current_gamma, current_mode); focused = true; } else { releaseInput(env, extension, window_mode, saved_gamma, saved_mode); @@ -242,7 +242,7 @@ } } -void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { +void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode, jobject current_mode) { XEvent event; /* Window win; int revert_mode;*/ @@ -293,7 +293,7 @@ break; } } - checkInput(env, extension, window_mode, saved_gamma, current_gamma, saved_mode); + checkInput(env, extension, window_mode, saved_gamma, current_gamma, saved_mode, current_mode); } static void setWindowTitle(const char *title) { @@ -446,9 +446,9 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate - (JNIEnv *env, jclass clazz, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) + (JNIEnv *env, jclass clazz, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode, jobject current_mode) { - handleMessages(env, extension, window_mode, saved_gamma, current_gamma, saved_mode); + handleMessages(env, extension, window_mode, saved_gamma, current_gamma, saved_mode, current_mode); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject mode, jint window_mode, jint x, jint y) { |
|
From: Elias N. <eli...@us...> - 2005-11-22 11:23:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7412/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Removed current_* mode cache from display.c Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- LinuxDisplay.java 21 Nov 2005 22:21:28 -0000 1.35 +++ LinuxDisplay.java 22 Nov 2005 11:23:36 -0000 1.36 @@ -85,6 +85,7 @@ /** Saved mode to restore with */ private static DisplayMode saved_mode; + private static DisplayMode current_mode; private static ByteBuffer getCurrentGammaRamp() throws LWJGLException { lockAWT(); @@ -249,7 +250,8 @@ public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); try { - nSwitchDisplayMode(current_displaymode_extension, mode); + current_mode = mode; + nSwitchDisplayMode(current_displaymode_extension, current_mode); } finally { unlockAWT(); } @@ -329,6 +331,7 @@ if (modes == null || modes.length == 0) throw new LWJGLException("No modes available"); saved_mode = modes[0]; + current_mode = saved_mode; saved_gamma = getCurrentGammaRamp(); current_gamma = saved_gamma; return saved_mode; @@ -386,13 +389,13 @@ public void update() { lockAWT(); try { - nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma, saved_mode); + nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma, saved_mode, current_mode); } catch (LWJGLException e) { LWJGLUtil.log("Caught exception while processing messages: " + e); } unlockAWT(); } - private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma, DisplayMode saved_mode) throws LWJGLException; + private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma, DisplayMode saved_mode, DisplayMode current_mode) throws LWJGLException; public void reshape(int x, int y, int width, int height) { lockAWT(); |
|
From: Elias N. <eli...@us...> - 2005-11-22 11:06:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3508/src/native/linux Modified Files: org_lwjgl_input_Mouse.c Log Message: Linux: Fixed a mouse cursor position issue in grabbed mode Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- org_lwjgl_input_Mouse.c 22 Nov 2005 10:32:17 -0000 1.40 +++ org_lwjgl_input_Mouse.c 22 Nov 2005 11:06:21 -0000 1.41 @@ -106,7 +106,7 @@ static void resetCursor(int x, int y) { last_x = x; - last_y = y; + last_y = transformY(y); } static bool blankCursor(JNIEnv *env) { @@ -286,7 +286,6 @@ setCursorPos(win_x, win_y); if (!pointer_grabbed || !shouldGrab()) return; - // find the window position in root coordinates XWindowAttributes window_attributes; XGetWindowAttributes(getDisplay(), root_window, &window_attributes); int root_window_width = window_attributes.width; @@ -295,6 +294,7 @@ int window_width = window_attributes.width; int window_height = window_attributes.height; + // find the window position in root coordinates int win_left = root_x - win_x; int win_top = root_y - win_y; int win_right = win_left + window_width; |
|
From: Elias N. <eli...@us...> - 2005-11-22 10:32:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28739/src/native/linux Modified Files: Window.h org_lwjgl_input_Mouse.c org_lwjgl_opengl_Display.c Log Message: Linux: removed getWindowWidth/Height from native side Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Window.h 21 Nov 2005 13:22:52 -0000 1.27 +++ Window.h 22 Nov 2005 10:32:17 -0000 1.28 @@ -66,16 +66,6 @@ extern bool shouldGrab(void); /* - * get the current window width - */ - extern int getWindowWidth(void); - - /* - * get the current window height - */ - extern int getWindowHeight(void); - - /* * get the current display */ extern Display *getDisplay(void); Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- org_lwjgl_opengl_Display.c 21 Nov 2005 21:59:11 -0000 1.38 +++ org_lwjgl_opengl_Display.c 22 Nov 2005 10:32:17 -0000 1.39 @@ -445,14 +445,6 @@ return current_win; } -int getWindowWidth(void) { - return current_width; -} - -int getWindowHeight(void) { - return current_height; -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate (JNIEnv *env, jclass clazz, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- org_lwjgl_input_Mouse.c 22 Nov 2005 09:32:15 -0000 1.39 +++ org_lwjgl_input_Mouse.c 22 Nov 2005 10:32:17 -0000 1.40 @@ -84,7 +84,9 @@ } static int transformY(int y) { - return getWindowHeight() - 1 - y; + XWindowAttributes window_attributes; + XGetWindowAttributes(getDisplay(), getCurrentWindow(), &window_attributes); + return window_attributes.height - 1 - y; } static void setCursorPos(int x, int y) { @@ -280,22 +282,28 @@ return v1 < v2 ? v1 : v2; } -static void doHandlePointerMotion(Window root_window, int root_x, int root_y, int win_x, int win_y) { +static void doHandlePointerMotion(Window root_window, Window window, int root_x, int root_y, int win_x, int win_y) { setCursorPos(win_x, win_y); if (!pointer_grabbed || !shouldGrab()) return; // find the window position in root coordinates + XWindowAttributes window_attributes; + XGetWindowAttributes(getDisplay(), root_window, &window_attributes); + int root_window_width = window_attributes.width; + int root_window_height = window_attributes.height; + XGetWindowAttributes(getDisplay(), window, &window_attributes); + int window_width = window_attributes.width; + int window_height = window_attributes.height; + int win_left = root_x - win_x; int win_top = root_y - win_y; - int win_right = win_left + getWindowWidth(); - int win_bottom = win_top + getWindowHeight(); + int win_right = win_left + window_width; + int win_bottom = win_top + window_height; // cap the window position to the screen dimensions int border_left = max(0, win_left); int border_top = max(0, win_top); - XWindowAttributes root_attributes; - XGetWindowAttributes(getDisplay(), root_window, &root_attributes); - int border_right = min(root_attributes.width, win_right); - int border_bottom = min(root_attributes.height, win_bottom); + int border_right = min(root_window_width, win_right); + int border_bottom = min(root_window_height, win_bottom); // determine whether the cursor is outside the bounds bool outside_limits = root_x < border_left + POINTER_WARP_BORDER || root_y < border_top + POINTER_WARP_BORDER || root_x > border_right - POINTER_WARP_BORDER || root_y > border_bottom - POINTER_WARP_BORDER; @@ -308,7 +316,7 @@ } void handlePointerMotion(XMotionEvent *event) { - doHandlePointerMotion(event->root, event->x_root, event->y_root, event->x, event->y); + doHandlePointerMotion(event->root, event->window, event->x_root, event->y_root, event->x, event->y); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nPollMouse(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { @@ -355,5 +363,5 @@ setGrab(window_mode, new_grab == JNI_TRUE ? true : false); reset(); XQueryPointer(getDisplay(), getCurrentWindow(), &root_return, &child_return, &root_x, &root_y, &win_x, &win_y, &mask_return); - doHandlePointerMotion(root_return, root_x, root_y, win_x, win_y); + doHandlePointerMotion(root_return, getCurrentWindow(), root_x, root_y, win_x, win_y); } |
|
From: Elias N. <eli...@us...> - 2005-11-22 09:32:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14371/src/native/linux Modified Files: display.c display.h org_lwjgl_input_Mouse.c Log Message: Linux: Removed getScreenModeWidth/Height from display.c Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- display.h 21 Nov 2005 21:59:11 -0000 1.12 +++ display.h 22 Nov 2005 09:32:15 -0000 1.13 @@ -45,8 +45,6 @@ #include <jni.h> #include "common_tools.h" -extern int getScreenModeWidth(void); -extern int getScreenModeHeight(void); extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode, bool temporary); extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp); Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- display.c 21 Nov 2005 22:37:14 -0000 1.21 +++ display.c 22 Nov 2005 09:32:15 -0000 1.22 @@ -68,14 +68,6 @@ static int current_height; static int current_freq; -int getScreenModeWidth(void) { - return current_width; -} - -int getScreenModeHeight(void) { - return current_height; -} - static bool getXF86VidModeVersion(JNIEnv *env, Display *disp, int *major, int *minor) { int event_base, error_base; Index: org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- org_lwjgl_input_Mouse.c 21 Nov 2005 13:22:52 -0000 1.38 +++ org_lwjgl_input_Mouse.c 22 Nov 2005 09:32:15 -0000 1.39 @@ -280,7 +280,7 @@ return v1 < v2 ? v1 : v2; } -static void doHandlePointerMotion(int root_x, int root_y, int win_x, int win_y) { +static void doHandlePointerMotion(Window root_window, int root_x, int root_y, int win_x, int win_y) { setCursorPos(win_x, win_y); if (!pointer_grabbed || !shouldGrab()) return; @@ -292,8 +292,10 @@ // cap the window position to the screen dimensions int border_left = max(0, win_left); int border_top = max(0, win_top); - int border_right = min(getScreenModeWidth(), win_right); - int border_bottom = min(getScreenModeHeight(), win_bottom); + XWindowAttributes root_attributes; + XGetWindowAttributes(getDisplay(), root_window, &root_attributes); + int border_right = min(root_attributes.width, win_right); + int border_bottom = min(root_attributes.height, win_bottom); // determine whether the cursor is outside the bounds bool outside_limits = root_x < border_left + POINTER_WARP_BORDER || root_y < border_top + POINTER_WARP_BORDER || root_x > border_right - POINTER_WARP_BORDER || root_y > border_bottom - POINTER_WARP_BORDER; @@ -306,7 +308,7 @@ } void handlePointerMotion(XMotionEvent *event) { - doHandlePointerMotion(event->x_root, event->y_root, event->x, event->y); + doHandlePointerMotion(event->root, event->x_root, event->y_root, event->x, event->y); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nPollMouse(JNIEnv * env, jclass clazz, jobject coord_buffer_obj, jobject button_buffer_obj) { @@ -353,5 +355,5 @@ setGrab(window_mode, new_grab == JNI_TRUE ? true : false); reset(); XQueryPointer(getDisplay(), getCurrentWindow(), &root_return, &child_return, &root_x, &root_y, &win_x, &win_y, &mask_return); - doHandlePointerMotion(root_x, root_y, win_x, win_y); + doHandlePointerMotion(root_return, root_x, root_y, win_x, win_y); } |