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-21 22:21:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30869/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: let exceptions from display.c propagate to LinuxDisplay.java Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- LinuxDisplay.java 21 Nov 2005 21:59:11 -0000 1.34 +++ LinuxDisplay.java 21 Nov 2005 22:21:28 -0000 1.35 @@ -260,11 +260,13 @@ lockAWT(); try { nResetDisplayMode(current_displaymode_extension, saved_gamma, saved_mode); + } 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); + private static native void nResetDisplayMode(int extension, ByteBuffer gamma_ramp, DisplayMode saved_mode) throws LWJGLException; public int getGammaRampLength() { lockAWT(); @@ -383,10 +385,14 @@ public void update() { lockAWT(); - nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma, saved_mode); + try { + nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma, saved_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); + private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma, DisplayMode saved_mode) throws LWJGLException; public void reshape(int x, int y, int width, int height) { lockAWT(); |
|
From: Elias N. <eli...@us...> - 2005-11-21 21:59:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24256/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Moved saved display mode from C to LinuxDisplay.java Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- display.h 21 Nov 2005 18:25:30 -0000 1.11 +++ display.h 21 Nov 2005 21:59:11 -0000 1.12 @@ -47,7 +47,7 @@ extern int getScreenModeWidth(void); extern int getScreenModeHeight(void); -extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary); +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); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- display.c 21 Nov 2005 18:25:30 -0000 1.18 +++ display.c 21 Nov 2005 21:59:11 -0000 1.19 @@ -64,9 +64,6 @@ } mode_data; } mode_info; -static int saved_width; -static int saved_height; -static int saved_freq; static int current_width; static int current_height; static int current_freq; @@ -208,7 +205,7 @@ static Status trySetXrandrMode(Display *disp, int screen, mode_info *mode, Time *timestamp) { Status status; Drawable root_window = RootWindow(disp, screen); - XRRScreenConfiguration *screen_configuration = XRRGetScreenInfo (disp, root_window); + XRRScreenConfiguration *screen_configuration = XRRGetScreenInfo(disp, root_window); XRRConfigTimes(screen_configuration, timestamp); Rotation current_rotation; XRRConfigRotations(screen_configuration, ¤t_rotation); @@ -228,8 +225,9 @@ status = trySetXrandrMode(disp, screen, mode, &new_timestamp); if (status == 0) return true; // Success - if (new_timestamp == timestamp) + if (new_timestamp == timestamp) { return false; // Failure, and the stamps are equal meaning that the failure is not merely transient + } timestamp = new_timestamp; } return false; @@ -277,7 +275,7 @@ return result; } -int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) { +static int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) { int ramp_size; if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { printfDebugJava(env, "XF86VidModeGetGammaRampSize call failed"); @@ -305,36 +303,6 @@ return native_ramp; } -jobject initDisplay(JNIEnv *env, int screen, jint extension) { - int num_modes; - mode_info *avail_modes; - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return NULL; - } - - avail_modes = getDisplayModes(disp, screen, extension, &num_modes); - if (avail_modes == NULL || num_modes == 0) { - throwException(env, "Could not get display modes"); - XCloseDisplay(disp); - return NULL; - } - saved_width = current_width = avail_modes[0].width; - saved_height = current_height = avail_modes[0].height; - saved_freq = current_freq = avail_modes[0].freq; - int bpp = XDefaultDepth(disp, screen); - printfDebugJava(env, "Original display dimensions: width %d, height %d freq %d", saved_width, saved_height, saved_freq); - jclass jclass_DisplayMode = (*env)->FindClass(env, "org/lwjgl/opengl/DisplayMode"); - jmethodID ctor = (*env)->GetMethodID(env, jclass_DisplayMode, "<init>", "(IIII)V"); - jobject newMode = (*env)->NewObject(env, jclass_DisplayMode, ctor, saved_width, saved_height, bpp, saved_freq); - - free(avail_modes); - - XCloseDisplay(disp); - return newMode; -} - JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused) { int ramp_size = getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size); @@ -365,6 +333,19 @@ } } +static void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen, bool throw_on_error) { + Display * disp = XOpenDisplay(NULL); + if (disp == NULL) { + if (throw_on_error) + throwException(env, "Could not open display"); + else + printfDebugJava(env, "Could not open display"); + return; + } + setGamma(env, disp, screen, gamma_ramp_buffer, throw_on_error); + XCloseDisplay(disp); +} + void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject saved_gamma_ramp) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { @@ -373,15 +354,18 @@ } if (!setMode(env, disp, screen, extension, current_width, current_height, current_freq, false)) printfDebugJava(env, "Could not restore mode"); - // Don't propagate error to caller - setGamma(env, disp, screen, saved_gamma_ramp, false); XCloseDisplay(disp); + // Don't propagate error to caller + setGammaRamp(env, saved_gamma_ramp, screen, false); } -void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension) { +static bool switchDisplayMode(JNIEnv * env, int screen, jint extension, jobject mode, bool temporary, bool throw_on_error) { if (mode == NULL) { - throwException(env, "mode must be non-null"); - return; + if (throw_on_error) + throwException(env, "mode must be non-null"); + else + printfDebugJava(env, "Ignored null mode"); + return false; } jclass cls_displayMode = (*env)->GetObjectClass(env, mode); jfieldID fid_width = (*env)->GetFieldID(env, cls_displayMode, "width", "I"); @@ -392,28 +376,31 @@ int freq = (*env)->GetIntField(env, mode, fid_freq); Display *disp = XOpenDisplay(NULL); if (disp == NULL) { - throwException(env, "Could not open display"); - return; + if (throw_on_error) + throwException(env, "Could not open display"); + else + printfDebugJava(env, "Could not open display"); + return false; + } + if (!setMode(env, disp, screen, extension, width, height, freq, temporary)) { + XCloseDisplay(disp); + if (throw_on_error) + throwException(env, "Could not switch mode."); + else + printfDebugJava(env, "Could not switch mode"); + return false; } - if (!setMode(env, disp, screen, extension, width, height, freq, false)) - throwException(env, "Could not switch mode."); XCloseDisplay(disp); + return true; } -void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - printfDebugJava(env, "Failed to contact X Server"); +void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, jobject saved_mode, bool temporary) { + if (!switchDisplayMode(env, screen, extension, saved_mode, temporary, false)) return; - } - if (!setMode(env, disp, screen, extension, saved_width, saved_height, saved_freq, temporary)) { - printfDebugJava(env, "Failed to reset mode"); - } - setGamma(env, disp, screen, gamma_ramp, false); - XCloseDisplay(disp); + setGammaRamp(env, gamma_ramp, screen, false); } -jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) { +static jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) { int num_modes, i; mode_info *avail_modes; int bpp = XDefaultDepth(disp, screen); @@ -436,26 +423,16 @@ return ret; } -void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen) { - Display * disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return; - } - setGamma(env, disp, screen, gamma_ramp_buffer, true); - XCloseDisplay(disp); -} - JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { - switchDisplayMode(env, mode, getCurrentScreen(), extension); + switchDisplayMode(env, getCurrentScreen(), extension, mode, false, true); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp) { - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, false); +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); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { @@ -463,10 +440,6 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jobject gamma_buffer) { - setGammaRamp(env, gamma_buffer, getCurrentScreen()); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInit(JNIEnv *env, jclass clazz, jint extension) { - return initDisplay(env, getCurrentScreen(), extension); + setGammaRamp(env, gamma_buffer, getCurrentScreen(), true); } 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.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- org_lwjgl_opengl_Display.c 21 Nov 2005 18:25:30 -0000 1.37 +++ org_lwjgl_opengl_Display.c 21 Nov 2005 21:59:11 -0000 1.38 @@ -182,7 +182,7 @@ XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); } -static bool releaseInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp) { +static bool releaseInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp, jobject saved_mode) { if (isLegacyFullscreen(window_mode) || input_released) return false; input_released = true; @@ -190,7 +190,7 @@ updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, true); + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, saved_mode, true); } return true; } @@ -229,7 +229,7 @@ } } -static void checkInput(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma) { +static void checkInput(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { Window win; int revert_mode; XGetInputFocus(getDisplay(), &win, &revert_mode); @@ -237,12 +237,12 @@ acquireInput(env, extension, window_mode, current_gamma); focused = true; } else { - releaseInput(env, extension, window_mode, saved_gamma); + releaseInput(env, extension, window_mode, saved_gamma, saved_mode); focused = false; } } -void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma) { +void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { XEvent event; /* Window win; int revert_mode;*/ @@ -293,7 +293,7 @@ break; } } - checkInput(env, extension, window_mode, saved_gamma, current_gamma); + checkInput(env, extension, window_mode, saved_gamma, current_gamma, saved_mode); } static void setWindowTitle(const char *title) { @@ -454,9 +454,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) + (JNIEnv *env, jclass clazz, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma, jobject saved_mode) { - handleMessages(env, extension, window_mode, saved_gamma, current_gamma); + handleMessages(env, extension, window_mode, saved_gamma, current_gamma, saved_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-21 21:59:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24256/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Moved saved display mode from C to LinuxDisplay.java Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- LinuxDisplay.java 21 Nov 2005 16:50:11 -0000 1.33 +++ LinuxDisplay.java 21 Nov 2005 21:59:11 -0000 1.34 @@ -83,6 +83,9 @@ private static ByteBuffer saved_gamma; private static ByteBuffer current_gamma; + /** Saved mode to restore with */ + private static DisplayMode saved_mode; + private static ByteBuffer getCurrentGammaRamp() throws LWJGLException { lockAWT(); try { @@ -256,12 +259,12 @@ public void resetDisplayMode() { lockAWT(); try { - nResetDisplayMode(current_displaymode_extension, saved_gamma); + nResetDisplayMode(current_displaymode_extension, saved_gamma, saved_mode); } finally { unlockAWT(); } } - private static native void nResetDisplayMode(int extension, ByteBuffer gamma_ramp); + private static native void nResetDisplayMode(int extension, ByteBuffer gamma_ramp, DisplayMode saved_mode); public int getGammaRampLength() { lockAWT(); @@ -320,10 +323,13 @@ current_displaymode_extension = getBestDisplayModeExtension(); if (current_displaymode_extension == NONE) throw new LWJGLException("No display mode extension is available"); - DisplayMode mode = nInit(current_displaymode_extension); + DisplayMode[] modes = getAvailableDisplayModes(); + if (modes == null || modes.length == 0) + throw new LWJGLException("No modes available"); + saved_mode = modes[0]; saved_gamma = getCurrentGammaRamp(); current_gamma = saved_gamma; - return mode; + return saved_mode; } finally { unlockAWT(); } @@ -377,10 +383,10 @@ public void update() { lockAWT(); - nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma); + nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma, saved_mode); unlockAWT(); } - private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma); + private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma, DisplayMode saved_mode); public void reshape(int x, int y, int width, int height) { lockAWT(); |
|
From: Elias N. <eli...@us...> - 2005-11-21 18:25:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv954/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Moved some JNI functions Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- display.h 21 Nov 2005 16:50:11 -0000 1.10 +++ display.h 21 Nov 2005 18:25:30 -0000 1.11 @@ -47,12 +47,7 @@ extern int getScreenModeWidth(void); extern int getScreenModeHeight(void); -extern jobject initDisplay(JNIEnv *env, int screen, jint extension); -extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension); extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary); -extern jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension); -extern int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen); -extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- display.c 21 Nov 2005 16:50:11 -0000 1.17 +++ display.c 21 Nov 2005 18:25:30 -0000 1.18 @@ -445,3 +445,28 @@ setGamma(env, disp, screen, gamma_ramp_buffer, true); XCloseDisplay(disp); } + +JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { + return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { + switchDisplayMode(env, mode, getCurrentScreen(), extension); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp) { + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, false); +} + +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { + return (jint)getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jobject gamma_buffer) { + setGammaRamp(env, gamma_buffer, getCurrentScreen()); +} + +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInit(JNIEnv *env, jclass clazz, jint extension) { + return initDisplay(env, getCurrentScreen(), extension); +} + 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.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- org_lwjgl_opengl_Display.c 21 Nov 2005 16:50:11 -0000 1.36 +++ org_lwjgl_opengl_Display.c 21 Nov 2005 18:25:30 -0000 1.37 @@ -459,30 +459,6 @@ handleMessages(env, extension, window_mode, saved_gamma, current_gamma); } -JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { - return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { - switchDisplayMode(env, mode, getCurrentScreen(), extension); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp) { - resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, false); -} - -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { - return (jint)getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); -} - -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jobject gamma_buffer) { - setGammaRamp(env, gamma_buffer, getCurrentScreen()); -} - -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInit(JNIEnv *env, jclass clazz, jint extension) { - return initDisplay(env, getCurrentScreen(), extension); -} - 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) { X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; |
|
From: Elias N. <eli...@us...> - 2005-11-21 16:50:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3375/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Moved a display connection to java Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- LinuxDisplay.java 21 Nov 2005 16:32:34 -0000 1.32 +++ LinuxDisplay.java 21 Nov 2005 16:50:11 -0000 1.33 @@ -392,8 +392,13 @@ public DisplayMode[] getAvailableDisplayModes() throws LWJGLException { lockAWT(); try { - DisplayMode[] modes = nGetAvailableDisplayModes(current_displaymode_extension); - return modes; + incDisplay(); + try { + DisplayMode[] modes = nGetAvailableDisplayModes(current_displaymode_extension); + return modes; + } finally { + decDisplay(); + } } finally { unlockAWT(); } |
|
From: Elias N. <eli...@us...> - 2005-11-21 16:50:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3375/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Moved a display connection to java Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- display.h 21 Nov 2005 16:32:34 -0000 1.9 +++ display.h 21 Nov 2005 16:50:11 -0000 1.10 @@ -50,7 +50,7 @@ extern jobject initDisplay(JNIEnv *env, int screen, jint extension); extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension); extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary); -extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen, jint extension); +extern jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension); extern int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen); extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); 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.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- display.c 21 Nov 2005 16:32:34 -0000 1.16 +++ display.c 21 Nov 2005 16:50:11 -0000 1.17 @@ -413,15 +413,9 @@ XCloseDisplay(disp); } -jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen, jint extension) { +jobjectArray getAvailableDisplayModes(JNIEnv * env, Display *disp, int screen, jint extension) { int num_modes, i; mode_info *avail_modes; - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return NULL; - } - int bpp = XDefaultDepth(disp, screen); avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL) { @@ -439,7 +433,6 @@ (*env)->SetObjectArrayElement(env, ret, i, displayMode); } free(avail_modes); - XCloseDisplay(disp); return ret; } 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.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- org_lwjgl_opengl_Display.c 21 Nov 2005 16:32:34 -0000 1.35 +++ org_lwjgl_opengl_Display.c 21 Nov 2005 16:50:11 -0000 1.36 @@ -460,7 +460,7 @@ } JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { - return getAvailableDisplayModes(env, getCurrentScreen(), extension); + return getAvailableDisplayModes(env, getDisplay(), getCurrentScreen(), extension); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { |
|
From: Elias N. <eli...@us...> - 2005-11-21 16:32:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31869/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Move gamma ramps to java code Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- LinuxDisplay.java 21 Nov 2005 13:32:52 -0000 1.31 +++ LinuxDisplay.java 21 Nov 2005 16:32:34 -0000 1.32 @@ -44,6 +44,7 @@ import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.BufferUtils; import org.lwjgl.input.Keyboard; final class LinuxDisplay implements DisplayImplementation { @@ -78,6 +79,28 @@ private static PeerInfo peer_info; + /** Saved gamma used to restore display settings */ + private static ByteBuffer saved_gamma; + private static ByteBuffer current_gamma; + + private static ByteBuffer getCurrentGammaRamp() throws LWJGLException { + lockAWT(); + try { + incDisplay(); + try { + if (isXF86VidModeSupported()) + return nGetCurrentGammaRamp(); + else + return BufferUtils.createByteBuffer(0); + } finally { + decDisplay(); + } + } finally { + unlockAWT(); + } + } + private static native ByteBuffer nGetCurrentGammaRamp() throws LWJGLException; + private static int getBestDisplayModeExtension() throws LWJGLException { lockAWT(); try { @@ -233,30 +256,55 @@ public void resetDisplayMode() { lockAWT(); try { - nResetDisplayMode(current_displaymode_extension); + nResetDisplayMode(current_displaymode_extension, saved_gamma); } finally { unlockAWT(); } } - private static native void nResetDisplayMode(int extension); + private static native void nResetDisplayMode(int extension, ByteBuffer gamma_ramp); public int getGammaRampLength() { lockAWT(); - int length = nGetGammaRampLength(); - unlockAWT(); - return length; + try { + try { + incDisplay(); + int length; + if (isXF86VidModeSupported()) { + length = nGetGammaRampLength(); + } else + length = 0; + decDisplay(); + return length; + } catch (LWJGLException e) { + LWJGLUtil.log("Failed to get gamma ramp length: " + e); + return 0; + } + } finally { + unlockAWT(); + } } private static native int nGetGammaRampLength(); public void setGammaRamp(FloatBuffer gammaRamp) throws LWJGLException { lockAWT(); try { - nSetGammaRamp(gammaRamp); + 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); } finally { unlockAWT(); } } - private static native void nSetGammaRamp(FloatBuffer gammaRamp) throws LWJGLException; + private static native void nSetGammaRamp(ByteBuffer gammaRamp) throws LWJGLException; + + private static ByteBuffer convertToNativeRamp(FloatBuffer ramp) throws LWJGLException { + return nConvertToNativeRamp(ramp, ramp.position(), ramp.remaining()); + } + private static native ByteBuffer nConvertToNativeRamp(FloatBuffer ramp, int offset, int length) throws LWJGLException; public String getAdapter() { return null; @@ -273,6 +321,8 @@ if (current_displaymode_extension == NONE) throw new LWJGLException("No display mode extension is available"); DisplayMode mode = nInit(current_displaymode_extension); + saved_gamma = getCurrentGammaRamp(); + current_gamma = saved_gamma; return mode; } finally { unlockAWT(); @@ -327,10 +377,10 @@ public void update() { lockAWT(); - nUpdate(current_displaymode_extension, current_window_mode); + nUpdate(current_displaymode_extension, current_window_mode, saved_gamma, current_gamma); unlockAWT(); } - private static native void nUpdate(int extension, int current_window_mode); + private static native void nUpdate(int extension, int current_window_mode, ByteBuffer saved_gamma, ByteBuffer current_gamma); public void reshape(int x, int y, int width, int height) { lockAWT(); |
|
From: Elias N. <eli...@us...> - 2005-11-21 16:32:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31869/src/native/linux Modified Files: display.c display.h org_lwjgl_opengl_Display.c Log Message: Linux: Move gamma ramps to java code Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- display.h 21 Nov 2005 13:22:52 -0000 1.8 +++ display.h 21 Nov 2005 16:32:34 -0000 1.9 @@ -49,10 +49,10 @@ extern int getScreenModeHeight(void); extern jobject initDisplay(JNIEnv *env, int screen, jint extension); extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension); -extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, bool temporary); +extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary); extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen, jint extension); -extern int getGammaRampLength(JNIEnv *env, int screen); +extern int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen); extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); -extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension); +extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- display.c 21 Nov 2005 13:43:49 -0000 1.15 +++ display.c 21 Nov 2005 16:32:34 -0000 1.16 @@ -70,10 +70,6 @@ static int current_width; static int current_height; static int current_freq; -static int saved_gamma_ramp_length = 0; -static unsigned short *saved_ramp = NULL; -static unsigned short *current_ramp = NULL; -static int current_gamma_ramp_length = 0; int getScreenModeWidth(void) { return current_width; @@ -281,18 +277,8 @@ return result; } -static void freeSavedGammaRamps() { - free(saved_ramp); - saved_ramp = NULL; - saved_gamma_ramp_length = 0; -} - -static int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) { +int getGammaRampLengthOfDisplay(JNIEnv *env, Display *disp, int screen) { int ramp_size; - if (!isXF86VidModeSupported(env, disp)) { - printfDebugJava(env, "XF86VidMode extension version >= 2 not found"); - return 0; - } if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { printfDebugJava(env, "XF86VidModeGetGammaRampSize call failed"); return 0; @@ -300,15 +286,23 @@ return ramp_size; } -int getGammaRampLength(JNIEnv *env, int screen) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - printfDebugJava(env, "Could not open display"); - return 0; +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nConvertToNativeRamp(JNIEnv *env, jclass unused, jobject ramp_buffer, jint buffer_offset, jint length) { + const jfloat *ramp_ptr = (const jfloat *)(*env)->GetDirectBufferAddress(env, ramp_buffer) + buffer_offset; + jobject native_ramp = newJavaManagedByteBuffer(env, length*3*sizeof(unsigned short)); + if (native_ramp == NULL) { + throwException(env, "Failed to allocate gamma ramp buffer"); + return NULL; } - int length = getGammaRampLengthOfDisplay(env, disp, screen); - XCloseDisplay(disp); - return length; + unsigned short *native_ramp_ptr = (unsigned short *)(*env)->GetDirectBufferAddress(env, native_ramp); + int i; + for (i = 0; i < length; i++) { + float scaled_gamma = ramp_ptr[i]*0xffff; + short scaled_gamma_short = (unsigned short)round(scaled_gamma); + native_ramp_ptr[i] = scaled_gamma_short; + native_ramp_ptr[i + length] = scaled_gamma_short; + native_ramp_ptr[i + length*2] = scaled_gamma_short; + } + return native_ramp; } jobject initDisplay(JNIEnv *env, int screen, jint extension) { @@ -337,38 +331,41 @@ free(avail_modes); - /* Fetch the current gamma ramp */ - saved_gamma_ramp_length = getGammaRampLengthOfDisplay(env, disp, screen); - if (saved_gamma_ramp_length > 0) { - saved_ramp = (unsigned short *)malloc(sizeof(unsigned short)*3*saved_gamma_ramp_length); - if (!XF86VidModeGetGammaRamp(disp, screen, saved_gamma_ramp_length, saved_ramp, - saved_ramp + saved_gamma_ramp_length, saved_ramp + saved_gamma_ramp_length*2)) - freeSavedGammaRamps(); - } XCloseDisplay(disp); return newMode; } -static void freeCurrentGamma(void) { - if (current_ramp != NULL) { - free(current_ramp); - current_ramp = NULL; - current_gamma_ramp_length = 0; +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetCurrentGammaRamp(JNIEnv *env, jclass unused) { + int ramp_size = getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); + jobject ramp_buffer = newJavaManagedByteBuffer(env, sizeof(unsigned short)*3*ramp_size); + if (ramp_buffer == NULL) { + throwException(env, "Could not allocate gamma ramp buffer"); + return NULL; + } + unsigned short *ramp = (unsigned short *)(*env)->GetDirectBufferAddress(env, ramp_buffer); + if (!XF86VidModeGetGammaRamp(getDisplay(), getCurrentScreen(), ramp_size, ramp, + ramp + ramp_size, ramp + ramp_size*2)) { + throwException(env, "Could not get the current gamma ramp"); + return NULL; } + return ramp_buffer; } -static void setCurrentGamma(Display *disp, int screen, JNIEnv *env) { - if (current_gamma_ramp_length == 0) +static void setGamma(JNIEnv *env, Display *disp, int screen, jobject ramp_buffer, bool throw_on_error) { + 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); + if (size == 0) return; - if (XF86VidModeSetGammaRamp(disp, screen, current_gamma_ramp_length, current_ramp, current_ramp, current_ramp) == False) { - if (env != NULL) + if (XF86VidModeSetGammaRamp(disp, screen, size, ramp_ptr, ramp_ptr + size, ramp_ptr + size*2) == False) { + if (throw_on_error) throwException(env, "Could not set gamma ramp."); else - printfDebugJava(env, "Could not set gamma ramp"); + printfDebugJava(env, "Could not set gamma ramp."); } } -void temporaryRestoreMode(JNIEnv *env, int screen, jint extension) { +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"); @@ -376,9 +373,9 @@ } if (!setMode(env, disp, screen, extension, current_width, current_height, current_freq, false)) printfDebugJava(env, "Could not restore mode"); - setCurrentGamma(disp, screen, NULL); - XCloseDisplay(disp); // Don't propagate error to caller + setGamma(env, disp, screen, saved_gamma_ramp, false); + XCloseDisplay(disp); } void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension) { @@ -403,7 +400,7 @@ XCloseDisplay(disp); } -void resetDisplayMode(JNIEnv *env, int screen, jint extension, bool temporary) { +void resetDisplayMode(JNIEnv *env, int screen, jint extension, jobject gamma_ramp, bool temporary) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebugJava(env, "Failed to contact X Server"); @@ -412,11 +409,7 @@ if (!setMode(env, disp, screen, extension, saved_width, saved_height, saved_freq, temporary)) { printfDebugJava(env, "Failed to reset mode"); } - if (saved_gamma_ramp_length > 0) { - XF86VidModeSetGammaRamp(disp, screen, saved_gamma_ramp_length, saved_ramp, saved_ramp + - saved_gamma_ramp_length, saved_ramp + saved_gamma_ramp_length*2); - } -// decDisplay(); + setGamma(env, disp, screen, gamma_ramp, false); XCloseDisplay(disp); } @@ -456,19 +449,6 @@ throwException(env, "Could not open display"); return; } - freeCurrentGamma(); - current_gamma_ramp_length = getGammaRampLengthOfDisplay(env, disp, screen); - if (current_gamma_ramp_length == 0) { - throwException(env, "Gamma ramp not supported"); - return; - } - const float *gamma_ramp = (const float *)(*env)->GetDirectBufferAddress(env, gamma_ramp_buffer); - current_ramp = (unsigned short *)malloc(sizeof(unsigned short)*current_gamma_ramp_length); - int i; - for (i = 0; i < current_gamma_ramp_length; i++) { - float scaled_gamma = gamma_ramp[i]*0xffff; - current_ramp[i] = (unsigned short)round(scaled_gamma); - } - setCurrentGamma(disp, screen, env); + setGamma(env, disp, screen, gamma_ramp_buffer, true); XCloseDisplay(disp); } 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.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- org_lwjgl_opengl_Display.c 21 Nov 2005 13:22:52 -0000 1.34 +++ org_lwjgl_opengl_Display.c 21 Nov 2005 16:32:34 -0000 1.35 @@ -182,7 +182,7 @@ XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); } -static bool releaseInput(JNIEnv *env, jint extension, jint window_mode) { +static bool releaseInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp) { if (isLegacyFullscreen(window_mode) || input_released) return false; input_released = true; @@ -190,19 +190,19 @@ updateInputGrab(window_mode); if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(env, getCurrentScreen(), extension, true); + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, true); } return true; } -static void acquireInput(JNIEnv *env, jint extension, jint window_mode) { +static void acquireInput(JNIEnv *env, jint extension, jint window_mode, jobject gamma_ramp) { 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); + temporaryRestoreMode(env, getCurrentScreen(), extension, gamma_ramp); } } @@ -229,20 +229,20 @@ } } -static void checkInput(JNIEnv *env, jint extension, jint window_mode) { +static void checkInput(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma) { Window win; int revert_mode; XGetInputFocus(getDisplay(), &win, &revert_mode); if (win == current_win) { - acquireInput(env, extension, window_mode); + acquireInput(env, extension, window_mode, current_gamma); focused = true; } else { - releaseInput(env, extension, window_mode); + releaseInput(env, extension, window_mode, saved_gamma); focused = false; } } -void handleMessages(JNIEnv *env, jint extension, jint window_mode) { +void handleMessages(JNIEnv *env, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma) { XEvent event; /* Window win; int revert_mode;*/ @@ -293,7 +293,7 @@ break; } } - checkInput(env, extension, window_mode); + checkInput(env, extension, window_mode, saved_gamma, current_gamma); } static void setWindowTitle(const char *title) { @@ -454,9 +454,9 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate - (JNIEnv *env, jclass clazz, jint extension, jint window_mode) + (JNIEnv *env, jclass clazz, jint extension, jint window_mode, jobject saved_gamma, jobject current_gamma) { - handleMessages(env, extension, window_mode); + handleMessages(env, extension, window_mode, saved_gamma, current_gamma); } JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { @@ -467,12 +467,12 @@ switchDisplayMode(env, mode, getCurrentScreen(), extension); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension) { - resetDisplayMode(env, getCurrentScreen(), extension, false); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject gamma_ramp) { + resetDisplayMode(env, getCurrentScreen(), extension, gamma_ramp, false); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { - return (jint)getGammaRampLength(env, getCurrentScreen()); + return (jint)getGammaRampLengthOfDisplay(env, getDisplay(), getCurrentScreen()); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetGammaRamp(JNIEnv *env, jclass clazz, jobject gamma_buffer) { |
|
From: Elias N. <eli...@us...> - 2005-11-21 13:44:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24697/src/native/linux Modified Files: display.c Log Message: Linux: Folded three ramp arrays into one, to avoid multiple allocations Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- display.c 21 Nov 2005 13:32:52 -0000 1.14 +++ display.c 21 Nov 2005 13:43:49 -0000 1.15 @@ -71,9 +71,7 @@ static int current_height; static int current_freq; static int saved_gamma_ramp_length = 0; -static unsigned short *r_ramp = NULL; -static unsigned short *g_ramp = NULL; -static unsigned short *b_ramp = NULL; +static unsigned short *saved_ramp = NULL; static unsigned short *current_ramp = NULL; static int current_gamma_ramp_length = 0; @@ -284,12 +282,8 @@ } static void freeSavedGammaRamps() { - free(r_ramp); - free(g_ramp); - free(b_ramp); - r_ramp = NULL; - g_ramp = NULL; - b_ramp = NULL; + free(saved_ramp); + saved_ramp = NULL; saved_gamma_ramp_length = 0; } @@ -346,10 +340,9 @@ /* Fetch the current gamma ramp */ saved_gamma_ramp_length = getGammaRampLengthOfDisplay(env, disp, screen); if (saved_gamma_ramp_length > 0) { - r_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); - g_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); - b_ramp = (unsigned short *)malloc(sizeof(unsigned short)*saved_gamma_ramp_length); - if (!XF86VidModeGetGammaRamp(disp, screen, saved_gamma_ramp_length, r_ramp, g_ramp, b_ramp)) + saved_ramp = (unsigned short *)malloc(sizeof(unsigned short)*3*saved_gamma_ramp_length); + if (!XF86VidModeGetGammaRamp(disp, screen, saved_gamma_ramp_length, saved_ramp, + saved_ramp + saved_gamma_ramp_length, saved_ramp + saved_gamma_ramp_length*2)) freeSavedGammaRamps(); } XCloseDisplay(disp); @@ -420,7 +413,8 @@ printfDebugJava(env, "Failed to reset mode"); } if (saved_gamma_ramp_length > 0) { - XF86VidModeSetGammaRamp(disp, screen, saved_gamma_ramp_length, r_ramp, g_ramp, b_ramp); + XF86VidModeSetGammaRamp(disp, screen, saved_gamma_ramp_length, saved_ramp, saved_ramp + + saved_gamma_ramp_length, saved_ramp + saved_gamma_ramp_length*2); } // decDisplay(); XCloseDisplay(disp); |
|
From: Elias N. <eli...@us...> - 2005-11-21 13:33:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Moved a display connection creation to java Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- LinuxDisplay.java 21 Nov 2005 13:22:52 -0000 1.30 +++ LinuxDisplay.java 21 Nov 2005 13:32:52 -0000 1.31 @@ -79,20 +79,28 @@ private static PeerInfo peer_info; private static int getBestDisplayModeExtension() throws LWJGLException { - if (System.getenv("LWJGL_DISABLE_XRANDR") == null && isXrandrSupported()) { - LWJGLUtil.log("Using Xrandr for display mode switching"); - return XRANDR; - } else if (isXF86VidModeSupported()) { - LWJGLUtil.log("Using XF86VidMode for display mode switching"); - return XF86VIDMODE; - } else { - LWJGLUtil.log("No display mode extensions available"); - return NONE; + 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; + } + decDisplay(); + return result; + } finally { + unlockAWT(); } - } - private static native boolean isXrandrSupported() throws LWJGLException; - private static native boolean isXF86VidModeSupported() throws LWJGLException; + private static native boolean isXrandrSupported(); + private static native boolean isXF86VidModeSupported(); private static boolean isNetWMFullscreenSupported() throws LWJGLException { if (System.getenv("LWJGL_DISABLE_NETWM") != null) |
|
From: Elias N. <eli...@us...> - 2005-11-21 13:32:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543/src/native/linux Modified Files: display.c Log Message: Linux: Moved a display connection creation to java Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- display.c 21 Nov 2005 13:22:52 -0000 1.13 +++ display.c 21 Nov 2005 13:32:52 -0000 1.14 @@ -130,26 +130,12 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXrandrSupported(JNIEnv *env, jclass unused) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return JNI_FALSE; - } - - jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE; - XCloseDisplay(disp); + jboolean result = isXrandrSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXF86VidModeSupported(JNIEnv *env, jclass unused) { - Display *disp = XOpenDisplay(NULL); - if (disp == NULL) { - throwException(env, "Could not open display"); - return JNI_FALSE; - } - - jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE; - XCloseDisplay(disp); + jboolean result = isXF86VidModeSupported(env, getDisplay()) ? JNI_TRUE : JNI_FALSE; return result; } |
|
From: Elias N. <eli...@us...> - 2005-11-21 13:23:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19456/src/java/org/lwjgl/opengl Modified Files: LinuxDisplay.java Log Message: Linux: Moved display mode extension and window state handling up into java code Index: LinuxDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- LinuxDisplay.java 23 Oct 2005 19:41:08 -0000 1.29 +++ LinuxDisplay.java 21 Nov 2005 13:22:52 -0000 1.30 @@ -47,6 +47,22 @@ import org.lwjgl.input.Keyboard; final class LinuxDisplay implements DisplayImplementation { + /** Window mode enum */ + private static final int FULLSCREEN_LEGACY = 1; + private static final int FULLSCREEN_NETWM = 2; + private static final int WINDOWED = 3; + + /** Current window mode */ + private static int current_window_mode = WINDOWED; + + /** Display mode switching API */ + private static final int XRANDR = 10; + private static final int XF86VIDMODE = 11; + private static final int NONE = 12; + + /** Current mode swithcing API */ + private static int current_displaymode_extension = NONE; + private static final int NUM_BUTTONS = 3; /** Keep track on the current awt lock owner to avoid @@ -62,6 +78,37 @@ private static PeerInfo peer_info; + private static int getBestDisplayModeExtension() throws LWJGLException { + if (System.getenv("LWJGL_DISABLE_XRANDR") == null && isXrandrSupported()) { + LWJGLUtil.log("Using Xrandr for display mode switching"); + return XRANDR; + } else if (isXF86VidModeSupported()) { + LWJGLUtil.log("Using XF86VidMode for display mode switching"); + return XF86VIDMODE; + } else { + LWJGLUtil.log("No display mode extensions available"); + return NONE; + } + + } + private static native boolean isXrandrSupported() throws LWJGLException; + private static native boolean isXF86VidModeSupported() throws LWJGLException; + + private static boolean isNetWMFullscreenSupported() throws LWJGLException { + if (System.getenv("LWJGL_DISABLE_NETWM") != null) + return false; + lockAWT(); + try { + incDisplay(); + boolean supported = nIsNetWMFullscreenSupported(); + decDisplay(); + return supported; + } finally { + unlockAWT(); + } + } + private static native boolean nIsNetWMFullscreenSupported(); + /* 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 * do just that. @@ -129,12 +176,26 @@ private static native void openDisplay() throws LWJGLException; private static native void closeDisplay(); + private static int getWindowMode(boolean fullscreen) throws LWJGLException { + if (fullscreen) { + if (current_displaymode_extension == XRANDR && isNetWMFullscreenSupported()) { + LWJGLUtil.log("Using NetWM for fullscreen window"); + return FULLSCREEN_NETWM; + } else { + LWJGLUtil.log("Using legacy mode for fullscreen window"); + return FULLSCREEN_LEGACY; + } + } else + return WINDOWED; + } + public void createWindow(DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException { lockAWT(); try { ByteBuffer handle = peer_info.lockAndGetHandle(); try { - nCreateWindow(handle, mode, fullscreen, x, y); + current_window_mode = getWindowMode(fullscreen); + nCreateWindow(handle, mode, current_window_mode, x, y); } finally { peer_info.unlock(); } @@ -142,7 +203,7 @@ unlockAWT(); } } - private static native void nCreateWindow(ByteBuffer peer_info_handle, DisplayMode mode, boolean fullscreen, int x, int y) throws LWJGLException; + private static native void nCreateWindow(ByteBuffer peer_info_handle, DisplayMode mode, int window_mode, int x, int y) throws LWJGLException; public void destroyWindow() { lockAWT(); @@ -154,22 +215,22 @@ public void switchDisplayMode(DisplayMode mode) throws LWJGLException { lockAWT(); try { - nSwitchDisplayMode(mode); + nSwitchDisplayMode(current_displaymode_extension, mode); } finally { unlockAWT(); } } - private static native void nSwitchDisplayMode(DisplayMode mode) throws LWJGLException; + private static native void nSwitchDisplayMode(int extension, DisplayMode mode) throws LWJGLException; public void resetDisplayMode() { lockAWT(); try { - nResetDisplayMode(); + nResetDisplayMode(current_displaymode_extension); } finally { unlockAWT(); } } - private static native void nResetDisplayMode(); + private static native void nResetDisplayMode(int extension); public int getGammaRampLength() { lockAWT(); @@ -200,13 +261,17 @@ public DisplayMode init() throws LWJGLException { lockAWT(); try { - DisplayMode mode = nInit(); + current_displaymode_extension = getBestDisplayModeExtension(); + if (current_displaymode_extension == NONE) + throw new LWJGLException("No display mode extension is available"); + DisplayMode mode = nInit(current_displaymode_extension); return mode; } finally { unlockAWT(); } } - private static native DisplayMode nInit() throws LWJGLException; + /** Assumes extension != NONE */ + private static native DisplayMode nInit(int extension) throws LWJGLException; public void setTitle(String title) { lockAWT(); @@ -233,11 +298,11 @@ public boolean isActive() { lockAWT(); - boolean result = nIsActive(); + boolean result = nIsActive(current_window_mode); unlockAWT(); return result; } - private static native boolean nIsActive(); + private static native boolean nIsActive(int window_mode); public boolean isDirty() { lockAWT(); @@ -254,10 +319,10 @@ public void update() { lockAWT(); - nUpdate(); + nUpdate(current_displaymode_extension, current_window_mode); unlockAWT(); } - private static native void nUpdate(); + private static native void nUpdate(int extension, int current_window_mode); public void reshape(int x, int y, int width, int height) { lockAWT(); @@ -269,13 +334,13 @@ public DisplayMode[] getAvailableDisplayModes() throws LWJGLException { lockAWT(); try { - DisplayMode[] modes = nGetAvailableDisplayModes(); + DisplayMode[] modes = nGetAvailableDisplayModes(current_displaymode_extension); return modes; } finally { unlockAWT(); } } - private static native DisplayMode[] nGetAvailableDisplayModes() throws LWJGLException; + private static native DisplayMode[] nGetAvailableDisplayModes(int extension) throws LWJGLException; /* Mouse */ public boolean hasWheel() { @@ -288,10 +353,11 @@ public void createMouse() { lockAWT(); - nCreateMouse(); + nCreateMouse(current_window_mode); unlockAWT(); } - private static native void nCreateMouse(); + private static native void nCreateMouse(int window_mode); + public void destroyMouse() { lockAWT(); nDestroyMouse(); @@ -300,6 +366,7 @@ private static native void nDestroyMouse(); public void pollMouse(IntBuffer coord_buffer, ByteBuffer buttons) { + update(); lockAWT(); nPollMouse(coord_buffer, buttons); unlockAWT(); @@ -307,6 +374,7 @@ private static native void nPollMouse(IntBuffer coord_buffer, ByteBuffer buttons); public int readMouse(IntBuffer buffer, int buffer_position) { + update(); lockAWT(); int count = nReadMouse(buffer, buffer_position); unlockAWT(); @@ -323,10 +391,10 @@ public void grabMouse(boolean grab) { lockAWT(); - nGrabMouse(grab); + nGrabMouse(current_window_mode, grab); unlockAWT(); } - private static native void nGrabMouse(boolean grab); + private static native void nGrabMouse(int window_mode, boolean grab); public int getNativeCursorCapabilities() { lockAWT(); @@ -386,12 +454,12 @@ public void createKeyboard() throws LWJGLException { lockAWT(); try { - nCreateKeyboard(); + nCreateKeyboard(current_window_mode); } finally { unlockAWT(); } } - private static native void nCreateKeyboard() throws LWJGLException; + private static native void nCreateKeyboard(int window_mode) throws LWJGLException; public void destroyKeyboard() { lockAWT(); @@ -401,6 +469,7 @@ private static native void nDestroyKeyboard(); public void pollKeyboard(ByteBuffer keyDownBuffer) { + update(); lockAWT(); nPollKeyboard(keyDownBuffer); unlockAWT(); @@ -408,6 +477,7 @@ private static native void nPollKeyboard(ByteBuffer keyDownBuffer); public int readKeyboard(IntBuffer buffer, int buffer_position) { + update(); lockAWT(); int count = nReadKeyboard(buffer, buffer_position); unlockAWT(); |
|
From: Elias N. <eli...@us...> - 2005-11-21 13:23:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19456/src/native/linux Modified Files: Window.h display.c display.h org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_Display.c Log Message: Linux: Moved display mode extension and window state handling up into java code Index: display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- display.h 11 Dec 2004 20:09:04 -0000 1.7 +++ display.h 21 Nov 2005 13:22:52 -0000 1.8 @@ -45,17 +45,14 @@ #include <jni.h> #include "common_tools.h" -typedef enum {XRANDR, XF86VIDMODE, NONE} extension; - extern int getScreenModeWidth(void); extern int getScreenModeHeight(void); -extern jobject initDisplay(JNIEnv *env, int screen); -extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen); -extern void resetDisplayMode(JNIEnv *env, int screen, bool temporary); -extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen); +extern jobject initDisplay(JNIEnv *env, int screen, jint extension); +extern void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension); +extern void resetDisplayMode(JNIEnv *env, int screen, jint extension, bool temporary); +extern jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen, jint extension); extern int getGammaRampLength(JNIEnv *env, int screen); extern void setGammaRamp(JNIEnv *env, jobject gamma_ramp_buffer, int screen); -extern extension getCurrentDisplayModeExtension(); -extern void temporaryRestoreMode(JNIEnv *env, int screen); +extern void temporaryRestoreMode(JNIEnv *env, int screen, jint extension); #endif Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- display.c 21 Nov 2005 10:55:49 -0000 1.12 +++ display.c 21 Nov 2005 13:22:52 -0000 1.13 @@ -50,6 +50,7 @@ #include "display.h" #include "common_tools.h" #include "Window.h" +#include "org_lwjgl_opengl_LinuxDisplay.h" #define NUM_XRANDR_RETRIES 5 @@ -75,7 +76,6 @@ static unsigned short *b_ramp = NULL; static unsigned short *current_ramp = NULL; static int current_gamma_ramp_length = 0; -static extension current_extension = NONE; int getScreenModeWidth(void) { return current_width; @@ -85,15 +85,6 @@ return current_height; } -extension getCurrentDisplayModeExtension(void) { - return current_extension; -} - -static bool isXrandrForceDisabled() { - char *supported_env = getenv("LWJGL_DISABLE_XRANDR"); - return supported_env != NULL; -} - static bool getXF86VidModeVersion(JNIEnv *env, Display *disp, int *major, int *minor) { int event_base, error_base; @@ -126,8 +117,6 @@ static bool isXrandrSupported(JNIEnv *env, Display *disp) { int major, minor; - if (isXrandrForceDisabled()) - return false; if (!getXrandrVersion(env, disp, &major, &minor)) return false; return major >= 1; @@ -140,17 +129,28 @@ return major_ver >= 2; } -static extension getBestDisplayModeExtension(JNIEnv *env, Display *disp) { - if (isXrandrSupported(env, disp)) { - printfDebugJava(env, "Using Xrandr for display mode switching"); - return XRANDR; - } else if (isXF86VidModeSupported(env, disp)) { - printfDebugJava(env, "Using XF86VidMode for display mode switching"); - return XF86VIDMODE; - } else { - printfDebugJava(env, "No display mode extensions available"); - return NONE; +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXrandrSupported(JNIEnv *env, jclass unused) { + Display *disp = XOpenDisplay(NULL); + if (disp == NULL) { + throwException(env, "Could not open display"); + return JNI_FALSE; } + + jboolean result = isXrandrSupported(env, disp) ? JNI_TRUE : JNI_FALSE; + XCloseDisplay(disp); + return result; +} + +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_isXF86VidModeSupported(JNIEnv *env, jclass unused) { + Display *disp = XOpenDisplay(NULL); + if (disp == NULL) { + throwException(env, "Could not open display"); + return JNI_FALSE; + } + + jboolean result = isXF86VidModeSupported(env, disp) ? JNI_TRUE : JNI_FALSE; + XCloseDisplay(disp); + return result; } static mode_info *getXrandrDisplayModes(Display *disp, int screen, int *num_modes) { @@ -204,13 +204,13 @@ return avail_modes; } -static mode_info *getDisplayModes(Display *disp, int screen, int *num_modes) { - switch (current_extension) { - case XF86VIDMODE: +static mode_info *getDisplayModes(Display *disp, int screen, jint extension, int *num_modes) { + switch (extension) { + case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE: return getXF86VidModeDisplayModes(disp, screen, num_modes); - case XRANDR: + case org_lwjgl_opengl_LinuxDisplay_XRANDR: return getXrandrDisplayModes(disp, screen, num_modes); - case NONE: + case org_lwjgl_opengl_LinuxDisplay_NONE: // fall through default: return NULL; @@ -255,9 +255,9 @@ return false; } -static bool setMode(JNIEnv *env, Display *disp, int screen, 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, bool temporary) { int num_modes, i; - mode_info *avail_modes = getDisplayModes(disp, screen, &num_modes); + mode_info *avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL) { printfDebugJava(env, "Could not get display modes"); return false; @@ -266,20 +266,20 @@ for ( i = 0; i < num_modes; ++i ) { printfDebugJava(env, "Mode %d: %dx%d @%d", i, avail_modes[i].width, avail_modes[i].height, avail_modes[i].freq); if (avail_modes[i].width == width && avail_modes[i].height == height && avail_modes[i].freq == freq) { - switch (current_extension) { - case XF86VIDMODE: + switch (extension) { + case org_lwjgl_opengl_LinuxDisplay_XF86VIDMODE: if (!setXF86VidModeMode(disp, screen, &avail_modes[i])) { printfDebugJava(env, "Could not switch mode"); continue; } break; - case XRANDR: + case org_lwjgl_opengl_LinuxDisplay_XRANDR: if (!setXrandrMode(disp, screen, &avail_modes[i])) { printfDebugJava(env, "Could not switch mode"); continue; } break; - case NONE: // Should never happen, since NONE imply no available display modes + case org_lwjgl_opengl_LinuxDisplay_NONE: // Should never happen, since NONE imply no available display modes default: // Should never happen continue; } @@ -331,7 +331,7 @@ return length; } -jobject initDisplay(JNIEnv *env, int screen) { +jobject initDisplay(JNIEnv *env, int screen, jint extension) { int num_modes; mode_info *avail_modes; Display *disp = XOpenDisplay(NULL); @@ -340,13 +340,7 @@ return NULL; } - current_extension = getBestDisplayModeExtension(env, disp); - if (current_extension == NONE) { - throwException(env, "No display mode extension is available"); - XCloseDisplay(disp); - return NULL; - } - avail_modes = getDisplayModes(disp, screen, &num_modes); + avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL || num_modes == 0) { throwException(env, "Could not get display modes"); XCloseDisplay(disp); @@ -395,20 +389,20 @@ } } -void temporaryRestoreMode(JNIEnv *env, int screen) { +void temporaryRestoreMode(JNIEnv *env, int screen, jint extension) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebugJava(env, "Could not open display"); return; } - if (!setMode(env, disp, screen, current_width, current_height, current_freq, false)) + if (!setMode(env, disp, screen, extension, current_width, current_height, current_freq, false)) printfDebugJava(env, "Could not restore mode"); setCurrentGamma(disp, screen, NULL); XCloseDisplay(disp); // Don't propagate error to caller } -void switchDisplayMode(JNIEnv * env, jobject mode, int screen) { +void switchDisplayMode(JNIEnv * env, jobject mode, int screen, jint extension) { if (mode == NULL) { throwException(env, "mode must be non-null"); return; @@ -425,18 +419,18 @@ throwException(env, "Could not open display"); return; } - if (!setMode(env, disp, screen, width, height, freq, false)) + if (!setMode(env, disp, screen, extension, width, height, freq, false)) throwException(env, "Could not switch mode."); XCloseDisplay(disp); } -void resetDisplayMode(JNIEnv *env, int screen, bool temporary) { +void resetDisplayMode(JNIEnv *env, int screen, jint extension, bool temporary) { Display *disp = XOpenDisplay(NULL); if (disp == NULL) { printfDebugJava(env, "Failed to contact X Server"); return; } - if (!setMode(env, disp, screen, saved_width, saved_height, saved_freq, temporary)) { + if (!setMode(env, disp, screen, extension, saved_width, saved_height, saved_freq, temporary)) { printfDebugJava(env, "Failed to reset mode"); } if (saved_gamma_ramp_length > 0) { @@ -446,7 +440,7 @@ XCloseDisplay(disp); } -jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen) { +jobjectArray getAvailableDisplayModes(JNIEnv * env, int screen, jint extension) { int num_modes, i; mode_info *avail_modes; Display *disp = XOpenDisplay(NULL); @@ -456,7 +450,7 @@ } int bpp = XDefaultDepth(disp, screen); - avail_modes = getDisplayModes(disp, screen, &num_modes); + avail_modes = getDisplayModes(disp, screen, extension, &num_modes); if (avail_modes == NULL) { printfDebugJava(env, "Could not get display modes"); XCloseDisplay(disp); 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.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- org_lwjgl_input_Mouse.c 10 Oct 2005 09:11:24 -0000 1.37 +++ org_lwjgl_input_Mouse.c 21 Nov 2005 13:22:52 -0000 1.38 @@ -135,7 +135,7 @@ XDefineCursor(getDisplay(), getCurrentWindow(), cursor); } -static void grabPointer(void) { +static void grabPointer(jint window_mode) { if (!pointer_grabbed) { int result; int grab_mask = PointerMotionMask | ButtonPressMask | ButtonReleaseMask; @@ -144,7 +144,7 @@ if (result == GrabSuccess) { pointer_grabbed = true; // make sure we have a centered window - if (isLegacyFullscreen()) { + if (isLegacyFullscreen(window_mode)) { XWindowAttributes win_attribs; XGetWindowAttributes(getDisplay(), getCurrentWindow(), &win_attribs); XF86VidModeSetViewPort(getDisplay(), getCurrentScreen(), win_attribs.x, win_attribs.y); @@ -162,11 +162,11 @@ } } -void updatePointerGrab(void) { +void updatePointerGrab(jint window_mode) { if (!created) return; - if (isFullscreen() || shouldGrab()) { - grabPointer(); + if (isFullscreen(window_mode) || shouldGrab()) { + grabPointer(window_mode); } else { ungrabPointer(); } @@ -205,7 +205,7 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateMouse - (JNIEnv * env, jclass clazz) + (JNIEnv * env, jclass clazz, jint window_mode) { int i; last_y = last_x = accum_dx = accum_dy = accum_dz = 0; @@ -218,7 +218,7 @@ current_cursor = None; created = true; pointer_grabbed = false; - updatePointerGrab(); + updatePointerGrab(window_mode); initEventQueue(&event_queue, EVENT_SIZE); } @@ -314,7 +314,6 @@ int coords_length = (*env)->GetDirectBufferCapacity(env, coord_buffer_obj); unsigned char *buttons_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, button_buffer_obj); int buttons_length = (*env)->GetDirectBufferCapacity(env, button_buffer_obj); - handleMessages(env); if (coords_length < 3) { printfDebugJava(env, "ERROR: Not enough space in coords array: %d < 3", coords_length); return; @@ -339,7 +338,6 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReadMouse(JNIEnv *env, jclass clazz, jobject buffer, jint buffer_position) { jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer))/sizeof(jint) - buffer_position; - handleMessages(env); return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size); } @@ -347,12 +345,12 @@ XWarpPointer(getDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, x, transformY(y)); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabMouse(JNIEnv * env, jclass clazz, jboolean new_grab) { +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGrabMouse(JNIEnv * env, jclass clazz, jint window_mode, jboolean new_grab) { Window root_return, child_return; int root_x, root_y, win_x, win_y; unsigned int mask_return; - setGrab(new_grab == JNI_TRUE ? true : false); + 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); Index: org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- org_lwjgl_input_Keyboard.c 19 Apr 2005 07:18:17 -0000 1.21 +++ org_lwjgl_input_Keyboard.c 21 Nov 2005 13:22:52 -0000 1.22 @@ -87,10 +87,10 @@ } } -void updateKeyboardGrab(void) { +void updateKeyboardGrab(jint window_mode) { if (!created) return; - if (isLegacyFullscreen()/* || shouldGrab()*/) { + if (isLegacyFullscreen(window_mode)) { grabKeyboard(); } else { ungrabKeyboard(); @@ -123,13 +123,13 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateKeyboard - (JNIEnv * env, jclass clazz) + (JNIEnv * env, jclass clazz, jint window_mode) { memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); created = true; keyboard_grabbed = false; initEventQueue(&event_queue, 3); - updateKeyboardGrab(); + updateKeyboardGrab(window_mode); XModifierKeymap *modifier_map = XGetModifierMapping(getDisplay()); numlock_mask = 0; modeswitch_mask = 0; @@ -684,12 +684,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nPollKeyboard(JNIEnv * env, jclass clazz, jobject buffer) { unsigned char *new_keyboard_buffer = (unsigned char *)(*env)->GetDirectBufferAddress(env, buffer); - handleMessages(env); memcpy(new_keyboard_buffer, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); } JNIEXPORT int JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReadKeyboard(JNIEnv * env, jclass clazz, jobject buffer, jint buffer_position) { - handleMessages(env); jint* buffer_ptr = (jint *)(*env)->GetDirectBufferAddress(env, buffer); int buffer_size = ((*env)->GetDirectBufferCapacity(env, buffer))/sizeof(jint) - buffer_position; return copyEvents(&event_queue, buffer_ptr + buffer_position, buffer_size); Index: Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Window.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Window.h 20 Feb 2005 11:24:22 -0000 1.26 +++ Window.h 21 Nov 2005 13:22:52 -0000 1.27 @@ -49,12 +49,7 @@ #include "extgl.h" #include "extgl_glx.h" - /* - * release input (keyboard, mouse) - */ - extern void handleMessages(JNIEnv *env); - - extern bool checkXError(JNIEnv *env, Display *display); + extern bool checkXError(JNIEnv *, Display *); extern Atom getWarpAtom(void); /* * Various functions to release/acquire keyboard and mouse @@ -64,9 +59,9 @@ extern void handleButtonPress(XButtonEvent *); extern void handleButtonRelease(XButtonEvent *); extern void handleKeyEvent(XKeyEvent *); - extern void updatePointerGrab(void); - extern void updateKeyboardGrab(void); - extern void setGrab(bool); + extern void updatePointerGrab(jint); + extern void updateKeyboardGrab(jint); + extern void setGrab(jint, bool); extern bool isGrabbed(void); extern bool shouldGrab(void); @@ -98,11 +93,11 @@ /* * Return true if we are in fullscreen mode */ - extern bool isFullscreen(void); + extern bool isFullscreen(jint window_mode); /* * Return true if we are in exclusive fullscreen mode */ - extern bool isLegacyFullscreen(void); + extern bool isLegacyFullscreen(jint window_mode); #endif /* _LWJGL_WINDOW_H_INCLUDED_ */ 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.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- org_lwjgl_opengl_Display.c 20 Nov 2005 13:19:39 -0000 1.33 +++ org_lwjgl_opengl_Display.c 21 Nov 2005 13:22:52 -0000 1.34 @@ -68,14 +68,11 @@ #define MWM_HINTS_DECORATIONS (1L << 1) -typedef enum {FULLSCREEN_LEGACY, FULLSCREEN_NETWM, WINDOWED} window_mode; - static GLXWindow glx_window = None; static Atom delete_atom; static Colormap cmap; static Window current_win; -static window_mode current_window_mode; static int current_height; static int current_width; static int current_depth; @@ -156,9 +153,9 @@ } while ((event.type != MapNotify) || (event.xmap.event != win)); } -static void updateInputGrab(void) { - updatePointerGrab(); - updateKeyboardGrab(); +static void updateInputGrab(jint window_mode) { + updatePointerGrab(window_mode); + updateKeyboardGrab(window_mode); } static void setRepeatMode(JNIEnv *env, int mode) { @@ -185,36 +182,36 @@ XChangeProperty (getDisplay(), getCurrentWindow(), motif_hints_atom, motif_hints_atom, 32, PropModeReplace, (unsigned char *)&motif_hints, sizeof(MotifWmHints)/sizeof(long)); } -static bool releaseInput(JNIEnv *env) { - if (isLegacyFullscreen() || input_released) +static bool releaseInput(JNIEnv *env, jint extension, jint window_mode) { + if (isLegacyFullscreen(window_mode) || input_released) return false; input_released = true; setRepeatMode(env, AutoRepeatModeDefault); - updateInputGrab(); - if (current_window_mode == FULLSCREEN_NETWM) { + updateInputGrab(window_mode); + if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { XIconifyWindow(getDisplay(), getCurrentWindow(), getCurrentScreen()); - resetDisplayMode(env, getCurrentScreen(), true); + resetDisplayMode(env, getCurrentScreen(), extension, true); } return true; } -static void acquireInput(JNIEnv *env) { - if (isLegacyFullscreen() || !input_released) +static void acquireInput(JNIEnv *env, jint extension, jint window_mode) { + if (isLegacyFullscreen(window_mode) || !input_released) return; input_released = false; setRepeatMode(env, AutoRepeatModeOff); - updateInputGrab(); - if (current_window_mode == FULLSCREEN_NETWM) { - temporaryRestoreMode(env, getCurrentScreen()); + updateInputGrab(window_mode); + if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { + temporaryRestoreMode(env, getCurrentScreen(), extension); } } -bool isFullscreen(void) { - return current_window_mode == FULLSCREEN_LEGACY || current_window_mode == FULLSCREEN_NETWM; +bool isFullscreen(jint window_mode) { + return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY || window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM; } -bool isLegacyFullscreen(void) { - return current_window_mode == FULLSCREEN_LEGACY; +bool isLegacyFullscreen(jint window_mode) { + return window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_LEGACY; } bool shouldGrab(void) { @@ -225,27 +222,27 @@ return grab; } -void setGrab(bool new_grab) { +void setGrab(jint window_mode, bool new_grab) { if (new_grab != grab) { grab = new_grab; - updateInputGrab(); + updateInputGrab(window_mode); } } -static void checkInput(JNIEnv *env) { +static void checkInput(JNIEnv *env, jint extension, jint window_mode) { Window win; int revert_mode; XGetInputFocus(getDisplay(), &win, &revert_mode); if (win == current_win) { - acquireInput(env); + acquireInput(env, extension, window_mode); focused = true; } else { - releaseInput(env); + releaseInput(env, extension, window_mode); focused = false; } } -void handleMessages(JNIEnv *env) { +void handleMessages(JNIEnv *env, jint extension, jint window_mode) { XEvent event; /* Window win; int revert_mode;*/ @@ -296,7 +293,7 @@ break; } } - checkInput(env); + checkInput(env, extension, window_mode); } static void setWindowTitle(const char *title) { @@ -339,19 +336,12 @@ setRepeatMode(env, AutoRepeatModeDefault); } -static bool isNetWMForceDisabled() { - char *supported_env = getenv("LWJGL_DISABLE_NETWM"); - return supported_env != NULL; -} - static bool isNetWMFullscreenSupported(JNIEnv *env) { unsigned long nitems; Atom actual_type; int actual_format; unsigned long bytes_after; Atom *supported_list; - if (isNetWMForceDisabled()) - return false; 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) { @@ -371,11 +361,15 @@ return supported; } +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsNetWMFullscreenSupported(JNIEnv *env, jclass unused) { + return isNetWMFullscreenSupported(env) ? JNI_TRUE : JNI_FALSE; +} + JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nReshape(JNIEnv *env, jclass clazz, jint x, jint y, jint width, jint height) { XMoveWindow(getDisplay(), getCurrentWindow(), x, y); } -static bool createWindow(JNIEnv* env, X11PeerInfo *peer_info, int x, int y, int width, int height) { +static bool createWindow(JNIEnv* env, jint window_mode, X11PeerInfo *peer_info, int x, int y, int width, int height) { bool undecorated = getBooleanProperty(env, "org.lwjgl.opengl.Window.undecorated"); dirty = true; focused = true; @@ -401,7 +395,7 @@ attribs.background_pixel = 0xFF000000; attribs.win_gravity = NorthWestGravity; attribmask = CWColormap | CWBackPixel | CWEventMask | CWWinGravity; - if (isLegacyFullscreen()) { + if (isLegacyFullscreen(window_mode)) { attribmask |= CWOverrideRedirect; attribs.override_redirect = True; } @@ -417,7 +411,7 @@ } printfDebugJava(env, "Created window"); current_win = win; - if (current_window_mode != WINDOWED || undecorated) { + if (window_mode != org_lwjgl_opengl_LinuxDisplay_WINDOWED || undecorated) { // Use Motif decoration hint property and hope the window manager respects them setDecorations(0); } @@ -431,7 +425,7 @@ XFree(size_hints); delete_atom = XInternAtom(getDisplay(), "WM_DELETE_WINDOW", False); XSetWMProtocols(getDisplay(), win, &delete_atom, 1); - if (current_window_mode == FULLSCREEN_NETWM) { + if (window_mode == org_lwjgl_opengl_LinuxDisplay_FULLSCREEN_NETWM) { Atom fullscreen_atom = XInternAtom(getDisplay(), "_NET_WM_STATE_FULLSCREEN", False); XChangeProperty(getDisplay(), getCurrentWindow(), XInternAtom(getDisplay(), "_NET_WM_STATE", False), XInternAtom(getDisplay(), "ATOM", False), 32, PropModeReplace, (const unsigned char*)&fullscreen_atom, 1); @@ -460,21 +454,21 @@ } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nUpdate - (JNIEnv *env, jclass clazz) + (JNIEnv *env, jclass clazz, jint extension, jint window_mode) { - handleMessages(env); + handleMessages(env, extension, window_mode); } -JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz) { - return getAvailableDisplayModes(env, getCurrentScreen()); +JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetAvailableDisplayModes(JNIEnv *env, jclass clazz, jint extension) { + return getAvailableDisplayModes(env, getCurrentScreen(), extension); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jobject mode) { - switchDisplayMode(env, mode, getCurrentScreen()); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSwitchDisplayMode(JNIEnv *env, jclass clazz, jint extension, jobject mode) { + switchDisplayMode(env, mode, getCurrentScreen(), extension); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz) { - resetDisplayMode(env, getCurrentScreen(), false); +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nResetDisplayMode(JNIEnv *env, jclass clazz, jint extension) { + resetDisplayMode(env, getCurrentScreen(), extension, false); } JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nGetGammaRampLength(JNIEnv *env, jclass clazz) { @@ -485,22 +479,11 @@ setGammaRamp(env, gamma_buffer, getCurrentScreen()); } -JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInit(JNIEnv *env, jclass clazz) { - return initDisplay(env, getCurrentScreen()); +JNIEXPORT jobject JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nInit(JNIEnv *env, jclass clazz, jint extension) { + return initDisplay(env, getCurrentScreen(), extension); } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nCreateWindow(JNIEnv *env, jclass clazz, jobject peer_info_handle, jobject mode, jboolean fullscreen, jint x, jint y) { - bool current_fullscreen = fullscreen == JNI_TRUE; - if (current_fullscreen) { - if (getCurrentDisplayModeExtension() == XRANDR && isNetWMFullscreenSupported(env)) { - printfDebugJava(env, "Using NetWM for fullscreen window"); - current_window_mode = FULLSCREEN_NETWM; - } else { - printfDebugJava(env, "Using legacy mode for fullscreen window"); - current_window_mode = FULLSCREEN_LEGACY; - } - } else - current_window_mode = WINDOWED; +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) { X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *fb_config = NULL; if (peer_info->glx13) { @@ -513,7 +496,7 @@ 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); - bool window_created = createWindow(env, peer_info, x, y, width, height); + bool window_created = createWindow(env, window_mode, peer_info, x, y, width, height); if (!window_created) { return; } @@ -551,8 +534,8 @@ } JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIsActive - (JNIEnv *env, jclass clazz) { - return focused || isLegacyFullscreen() ? JNI_TRUE : JNI_FALSE; + (JNIEnv *env, jclass clazz, jint window_mode) { + return focused || isLegacyFullscreen(window_mode) ? JNI_TRUE : JNI_FALSE; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nLockAWT(JNIEnv *env, jclass clazz) { |
|
From: Elias N. <eli...@us...> - 2005-11-21 11:08:23
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18137 Modified Files: build.xml Log Message: build.xml: target 'jars' shouldn't depend on target 'clean' Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- build.xml 4 Nov 2005 19:22:52 -0000 1.94 +++ build.xml 21 Nov 2005 11:08:04 -0000 1.95 @@ -231,7 +231,7 @@ </target> <!-- Create ONLY the jar archives --> - <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="clean, -initialize, compile, -createjars"> + <target name="jars" description="Creates the Java archives ONLY and places them in libs/" depends="-initialize, compile, -createjars"> <move todir="libs/"> <fileset dir="${lwjgl.temp}/jar"> <include name="*.jar"/> |
|
From: Elias N. <eli...@us...> - 2005-11-21 10:55:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15509 Modified Files: display.c Log Message: Linux: Removed superfluous check from display.c Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- display.c 21 Nov 2005 10:45:59 -0000 1.11 +++ display.c 21 Nov 2005 10:55:49 -0000 1.12 @@ -213,7 +213,6 @@ case NONE: // fall through default: - // Should never happen return NULL; } } @@ -257,8 +256,6 @@ } static bool setMode(JNIEnv *env, Display *disp, int screen, int width, int height, int freq, bool temporary) { - if (current_extension == NONE) - return false; int num_modes, i; mode_info *avail_modes = getDisplayModes(disp, screen, &num_modes); if (avail_modes == NULL) { @@ -282,7 +279,7 @@ continue; } break; - case NONE: // Should never happen + case NONE: // Should never happen, since NONE imply no available display modes default: // Should never happen continue; } |
|
From: Elias N. <eli...@us...> - 2005-11-21 10:46:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13690 Modified Files: display.c Log Message: Linux: Added zero size check to display.c Index: display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/display.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- display.c 13 Sep 2005 06:56:14 -0000 1.10 +++ display.c 21 Nov 2005 10:45:59 -0000 1.11 @@ -261,7 +261,7 @@ return false; int num_modes, i; mode_info *avail_modes = getDisplayModes(disp, screen, &num_modes); - if (avail_modes == NULL || num_modes == 0) { + if (avail_modes == NULL) { printfDebugJava(env, "Could not get display modes"); return false; } @@ -350,7 +350,7 @@ return NULL; } avail_modes = getDisplayModes(disp, screen, &num_modes); - if (avail_modes == NULL) { + if (avail_modes == NULL || num_modes == 0) { throwException(env, "Could not get display modes"); XCloseDisplay(disp); return NULL; |
|
From: Elias N. <eli...@us...> - 2005-11-20 13:47:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29549/common Modified Files: extal.h org_lwjgl_openal_ALC.c Log Message: OpenAL: Made alcGetCurrentContext static in org_lwjgl_openal_ALC.c Index: extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- extal.h 10 Oct 2005 12:50:10 -0000 1.36 +++ extal.h 20 Nov 2005 13:47:45 -0000 1.37 @@ -165,9 +165,6 @@ //extern alGetProcAddressPROC alGetProcAddress; -typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid); -extern alcGetCurrentContextPROC alcGetCurrentContext; - #ifdef __cplusplus } #endif Index: org_lwjgl_openal_ALC.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_openal_ALC.c 12 Apr 2005 10:55:23 -0000 1.8 +++ org_lwjgl_openal_ALC.c 20 Nov 2005 13:47:45 -0000 1.9 @@ -57,8 +57,9 @@ typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName); //typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName); typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName); +typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid); -alcGetCurrentContextPROC alcGetCurrentContext = NULL; +static alcGetCurrentContextPROC alcGetCurrentContext = NULL; static alcGetStringPROC alcGetString; static alcGetIntegervPROC alcGetIntegerv; static alcOpenDevicePROC alcOpenDevice; |
|
From: Elias N. <eli...@us...> - 2005-11-20 13:20:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22864/src/native/linux Modified Files: extgl_glx.c Log Message: Linux: renamed _glX* function pointers to lwjgl_glX* to avoid symbol clash problems discovered in mustang Index: extgl_glx.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extgl_glx.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extgl_glx.c 20 Nov 2005 13:19:39 -0000 1.8 +++ extgl_glx.c 20 Nov 2005 13:20:40 -0000 1.9 @@ -69,7 +69,7 @@ glXWaitXPROC lwjgl_glXWaitX = NULL; glXGetClientStringPROC lwjgl_glXGetClientString = NULL; glXQueryServerStringPROC lwjgl_glXQueryServerString = NULL; -export glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL; +glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL; /* GLX_SGI_swap_control */ glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL; |
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22525/src/native/linux Modified Files: context.c extgl_glx.c extgl_glx.h org_lwjgl_opengl_Display.c org_lwjgl_opengl_LinuxContextImplementation.c org_lwjgl_opengl_Pbuffer.c Log Message: Linux: renamed _glX* function pointers to lwjgl_glX* to avoid symbol clash problems discovered in mustang Index: extgl_glx.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extgl_glx.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- extgl_glx.c 4 Apr 2005 12:24:11 -0000 1.7 +++ extgl_glx.c 20 Nov 2005 13:19:39 -0000 1.8 @@ -32,113 +32,113 @@ #include <dlfcn.h> #include "extgl_glx.h" -glXGetFBConfigsPROC _glXGetFBConfigs = NULL; -glXChooseFBConfigPROC _glXChooseFBConfig = NULL; -glXGetFBConfigAttribPROC _glXGetFBConfigAttrib = NULL; -glXGetVisualFromFBConfigPROC _glXGetVisualFromFBConfig = NULL; -glXCreateWindowPROC _glXCreateWindow = NULL; -glXDestroyWindowPROC _glXDestroyWindow = NULL; -glXCreatePixmapPROC _glXCreatePixmap = NULL; -glXDestroyPixmapPROC _glXDestroyPixmap = NULL; -glXCreatePbufferPROC _glXCreatePbuffer = NULL; -glXDestroyPbufferPROC _glXDestroyPbuffer = NULL; -glXQueryDrawablePROC _glXQueryDrawable = NULL; -glXCreateNewContextPROC _glXCreateNewContext = NULL; -glXMakeContextCurrentPROC _glXMakeContextCurrent = NULL; -glXGetCurrentReadDrawablePROC _glXGetCurrentReadDrawable = NULL; -glXGetCurrentDisplayPROC _glXGetCurrentDisplay = NULL; -glXQueryContextPROC _glXQueryContext = NULL; -glXSelectEventPROC _glXSelectEvent = NULL; -glXGetSelectedEventPROC _glXGetSelectedEvent = NULL; -glXChooseVisualPROC _glXChooseVisual = NULL; -glXCopyContextPROC _glXCopyContext = NULL; -glXCreateContextPROC _glXCreateContext = NULL; -glXCreateGLXPixmapPROC _glXCreateGLXPixmap = NULL; -glXDestroyContextPROC _glXDestroyContext = NULL; -glXDestroyGLXPixmapPROC _glXDestroyGLXPixmap = NULL; -glXGetConfigPROC _glXGetConfig = NULL; -glXGetCurrentContextPROC _glXGetCurrentContext = NULL; -glXGetCurrentDrawablePROC _glXGetCurrentDrawable = NULL; -glXIsDirectPROC _glXIsDirect = NULL; -glXMakeCurrentPROC _glXMakeCurrent = NULL; -glXQueryExtensionPROC _glXQueryExtension = NULL; -glXQueryVersionPROC _glXQueryVersion = NULL; -glXSwapBuffersPROC _glXSwapBuffers = NULL; -glXUseXFontPROC _glXUseXFont = NULL; -glXWaitGLPROC _glXWaitGL = NULL; -glXWaitXPROC _glXWaitX = NULL; -glXGetClientStringPROC _glXGetClientString = NULL; -glXQueryServerStringPROC _glXQueryServerString = NULL; -glXQueryExtensionsStringPROC _glXQueryExtensionsString = NULL; +glXGetFBConfigsPROC lwjgl_glXGetFBConfigs = NULL; +glXChooseFBConfigPROC lwjgl_glXChooseFBConfig = NULL; +glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib = NULL; +glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig = NULL; +glXCreateWindowPROC lwjgl_glXCreateWindow = NULL; +glXDestroyWindowPROC lwjgl_glXDestroyWindow = NULL; +glXCreatePixmapPROC lwjgl_glXCreatePixmap = NULL; +glXDestroyPixmapPROC lwjgl_glXDestroyPixmap = NULL; +glXCreatePbufferPROC lwjgl_glXCreatePbuffer = NULL; +glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer = NULL; +glXQueryDrawablePROC lwjgl_glXQueryDrawable = NULL; +glXCreateNewContextPROC lwjgl_glXCreateNewContext = NULL; +glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent = NULL; +glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable = NULL; +glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay = NULL; +glXQueryContextPROC lwjgl_glXQueryContext = NULL; +glXSelectEventPROC lwjgl_glXSelectEvent = NULL; +glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent = NULL; +glXChooseVisualPROC lwjgl_glXChooseVisual = NULL; +glXCopyContextPROC lwjgl_glXCopyContext = NULL; +glXCreateContextPROC lwjgl_glXCreateContext = NULL; +glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap = NULL; +glXDestroyContextPROC lwjgl_glXDestroyContext = NULL; +glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap = NULL; +glXGetConfigPROC lwjgl_glXGetConfig = NULL; +glXGetCurrentContextPROC lwjgl_glXGetCurrentContext = NULL; +glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable = NULL; +glXIsDirectPROC lwjgl_glXIsDirect = NULL; +glXMakeCurrentPROC lwjgl_glXMakeCurrent = NULL; +glXQueryExtensionPROC lwjgl_glXQueryExtension = NULL; +glXQueryVersionPROC lwjgl_glXQueryVersion = NULL; +glXSwapBuffersPROC lwjgl_glXSwapBuffers = NULL; +glXUseXFontPROC lwjgl_glXUseXFont = NULL; +glXWaitGLPROC lwjgl_glXWaitGL = NULL; +glXWaitXPROC lwjgl_glXWaitX = NULL; +glXGetClientStringPROC lwjgl_glXGetClientString = NULL; +glXQueryServerStringPROC lwjgl_glXQueryServerString = NULL; +export glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString = NULL; /* GLX_SGI_swap_control */ -glXSwapIntervalSGIPROC _glXSwapIntervalSGI = NULL; +glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI = NULL; static void * lib_gl_handle = NULL; typedef void * (APIENTRY * glXGetProcAddressARBPROC) (const GLubyte *procName); -static glXGetProcAddressARBPROC _glXGetProcAddressARB; +static glXGetProcAddressARBPROC lwjgl_glXGetProcAddressARB; static GLXExtensions symbols_flags; /** returns true if the extention is available */ static bool GLXQueryExtension(Display *disp, int screen, const char *name) { - const GLubyte *exts = (const GLubyte *)_glXQueryExtensionsString(disp, screen); + const GLubyte *exts = (const GLubyte *)lwjgl_glXQueryExtensionsString(disp, screen); return extgl_QueryExtension(exts, name); } static void extgl_InitGLX13() { ExtFunction functions[] = { - {"glXGetFBConfigs", (void*)&_glXGetFBConfigs}, - {"glXChooseFBConfig", (void*)&_glXChooseFBConfig}, - {"glXGetFBConfigAttrib", (void*)&_glXGetFBConfigAttrib}, - {"glXGetVisualFromFBConfig", (void*)&_glXGetVisualFromFBConfig}, - {"glXCreateWindow", (void*)&_glXCreateWindow}, - {"glXDestroyWindow", (void*)&_glXDestroyWindow}, - {"glXCreatePixmap", (void*)&_glXCreatePixmap}, - {"glXDestroyPixmap", (void*)&_glXDestroyPixmap}, - {"glXCreatePbuffer", (void*)&_glXCreatePbuffer}, - {"glXDestroyPbuffer", (void*)&_glXDestroyPbuffer}, - {"glXQueryDrawable", (void*)&_glXQueryDrawable}, - {"glXCreateNewContext", (void*)&_glXCreateNewContext}, - {"glXMakeContextCurrent", (void*)&_glXMakeContextCurrent}, - {"glXGetCurrentReadDrawable", (void*)&_glXGetCurrentReadDrawable}, - {"glXGetCurrentDisplay", (void*)&_glXGetCurrentDisplay}, - {"glXQueryContext", (void*)&_glXQueryContext}, - {"glXSelectEvent", (void*)&_glXSelectEvent}, - {"glXGetSelectedEvent", (void*)&_glXGetSelectedEvent}}; + {"glXGetFBConfigs", (void*)&lwjgl_glXGetFBConfigs}, + {"glXChooseFBConfig", (void*)&lwjgl_glXChooseFBConfig}, + {"glXGetFBConfigAttrib", (void*)&lwjgl_glXGetFBConfigAttrib}, + {"glXGetVisualFromFBConfig", (void*)&lwjgl_glXGetVisualFromFBConfig}, + {"glXCreateWindow", (void*)&lwjgl_glXCreateWindow}, + {"glXDestroyWindow", (void*)&lwjgl_glXDestroyWindow}, + {"glXCreatePixmap", (void*)&lwjgl_glXCreatePixmap}, + {"glXDestroyPixmap", (void*)&lwjgl_glXDestroyPixmap}, + {"glXCreatePbuffer", (void*)&lwjgl_glXCreatePbuffer}, + {"glXDestroyPbuffer", (void*)&lwjgl_glXDestroyPbuffer}, + {"glXQueryDrawable", (void*)&lwjgl_glXQueryDrawable}, + {"glXCreateNewContext", (void*)&lwjgl_glXCreateNewContext}, + {"glXMakeContextCurrent", (void*)&lwjgl_glXMakeContextCurrent}, + {"glXGetCurrentReadDrawable", (void*)&lwjgl_glXGetCurrentReadDrawable}, + {"glXGetCurrentDisplay", (void*)&lwjgl_glXGetCurrentDisplay}, + {"glXQueryContext", (void*)&lwjgl_glXQueryContext}, + {"glXSelectEvent", (void*)&lwjgl_glXSelectEvent}, + {"glXGetSelectedEvent", (void*)&lwjgl_glXGetSelectedEvent}}; symbols_flags.GLX13 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } static void extgl_InitGLX12(void) { ExtFunction functions[] = { - {"glXChooseVisual", (void*)&_glXChooseVisual}, - {"glXCopyContext", (void*)&_glXCopyContext}, - {"glXCreateContext", (void*)&_glXCreateContext}, - {"glXCreateGLXPixmap", (void*)&_glXCreateGLXPixmap}, - {"glXDestroyContext", (void*)&_glXDestroyContext}, - {"glXDestroyGLXPixmap", (void*)&_glXDestroyGLXPixmap}, - {"glXGetConfig", (void*)&_glXGetConfig}, - {"glXGetCurrentContext", (void*)&_glXGetCurrentContext}, - {"glXGetCurrentDrawable", (void*)&_glXGetCurrentDrawable}, - {"glXIsDirect", (void*)&_glXIsDirect}, - {"glXMakeCurrent", (void*)&_glXMakeCurrent}, - {"glXQueryExtension", (void*)&_glXQueryExtension}, - {"glXQueryVersion", (void*)&_glXQueryVersion}, - {"glXSwapBuffers", (void*)&_glXSwapBuffers}, - {"glXUseXFont", (void*)&_glXUseXFont}, - {"glXWaitGL", (void*)&_glXWaitGL}, - {"glXWaitX", (void*)&_glXWaitX}, - {"glXGetClientString", (void*)&_glXGetClientString}, - {"glXQueryServerString", (void*)&_glXQueryServerString}, - {"glXQueryExtensionsString", (void*)&_glXQueryExtensionsString}}; + {"glXChooseVisual", (void*)&lwjgl_glXChooseVisual}, + {"glXCopyContext", (void*)&lwjgl_glXCopyContext}, + {"glXCreateContext", (void*)&lwjgl_glXCreateContext}, + {"glXCreateGLXPixmap", (void*)&lwjgl_glXCreateGLXPixmap}, + {"glXDestroyContext", (void*)&lwjgl_glXDestroyContext}, + {"glXDestroyGLXPixmap", (void*)&lwjgl_glXDestroyGLXPixmap}, + {"glXGetConfig", (void*)&lwjgl_glXGetConfig}, + {"glXGetCurrentContext", (void*)&lwjgl_glXGetCurrentContext}, + {"glXGetCurrentDrawable", (void*)&lwjgl_glXGetCurrentDrawable}, + {"glXIsDirect", (void*)&lwjgl_glXIsDirect}, + {"glXMakeCurrent", (void*)&lwjgl_glXMakeCurrent}, + {"glXQueryExtension", (void*)&lwjgl_glXQueryExtension}, + {"glXQueryVersion", (void*)&lwjgl_glXQueryVersion}, + {"glXSwapBuffers", (void*)&lwjgl_glXSwapBuffers}, + {"glXUseXFont", (void*)&lwjgl_glXUseXFont}, + {"glXWaitGL", (void*)&lwjgl_glXWaitGL}, + {"glXWaitX", (void*)&lwjgl_glXWaitX}, + {"glXGetClientString", (void*)&lwjgl_glXGetClientString}, + {"glXQueryServerString", (void*)&lwjgl_glXQueryServerString}, + {"glXQueryExtensionsString", (void*)&lwjgl_glXQueryExtensionsString}}; symbols_flags.GLX12 = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } static void extgl_InitGLXSGISwapControl() { ExtFunction functions[] = { - {"glXSwapIntervalSGI", (void*)&_glXSwapIntervalSGI}}; + {"glXSwapIntervalSGI", (void*)&lwjgl_glXSwapIntervalSGI}}; symbols_flags.GLX_SGI_swap_control = extgl_InitializeFunctions(sizeof(functions)/sizeof(ExtFunction), functions); } @@ -161,8 +161,8 @@ throwException(env, buffer); return false; } - _glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB"); - if (_glXGetProcAddressARB == NULL) { + lwjgl_glXGetProcAddressARB = (glXGetProcAddressARBPROC)dlsym(lib_gl_handle, "glXGetProcAddressARB"); + if (lwjgl_glXGetProcAddressARB == NULL) { extgl_Close(); throwException(env, "Could not get address of glXGetProcAddressARB"); return false; @@ -177,7 +177,7 @@ } void *extgl_GetProcAddress(const char *name) { - void *t = (void*)_glXGetProcAddressARB((const GLubyte*)name); + void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name); if (t == NULL) { t = dlsym(lib_gl_handle, name); if (t == NULL) { @@ -198,7 +198,7 @@ // Check GLX 1.2 symbols available if (!symbols_flags.GLX12) return false; - if (_glXQueryVersion(disp, &major, &minor) != True) + if (lwjgl_glXQueryVersion(disp, &major, &minor) != True) return false; bool glx12 = major > 1 || (major == 1 && minor >= 2); // Check GLX 1.2 version Index: org_lwjgl_opengl_LinuxContextImplementation.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxContextImplementation.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_opengl_LinuxContextImplementation.c 24 Feb 2005 10:44:34 -0000 1.4 +++ org_lwjgl_opengl_LinuxContextImplementation.c 20 Nov 2005 13:19:39 -0000 1.5 @@ -58,8 +58,8 @@ return false; } jboolean allow_software_acceleration = getBooleanProperty(env, "org.lwjgl.opengl.Display.allowSoftwareOpenGL"); - if (!allow_software_acceleration && _glXIsDirect(display, context) == False) { - _glXDestroyContext(display, context); + if (!allow_software_acceleration && lwjgl_glXIsDirect(display, context) == False) { + lwjgl_glXDestroyContext(display, context); throwException(env, "Could not create a direct GLX context"); return false; } @@ -70,7 +70,7 @@ GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info); if (config == NULL) return; - GLXContext context = _glXCreateNewContext(peer_info->display, *config, GLX_RGBA_TYPE, shared_context, True); + GLXContext context = lwjgl_glXCreateNewContext(peer_info->display, *config, GLX_RGBA_TYPE, shared_context, True); XFree(config); if (!checkContext(env, peer_info->display, context)) return; @@ -81,7 +81,7 @@ XVisualInfo *vis_info = getVisualInfoFromPeerInfo(env, peer_info); if (vis_info == NULL) return; - GLXContext context = _glXCreateContext(peer_info->display, vis_info, shared_context, True); + GLXContext context = lwjgl_glXCreateContext(peer_info->display, vis_info, shared_context, True); XFree(vis_info); if (!checkContext(env, peer_info->display, context)) return; @@ -94,7 +94,7 @@ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); if (context_info->extension_flags.GLX_SGI_swap_control) { int interval = sync == JNI_TRUE ? 1 : 0; - _glXSwapIntervalSGI(interval); + lwjgl_glXSwapIntervalSGI(interval); } } @@ -130,7 +130,7 @@ (JNIEnv *env, jclass clazz, jobject peer_handle, jobject context_handle) { X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_handle); X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); - _glXDestroyContext(peer_info->display, context_info->context); + lwjgl_glXDestroyContext(peer_info->display, context_info->context); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nReleaseCurrentContext @@ -138,9 +138,9 @@ X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); Bool result; if (peer_info->glx13) { - result = _glXMakeContextCurrent(peer_info->display, None, None, NULL); + result = lwjgl_glXMakeContextCurrent(peer_info->display, None, None, NULL); } else { - result = _glXMakeCurrent(peer_info->display, None, NULL); + result = lwjgl_glXMakeCurrent(peer_info->display, None, NULL); } if (!result) throwException(env, "Could not release current context"); @@ -152,9 +152,9 @@ X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); Bool result; if (peer_info->glx13) { - result = _glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context); + result = lwjgl_glXMakeContextCurrent(peer_info->display, peer_info->drawable, peer_info->drawable, context_info->context); } else { - result = _glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context); + result = lwjgl_glXMakeCurrent(peer_info->display, peer_info->drawable, context_info->context); } if (!result) throwException(env, "Could not make context current"); @@ -163,11 +163,11 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nIsCurrent (JNIEnv *env, jclass clazz, jobject context_handle) { X11Context *context_info = (*env)->GetDirectBufferAddress(env, context_handle); - return context_info->context == _glXGetCurrentContext(); + return context_info->context == lwjgl_glXGetCurrentContext(); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxContextImplementation_nSwapBuffers (JNIEnv *env, jclass clazz, jobject peer_info_handle) { X11PeerInfo *peer_info = (*env)->GetDirectBufferAddress(env, peer_info_handle); - _glXSwapBuffers(peer_info->display, peer_info->drawable); + lwjgl_glXSwapBuffers(peer_info->display, peer_info->drawable); } Index: context.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/context.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- context.c 28 Mar 2005 10:29:16 -0000 1.5 +++ context.c 20 Nov 2005 13:19:39 -0000 1.6 @@ -70,7 +70,7 @@ GLXFBConfig *configs = getFBConfigFromPeerInfo(env, peer_info); if (configs == NULL) return NULL; - vis_info = _glXGetVisualFromFBConfig(peer_info->display, configs[0]); + vis_info = lwjgl_glXGetVisualFromFBConfig(peer_info->display, configs[0]); if (vis_info == NULL) throwException(env, "Could not get VisualInfo from GLX 1.3 config"); XFree(configs); @@ -81,7 +81,7 @@ GLXFBConfig *getFBConfigFromPeerInfo(JNIEnv *env, X11PeerInfo *peer_info) { int attribs[] = {GLX_FBCONFIG_ID, peer_info->config.glx13_config.config_id, None, None}; int num_elements; - GLXFBConfig *configs = _glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements); + GLXFBConfig *configs = lwjgl_glXChooseFBConfig(peer_info->display, peer_info->screen, attribs, &num_elements); if (configs == NULL) { throwException(env, "Could not find GLX 1.3 config from peer info"); return NULL; @@ -147,7 +147,7 @@ } putAttrib(&attrib_list, None); putAttrib(&attrib_list, None); int num_formats = 0; - GLXFBConfig* configs = _glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats); + GLXFBConfig* configs = lwjgl_glXChooseFBConfig(disp, screen, attrib_list.attribs, &num_formats); if (num_formats > 0) { return configs; } else { @@ -208,7 +208,7 @@ putAttrib(&attrib_list, GLX_SAMPLES_ARB); putAttrib(&attrib_list, samples); } putAttrib(&attrib_list, None); - return _glXChooseVisual(disp, screen, attrib_list.attribs); + return lwjgl_glXChooseVisual(disp, screen, attrib_list.attribs); } XVisualInfo *chooseVisualGLX(JNIEnv *env, Display *disp, int screen, jobject pixel_format, bool use_display_bpp, bool double_buffer) { @@ -230,15 +230,15 @@ int alpha, depth, stencil, r, g, b; int sample_buffers = 0; int samples = 0; - _glXGetConfig(display, vis_info, GLX_RED_SIZE, &r); - _glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g); - _glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b); - _glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha); - _glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth); - _glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil); + lwjgl_glXGetConfig(display, vis_info, GLX_RED_SIZE, &r); + lwjgl_glXGetConfig(display, vis_info, GLX_GREEN_SIZE, &g); + lwjgl_glXGetConfig(display, vis_info, GLX_BLUE_SIZE, &b); + lwjgl_glXGetConfig(display, vis_info, GLX_ALPHA_SIZE, &alpha); + lwjgl_glXGetConfig(display, vis_info, GLX_DEPTH_SIZE, &depth); + lwjgl_glXGetConfig(display, vis_info, GLX_STENCIL_SIZE, &stencil); if (extension_flags->GLX_ARB_multisample) { - _glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers); - _glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples); + lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLE_BUFFERS_ARB, &sample_buffers); + lwjgl_glXGetConfig(display, vis_info, GLX_SAMPLES_ARB, &samples); } printfDebugJava(env, "Pixel format info: r = %d, g = %d, b = %d, a = %d, depth = %d, stencil = %d, sample buffers = %d, samples = %d", r, g, b, alpha, depth, stencil, sample_buffers, samples); } @@ -272,14 +272,14 @@ return false; } if (isDebugEnabled()) { - XVisualInfo *vis_info = _glXGetVisualFromFBConfig(display, configs[0]); + XVisualInfo *vis_info = lwjgl_glXGetVisualFromFBConfig(display, configs[0]); if (vis_info != NULL) { dumpVisualInfo(env, display, &extension_flags, vis_info); XFree(vis_info); } } int config_id; - int result = _glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id); + int result = lwjgl_glXGetFBConfigAttrib(display, configs[0], GLX_FBCONFIG_ID, &config_id); XFree(configs); if (result != Success) { throwException(env, "Could not get GLX_FBCONFIG_ID from GLXFBConfig"); Index: org_lwjgl_opengl_Pbuffer.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- org_lwjgl_opengl_Pbuffer.c 4 Jun 2005 21:14:32 -0000 1.16 +++ org_lwjgl_opengl_Pbuffer.c 20 Nov 2005 13:19:39 -0000 1.17 @@ -76,7 +76,7 @@ X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); GLXFBConfig *config = getFBConfigFromPeerInfo(env, peer_info); if (config != NULL) { - GLXPbuffer buffer = _glXCreatePbuffer(peer_info->display, *config, buffer_attribs); + GLXPbuffer buffer = lwjgl_glXCreatePbuffer(peer_info->display, *config, buffer_attribs); XFree(config); peer_info->drawable = buffer; } @@ -85,5 +85,5 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxPbufferPeerInfo_nDestroy (JNIEnv *env, jclass clazz, jobject peer_info_handle) { X11PeerInfo *peer_info = (X11PeerInfo *)(*env)->GetDirectBufferAddress(env, peer_info_handle); - _glXDestroyPbuffer(peer_info->display, peer_info->drawable); + lwjgl_glXDestroyPbuffer(peer_info->display, peer_info->drawable); } Index: extgl_glx.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extgl_glx.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- extgl_glx.h 24 Feb 2005 10:44:34 -0000 1.5 +++ extgl_glx.h 20 Nov 2005 13:19:39 -0000 1.6 @@ -37,7 +37,7 @@ #include "extgl.h" /* - * Names for attributes to _glXGetConfig. + * Names for attributes to lwjgl_glXGetConfig. */ #define GLX_USE_GL 1 /* support GLX rendering */ #define GLX_BUFFER_SIZE 2 /* depth of the color buffer */ @@ -91,7 +91,7 @@ #define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A /* - * Error return values from _glXGetConfig. Success is indicated by + * Error return values from lwjgl_glXGetConfig. Success is indicated by * a value of 0. */ #define GLX_BAD_SCREEN 1 /* screen # is bad */ @@ -106,7 +106,7 @@ /* FBConfig attribute values */ /* - * Generic "don't care" value for _glX ChooseFBConfig attributes (except + * Generic "don't care" value for lwjgl_glX ChooseFBConfig attributes (except * GLX_LEVEL). */ #define GLX_DONT_CARE 0xFFFFFFFF @@ -143,7 +143,7 @@ #define GLX_TRANSPARENT_RGB 0x8008 #define GLX_TRANSPARENT_INDEX 0x8009 -/* _glXCreateGLXPbuffer attributes */ +/* lwjgl_glXCreateGLXPbuffer attributes */ #define GLX_PRESERVED_CONTENTS 0x801B #define GLX_LARGEST_PBUFFER 0x801C #define GLX_PBUFFER_HEIGHT 0x8040 /* New for GLX 1.3 */ @@ -151,7 +151,7 @@ #define GLX_PRESERVED_CONTENTS_SGIX GLX_PRESERVED_CONTENTS #define GLX_LARGEST_PBUFFER_SGIX GLX_LARGEST_PBUFFER -/* _glXQueryGLXPBuffer attributes */ +/* lwjgl_glXQueryGLXPBuffer attributes */ #define GLX_WIDTH 0x801D #define GLX_HEIGHT 0x801E #define GLX_EVENT_MASK 0x801F @@ -159,18 +159,18 @@ #define GLX_HEIGHT_SGIX GLX_HEIGHT #define GLX_EVENT_MASK_SGIX GLX_EVENT_MASK -/* _glXCreateNewContext render_type attribute values */ +/* lwjgl_glXCreateNewContext render_type attribute values */ #define GLX_RGBA_TYPE 0x8014 #define GLX_COLOR_INDEX_TYPE 0x8015 #define GLX_RGBA_TYPE_SGIX GLX_RGBA_TYPE #define GLX_COLOR_INDEX_TYPE_SGIX GLX_COLOR_INDEX_TYPE -/* _glXQueryContext attributes */ +/* lwjgl_glXQueryContext attributes */ /* #define GLX_FBCONFIG_ID 0x8013 */ /* #define GLX_RENDER_TYPE 0x8011 */ #define GLX_SCREEN 0x800C -/* _glXSelectEvent event mask bits */ +/* lwjgl_glXSelectEvent event mask bits */ #define GLX_PBUFFER_CLOBBER_MASK 0x08000000 #define GLX_PBUFFER_CLOBBER_MASK_SGIX GLX_PBUFFER_CLOBBER_MASK @@ -205,8 +205,8 @@ #define GLX_ACCUM_BUFFER_BIT_SGIX GLX_ACCUM_BUFFER_BIT /* - * Extension return values from _glXGetConfig. These are also - * accepted as parameter values for _glXChooseVisual. + * Extension return values from lwjgl_glXGetConfig. These are also + * accepted as parameter values for lwjgl_glXChooseVisual. */ #define GLX_X_VISUAL_TYPE_EXT 0x22 /* visual_info extension type */ @@ -236,14 +236,14 @@ #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D /* - * Names for attributes to _glXGetClientString. + * Names for attributes to lwjgl_glXGetClientString. */ #define GLX_VENDOR 0x1 #define GLX_VERSION 0x2 #define GLX_EXTENSIONS 0x3 /* - * Names for attributes to _glXQueryContextInfoEXT. + * Names for attributes to lwjgl_glXQueryContextInfoEXT. */ #define GLX_SHARE_CONTEXT_EXT 0x800A /* id of share context */ #define GLX_VISUAL_ID_EXT 0x800B /* id of context's visual */ @@ -322,47 +322,47 @@ } GLXExtensions; /* Add _ to global symbols to avoid symbol clash with the OpenGL library */ -extern glXGetFBConfigsPROC _glXGetFBConfigs; -extern glXChooseFBConfigPROC _glXChooseFBConfig; -extern glXGetFBConfigAttribPROC _glXGetFBConfigAttrib; -extern glXGetVisualFromFBConfigPROC _glXGetVisualFromFBConfig; -extern glXCreateWindowPROC _glXCreateWindow; -extern glXDestroyWindowPROC _glXDestroyWindow; -extern glXCreatePixmapPROC _glXCreatePixmap; -extern glXDestroyPixmapPROC _glXDestroyPixmap; -extern glXCreatePbufferPROC _glXCreatePbuffer; -extern glXDestroyPbufferPROC _glXDestroyPbuffer; -extern glXQueryDrawablePROC _glXQueryDrawable; -extern glXCreateNewContextPROC _glXCreateNewContext; -extern glXMakeContextCurrentPROC _glXMakeContextCurrent; -extern glXGetCurrentReadDrawablePROC _glXGetCurrentReadDrawable; -extern glXGetCurrentDisplayPROC _glXGetCurrentDisplay; -extern glXQueryContextPROC _glXQueryContext; -extern glXSelectEventPROC _glXSelectEvent; -extern glXGetSelectedEventPROC _glXGetSelectedEvent; +extern glXGetFBConfigsPROC lwjgl_glXGetFBConfigs; +extern glXChooseFBConfigPROC lwjgl_glXChooseFBConfig; +extern glXGetFBConfigAttribPROC lwjgl_glXGetFBConfigAttrib; +extern glXGetVisualFromFBConfigPROC lwjgl_glXGetVisualFromFBConfig; +extern glXCreateWindowPROC lwjgl_glXCreateWindow; +extern glXDestroyWindowPROC lwjgl_glXDestroyWindow; +extern glXCreatePixmapPROC lwjgl_glXCreatePixmap; +extern glXDestroyPixmapPROC lwjgl_glXDestroyPixmap; +extern glXCreatePbufferPROC lwjgl_glXCreatePbuffer; +extern glXDestroyPbufferPROC lwjgl_glXDestroyPbuffer; +extern glXQueryDrawablePROC lwjgl_glXQueryDrawable; +extern glXCreateNewContextPROC lwjgl_glXCreateNewContext; +extern glXMakeContextCurrentPROC lwjgl_glXMakeContextCurrent; +extern glXGetCurrentReadDrawablePROC lwjgl_glXGetCurrentReadDrawable; +extern glXGetCurrentDisplayPROC lwjgl_glXGetCurrentDisplay; +extern glXQueryContextPROC lwjgl_glXQueryContext; +extern glXSelectEventPROC lwjgl_glXSelectEvent; +extern glXGetSelectedEventPROC lwjgl_glXGetSelectedEvent; -extern glXChooseVisualPROC _glXChooseVisual; -extern glXCopyContextPROC _glXCopyContext; -extern glXCreateContextPROC _glXCreateContext; -extern glXCreateGLXPixmapPROC _glXCreateGLXPixmap; -extern glXDestroyContextPROC _glXDestroyContext; -extern glXDestroyGLXPixmapPROC _glXDestroyGLXPixmap; -extern glXGetConfigPROC _glXGetConfig; -extern glXGetCurrentContextPROC _glXGetCurrentContext; -extern glXGetCurrentDrawablePROC _glXGetCurrentDrawable; -extern glXIsDirectPROC _glXIsDirect; -extern glXMakeCurrentPROC _glXMakeCurrent; -extern glXQueryExtensionPROC _glXQueryExtension; -extern glXQueryVersionPROC _glXQueryVersion; -extern glXSwapBuffersPROC _glXSwapBuffers; -extern glXUseXFontPROC _glXUseXFont; -extern glXWaitGLPROC _glXWaitGL; -extern glXWaitXPROC _glXWaitX; -extern glXGetClientStringPROC _glXGetClientString; -extern glXQueryServerStringPROC _glXQueryServerString; -extern glXQueryExtensionsStringPROC _glXQueryExtensionsString; +extern glXChooseVisualPROC lwjgl_glXChooseVisual; +extern glXCopyContextPROC lwjgl_glXCopyContext; +extern glXCreateContextPROC lwjgl_glXCreateContext; +extern glXCreateGLXPixmapPROC lwjgl_glXCreateGLXPixmap; +extern glXDestroyContextPROC lwjgl_glXDestroyContext; +extern glXDestroyGLXPixmapPROC lwjgl_glXDestroyGLXPixmap; +extern glXGetConfigPROC lwjgl_glXGetConfig; +extern glXGetCurrentContextPROC lwjgl_glXGetCurrentContext; +extern glXGetCurrentDrawablePROC lwjgl_glXGetCurrentDrawable; +extern glXIsDirectPROC lwjgl_glXIsDirect; +extern glXMakeCurrentPROC lwjgl_glXMakeCurrent; +extern glXQueryExtensionPROC lwjgl_glXQueryExtension; +extern glXQueryVersionPROC lwjgl_glXQueryVersion; +extern glXSwapBuffersPROC lwjgl_glXSwapBuffers; +extern glXUseXFontPROC lwjgl_glXUseXFont; +extern glXWaitGLPROC lwjgl_glXWaitGL; +extern glXWaitXPROC lwjgl_glXWaitX; +extern glXGetClientStringPROC lwjgl_glXGetClientString; +extern glXQueryServerStringPROC lwjgl_glXQueryServerString; +extern glXQueryExtensionsStringPROC lwjgl_glXQueryExtensionsString; -extern glXSwapIntervalSGIPROC _glXSwapIntervalSGI; +extern glXSwapIntervalSGIPROC lwjgl_glXSwapIntervalSGI; extern bool extgl_InitGLX(Display *disp, int screen, GLXExtensions *extension_flags); 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.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- org_lwjgl_opengl_Display.c 23 Oct 2005 19:41:09 -0000 1.32 +++ org_lwjgl_opengl_Display.c 20 Nov 2005 13:19:39 -0000 1.33 @@ -331,7 +331,7 @@ static void destroyWindow(JNIEnv *env) { if (glx_window != None) { - _glXDestroyWindow(getDisplay(), glx_window); + lwjgl_glXDestroyWindow(getDisplay(), glx_window); glx_window = None; } XDestroyWindow(getDisplay(), current_win); @@ -518,11 +518,11 @@ return; } if (peer_info->glx13) { - glx_window = _glXCreateWindow(getDisplay(), *fb_config, getCurrentWindow(), NULL); + glx_window = lwjgl_glXCreateWindow(getDisplay(), *fb_config, getCurrentWindow(), NULL); XFree(fb_config); } if (!checkXError(env, getDisplay())) { - _glXDestroyWindow(getDisplay(), glx_window); + lwjgl_glXDestroyWindow(getDisplay(), glx_window); destroyWindow(env); } } |
|
From: Elias N. <eli...@us...> - 2005-11-20 10:08:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16994/src/java/org/lwjgl Modified Files: J2SESysImplementation.java Log Message: Don't ignore exceptions Index: J2SESysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/J2SESysImplementation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- J2SESysImplementation.java 29 Mar 2005 18:09:26 -0000 1.2 +++ J2SESysImplementation.java 20 Nov 2005 10:08:02 -0000 1.3 @@ -51,6 +51,7 @@ try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch(Exception e) { + LWJGLUtil.log("Caught exception while setting LAF: " + e); } JOptionPane.showMessageDialog(null, message, title, JOptionPane.WARNING_MESSAGE); } |
|
From: Elias N. <eli...@us...> - 2005-11-16 09:19:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24392/src/templates/org/lwjgl/openal Modified Files: AL10.java Log Message: OpenAL: Fix the declaration of alGetListenerf and alGetListeneri Index: AL10.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/openal/AL10.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- AL10.java 2 Nov 2005 09:28:11 -0000 1.5 +++ AL10.java 16 Nov 2005 09:19:18 -0000 1.6 @@ -690,7 +690,7 @@ * @param pname name of the attribute to be retrieved * @return int */ - int alGetListeneri(@ALenum int pname); + void alGetListeneri(@ALenum int pname, @Result @ALint int value); /** * Listener state is maintained inside the AL implementation and can be queried in @@ -699,7 +699,7 @@ * @param pname name of the attribute to be retrieved * @return float */ - float alGetListenerf(@ALenum int pname); + void alGetListenerf(@ALenum int pname, @Result float value); /** * Listener state is maintained inside the AL implementation and can be queried in |
|
From: Elias N. <eli...@us...> - 2005-11-16 09:19:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/generated In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24392/src/native/generated Modified Files: org_lwjgl_openal_AL10.c Log Message: OpenAL: Fix the declaration of alGetListenerf and alGetListeneri Index: org_lwjgl_openal_AL10.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/generated/org_lwjgl_openal_AL10.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_openal_AL10.c 2 Nov 2005 09:28:11 -0000 1.3 +++ org_lwjgl_openal_AL10.c 16 Nov 2005 09:19:17 -0000 1.4 @@ -21,8 +21,8 @@ typedef ALvoid (ALAPIENTRY *alListenerfPROC) (ALenum pname, ALfloat value); typedef ALvoid (ALAPIENTRY *alListenerfvPROC) (ALenum pname, const ALfloat * value); typedef ALvoid (ALAPIENTRY *alListener3fPROC) (ALenum pname, ALfloat v1, ALfloat v2, ALfloat v3); -typedef ALint (ALAPIENTRY *alGetListeneriPROC) (ALenum pname); -typedef ALfloat (ALAPIENTRY *alGetListenerfPROC) (ALenum pname); +typedef void (ALAPIENTRY *alGetListeneriPROC) (ALenum pname, ALint* value); +typedef void (ALAPIENTRY *alGetListenerfPROC) (ALenum pname, ALfloat* value); typedef ALvoid (ALAPIENTRY *alGetListenerfvPROC) (ALenum pname, ALfloat * floatdata); typedef ALvoid (ALAPIENTRY *alGenSourcesPROC) (ALsizei n, ALuint * sources); typedef ALvoid (ALAPIENTRY *alDeleteSourcesPROC) (ALsizei n, ALuint * sources); @@ -195,12 +195,14 @@ } static jint JNICALL Java_org_lwjgl_openal_AL10_nalGetListeneri(JNIEnv *env, jclass clazz, jint pname) { - ALint __result = alGetListeneri(pname); + ALint __result; + alGetListeneri(pname, &__result); return __result; } static jfloat JNICALL Java_org_lwjgl_openal_AL10_nalGetListenerf(JNIEnv *env, jclass clazz, jint pname) { - ALfloat __result = alGetListenerf(pname); + ALfloat __result; + alGetListenerf(pname, &__result); return __result; } |
|
From: Kevin G. <kev...@us...> - 2005-11-15 22:31:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16304/src/java/org/lwjgl/input Modified Files: Controllers.java Log Message: Removed the use of "jinput.plugins" system property since it doesn't appear to be needed any more and causes double detection of controllers. Index: Controllers.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Controllers.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Controllers.java 29 Jun 2005 20:47:18 -0000 1.2 +++ Controllers.java 15 Nov 2005 22:31:49 -0000 1.3 @@ -12,13 +12,6 @@ * @author Kevin Glass */ public class Controllers { - /** The name of the plugin used on windows */ - private static final String WINDOWS_PLUGIN = "net.java.games.input.DirectInputEnvironmentPlugin"; - /** The name of the plugin used on linux */ - private static final String LINUX_PLUGIN = "net.java.games.input.LinuxEnvironmentPlugin"; - /** The name of the plugin used on macos */ - private static final String MACOS_PLUGIN = "net.java.games.input.OSXEnvironmentPlugin"; - /** The controllers available */ private static ArrayList controllers = new ArrayList(); /** The number of controllers */ @@ -42,20 +35,6 @@ return; try { - String plugins = System.getProperty("jinput.plugins"); - - if (plugins == null) { - if (System.getProperty("os.name").startsWith("Win")) { - System.setProperty("jinput.plugins",WINDOWS_PLUGIN); - } - if (System.getProperty("os.name").startsWith("Lin")) { - System.setProperty("jinput.plugins",LINUX_PLUGIN); - } - if (System.getProperty("os.name").startsWith("Mac")) { - System.setProperty("jinput.plugins",MACOS_PLUGIN); - } - } - ControllerEnvironment env = ControllerEnvironment.getDefaultEnvironment(); net.java.games.input.Controller[] found = env.getControllers(); |
|
From: Brian M. <ma...@us...> - 2005-11-10 21:57:21
|
Update of /cvsroot/java-game-lib/LWJGL/www In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv366 Modified Files: donations.php Log Message: fix .com => .net Index: donations.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/donations.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- donations.php 10 Nov 2005 21:16:27 -0000 1.1 +++ donations.php 10 Nov 2005 21:57:11 -0000 1.2 @@ -22,7 +22,7 @@ $donations[] = array("Apostolos Tsakpinis [zdimensions.gr]", "http://www.zdimensions.gr/"); $donations[] = array("Scott Palmer", ""); $donations[] = array("Chris Heimpel", ""); - $donations[] = array("Caspian Rychlik-Prince [puppygames.com]", "http://puppygames.net/"); + $donations[] = array("Caspian Rychlik-Prince [puppygames.net]", "http://puppygames.net/"); $donations[] = array("Christiaan Ghijselinck", ""); $donations[] = array("David Hope", ""); $donations[] = array("Ruben Steins", ""); |
|
From: Brian M. <ma...@us...> - 2005-11-10 21:16:59
|
Update of /cvsroot/java-game-lib/LWJGL/www/_include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23428 Modified Files: header.php Log Message: added donations page Index: header.php =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/www/_include/header.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- header.php 10 Sep 2005 23:01:00 -0000 1.6 +++ header.php 10 Nov 2005 21:16:49 -0000 1.7 @@ -36,6 +36,7 @@ <p> <a href="index.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'index.php') !== false) ? ' class="activeItem"' : '');?>>Home</a><br/> <a href="about.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'about.php') !== false) ? ' class="activeItem"' : '');?>>About</a><br/> + <a href="donations.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'donations.php') !== false) ? ' class="activeItem"' : '');?>>Donations</a><br/> <a href="download.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'download.php') !== false) ? ' class="activeItem"' : '');?>>Download</a><br/> <a href="installation.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'installation.php') !== false) ? ' class="activeItem"' : '');?>>Installation</a><br/> <a href="documentation.php"<?=((strpos($_SERVER['SCRIPT_NAME'], 'documentation.php') !== false || strpos($_SERVER['SCRIPT_NAME'], 'documentation_') !== false) ? ' class="activeItem"' : '');?>>Documentation</a><br/> @@ -62,7 +63,19 @@ <a href="http://irc-stats.lwjgl.org" target="_blank">IRC Stats</a><br/> </p> <p> - <br/><a href="http://www.opengl.org" target="_blank"><img src="_gfx/button_opengl.png" alt="OpenGL" border="0"></a><br/><br/> + <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> +<input type="hidden" name="cmd" value="_xclick"> +<input type="hidden" name="business" value="br...@ma..."> +<input type="hidden" name="item_name" value="LWJGL Donation"> +<input type="hidden" name="no_shipping" value="1"> +<input type="hidden" name="no_note" value="1"> +<input type="hidden" name="currency_code" value="USD"> +<input type="hidden" name="tax" value="0"> +<input type="hidden" name="bn" value="PP-DonationsBF"> +<input type="image" src="_gfx/paypal.png" border="0" name="submit" alt="Donate to LWJGL" title="Donate to LWJGL"> +</form> <br/> + + <a href="http://www.opengl.org" target="_blank"><img src="_gfx/button_opengl.png" alt="OpenGL" border="0"></a><br/><br/> <a href="http://www.openal.org" target="_blank"><img src="_gfx/button_openal.png" alt="OpenAL" border="0"></a><br/><br/> <a href="http://java.net" target="_blank"><img src="_gfx/button_javanet.png" alt="java.net" border="0"></a><br/><br/> <a href="http://sourceforge.net" target="_blank"><img src="_gfx/button_sourceforge.png" alt="SourceForge.net" border="0"></a><br/><br/> |