You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
(3) |
3
(7) |
|
4
(4) |
5
|
6
|
7
(1) |
8
(1) |
9
(6) |
10
(8) |
|
11
(1) |
12
|
13
|
14
|
15
|
16
(5) |
17
(2) |
|
18
|
19
(4) |
20
(16) |
21
|
22
|
23
(2) |
24
|
|
25
|
26
(2) |
27
(5) |
28
|
29
|
30
(3) |
31
|
|
From: Elias N. <eli...@us...> - 2003-05-30 16:46:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv27957/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Added USEGLX13 to BaseGL.cpp Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_opengl_BaseGL.cpp 30 May 2003 06:10:33 -0000 1.18 +++ org_lwjgl_opengl_BaseGL.cpp 30 May 2003 16:29:17 -0000 1.19 @@ -43,18 +43,20 @@ #include "Window.h" #include "org_lwjgl_opengl_BaseGL.h" +#define USEGLX13 true + static GLXContext context = NULL; // OpenGL rendering context static GLXWindow glx_window; void makeCurrent(void) { - if (extgl_Extensions.glx.GLX13) + if (USEGLX13 && extgl_Extensions.glx.GLX13) glXMakeContextCurrent(getCurrentDisplay(), glx_window, glx_window, context); else glXMakeCurrent(getCurrentDisplay(), getCurrentWindow(), context); } static void releaseContext(void) { - if (extgl_Extensions.glx.GLX13) + if (USEGLX13 && extgl_Extensions.glx.GLX13) glXMakeContextCurrent(getCurrentDisplay(), None, None, NULL); else glXMakeCurrent(getCurrentDisplay(), None, NULL); @@ -128,7 +130,7 @@ static void destroy(void) { releaseContext(); - if (extgl_Extensions.glx.GLX13) + if (USEGLX13 && extgl_Extensions.glx.GLX13) glXDestroyWindow(getCurrentDisplay(), glx_window); glXDestroyContext(getCurrentDisplay(), context); context = NULL; @@ -232,7 +234,7 @@ return; } bool create_success; - if (extgl_Extensions.glx.GLX13) { + if (USEGLX13 && extgl_Extensions.glx.GLX13) { create_success = initWindowGLX13(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, fscreen); } else { create_success = initWindowGLX(env, disp, screen, title, x, y, width, height, bpp, depth, alpha, stencil, fscreen); @@ -282,7 +284,7 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers(JNIEnv * env, jobject obj) { - if (extgl_Extensions.glx.GLX13) + if (USEGLX13 && extgl_Extensions.glx.GLX13) glXSwapBuffers(getCurrentDisplay(), glx_window); else glXSwapBuffers(getCurrentDisplay(), getCurrentWindow()); |
|
From: Elias N. <eli...@us...> - 2003-05-30 14:44:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv7729/linux Modified Files: org_lwjgl_Display.cpp Log Message: More Display checks Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- org_lwjgl_Display.cpp 27 May 2003 14:12:10 -0000 1.34 +++ org_lwjgl_Display.cpp 30 May 2003 14:44:45 -0000 1.35 @@ -68,7 +68,12 @@ #endif return false; } - XF86VidModeQueryVersion(disp, major, minor); + if (!XF86VidModeQueryVersion(disp, major, minor)) { +#ifdef _DEBUG + printf("Could not determine XF86VidMode version\n"); +#endif + return false; + } #ifdef _DEBUG printf("XF86VidMode extension version %i.%i\n", major, minor); #endif |
|
From: Elias N. <eli...@us...> - 2003-05-30 06:10:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv25084/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Extra checks in window creation Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- org_lwjgl_opengl_BaseGL.cpp 20 May 2003 12:20:12 -0000 1.17 +++ org_lwjgl_opengl_BaseGL.cpp 30 May 2003 06:10:33 -0000 1.18 @@ -90,8 +90,15 @@ GLX_ALPHA_SIZE, alpha, GLX_STENCIL_SIZE, stencil, None}; - int num_formats; - return glXChooseFBConfig(disp, screen, attriblist, &num_formats); + int num_formats = 0; + GLXFBConfig* configs = glXChooseFBConfig(disp, screen, attriblist, &num_formats); + if (num_formats > 0) + return configs; + else { + if (configs != NULL) + XFree(configs); + return NULL; + } } static XVisualInfo *chooseVisual(Display *disp, int screen, int bpp, int depth, int alpha, int stencil) { @@ -150,6 +157,12 @@ return false; } XVisualInfo * vis_info = glXGetVisualFromFBConfig(disp, configs[0]); + if (vis_info == NULL) { + glXDestroyContext(disp, context); + XFree(configs); + throwException(env, "Could not create visual info from FB config"); + return false; + } #ifdef _DEBUG dumpVisualInfo(disp, vis_info); #endif |
|
From: Elias N. <eli...@us...> - 2003-05-27 14:12:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv14635/src/native/win32 Modified Files: org_lwjgl_Display.cpp Log Message: Implemented gamma, brightness and contrast controls on win32 and linux using a simplified gamma ramp API Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- org_lwjgl_Display.cpp 14 Apr 2003 18:17:29 -0000 1.38 +++ org_lwjgl_Display.cpp 27 May 2003 14:12:10 -0000 1.39 @@ -39,7 +39,7 @@ * @version $Revision$ */ -#include "Window.h" +#include "Window.h" #include "org_lwjgl_Display.h" #define WINDOWCLASSNAME "LWJGLWINDOW" @@ -272,7 +272,11 @@ // Return device gamma to normal HDC screenDC = GetDC(NULL); - SetDeviceGammaRamp(screenDC, originalGamma); + if (!SetDeviceGammaRamp(screenDC, originalGamma)) { +#ifdef _DEBUG + printf("Could not reset device gamma\n"); +#endif + } ReleaseDC(NULL, screenDC); if (modeSet) { @@ -283,116 +287,36 @@ // And we'll call init() again to put the correct mode back in Display Java_org_lwjgl_Display_init(env, clazz); } -} - -/* - * Class: org_lwjgl_Display - * Method: getGammaRamp - * Signature: ()[I - */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_getGammaRamp - (JNIEnv * env, jclass clazz, jintArray red, jintArray green, jintArray blue) -{ -#ifdef _DEBUG - if (red == NULL) { - throwRuntimeException(env, "Null red array."); - return JNI_FALSE; - } - if (green == NULL) { - throwRuntimeException(env, "Null green array."); - return JNI_FALSE; - } - if (blue == NULL) { - throwRuntimeException(env, "Null blue array."); - return JNI_FALSE; - } - if (env->GetArrayLength(red) != 256) { - throwRuntimeException(env, "Red array is not 256 long."); - return JNI_FALSE; - } - if (env->GetArrayLength(green) != 256) { - throwRuntimeException(env, "Green array is not 256 long."); - return JNI_FALSE; - } - if (env->GetArrayLength(blue) != 256) { - throwRuntimeException(env, "Blue array is not 256 long."); - return JNI_FALSE; - } -#endif - - jint * redPtr = env->GetIntArrayElements(red, NULL); - jint * greenPtr = env->GetIntArrayElements(green, NULL); - jint * bluePtr = env->GetIntArrayElements(blue, NULL); - - WORD currentGamma[768]; - HDC screenDC = GetDC(NULL); - if (GetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { -#ifdef _DEBUG - printf("Failed to get device gamma\n"); -#endif - env->ReleaseIntArrayElements(red, redPtr, JNI_ABORT); - env->ReleaseIntArrayElements(green, greenPtr, JNI_ABORT); - env->ReleaseIntArrayElements(blue, bluePtr, JNI_ABORT); - ReleaseDC(NULL, screenDC); - return JNI_FALSE; - } - ReleaseDC(NULL, screenDC); - for (int i = 0; i < 256; i ++) { - redPtr[i] = (jint) currentGamma[i]; - greenPtr[i] = (jint) currentGamma[i + 256]; - bluePtr[i] = (jint) currentGamma[i + 512]; - } - env->ReleaseIntArrayElements(red, redPtr, 0); - env->ReleaseIntArrayElements(green, greenPtr, 0); - env->ReleaseIntArrayElements(blue, bluePtr, 0); - return JNI_TRUE; -} +} + +/* + * Class: org_lwjgl_Display + * Method: getGammaRampLength + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_Display_getGammaRampLength + (JNIEnv *env, jclass clazz) +{ + return 256; +} /* * Class: org_lwjgl_Display * Method: setGammaRamp - * Signature: ([I[I[I)V + * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp - (JNIEnv * env, jclass clazz, jintArray red, jintArray green, jintArray blue) -{ -#ifdef _DEBUG - if (red == NULL) { - throwRuntimeException(env, "Null red array."); - return JNI_FALSE; - } - if (green == NULL) { - throwRuntimeException(env, "Null green array."); - return JNI_FALSE; - } - if (blue == NULL) { - throwRuntimeException(env, "Null blue array."); - return JNI_FALSE; - } - if (env->GetArrayLength(red) != 256) { - throwRuntimeException(env, "Red array is not 256 long."); - return JNI_FALSE; - } - if (env->GetArrayLength(green) != 256) { - throwRuntimeException(env, "Green array is not 256 long."); - return JNI_FALSE; - } - if (env->GetArrayLength(blue) != 256) { - throwRuntimeException(env, "Blue array is not 256 long."); - return JNI_FALSE; - } -#endif - - jint * redPtr = env->GetIntArrayElements(red, NULL); - jint * greenPtr = env->GetIntArrayElements(green, NULL); - jint * bluePtr = env->GetIntArrayElements(blue, NULL); - - // Turn array of ints into array of RGB WORDs + (JNIEnv * env, jclass clazz, jint gammaRampAddress) +{ + float *gammaRamp = (float *)gammaRampAddress; + // Turn array of floats into array of RGB WORDs WORD newGamma[768]; - for (int i = 0; i < 256; i ++) { - newGamma[i] = (WORD)(min(0x00010000, redPtr[i])); - newGamma[i + 256] = (WORD)(min(0x00010000, greenPtr[i])); - newGamma[i + 512] = (WORD)(min(0x00010000, bluePtr[i])); + for (int i = 0; i < 256; i ++) { + float scaledRampEntry = gammaRamp[i]*0xffff; + WORD rampEntry = (WORD)scaledRampEntry; + newGamma[i] = rampEntry; + newGamma[i + 256] = rampEntry; + newGamma[i + 512] = rampEntry; } jboolean ret; HDC screenDC = GetDC(NULL); @@ -405,10 +329,6 @@ ret = JNI_TRUE; } ReleaseDC(NULL, screenDC); - - env->ReleaseIntArrayElements(red, redPtr, JNI_ABORT); - env->ReleaseIntArrayElements(green, greenPtr, JNI_ABORT); - env->ReleaseIntArrayElements(blue, bluePtr, JNI_ABORT); return ret; } |
|
From: Elias N. <eli...@us...> - 2003-05-27 14:12:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv14635/src/java/org/lwjgl Modified Files: Display.java Log Message: Implemented gamma, brightness and contrast controls on win32 and linux using a simplified gamma ramp API Index: Display.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Display.java 26 May 2003 18:29:44 -0000 1.27 +++ Display.java 27 May 2003 14:12:10 -0000 1.28 @@ -34,6 +34,9 @@ import java.util.HashSet; import java.util.Arrays; +import java.nio.ByteBuffer; +import java.nio.FloatBuffer; +import java.nio.ByteOrder; /** * $Id$ @@ -201,34 +204,51 @@ public static native int getPlatform(); /** - * Obtains the display's gamma ramp. The gamma ramp returned is an array of - * 16:16 fixed point values representing 0.0...1.0. The gamma ramp consists of three - * arrays, one for red, one for green, and one for blue. The array lengths must be 256. - * - * If gamma is not supported by the underlying hardware then false is returned. - * - * @param red An array of ints to store red gamma in. Must be 256 in length. - * @param green An array of ints to store green gamma in. Must be 256 in length. - * @param blue An array of ints to store blue gamma in. Must be 256 in length. - * @return true if it succeeds, false if it fails + * Set the display configuration to the specified gamma, brightness and contrast. + * The configuration changes will be reset when resetDisplayMode is called. + * + * @param gamma The gamma value + * @param brightness The brightness value between -1.0 and 1.0, inclusive + * @param contrast The contrast, larger than 0.0. + * @return true if the call succeeded, false otherwise */ - public static native boolean getGammaRamp(int[] red, int[] green, int[] blue); - + public static boolean setDisplayConfiguration(float gamma, float brightness, float contrast) { + assert brightness >= -1.0f && brightness <= 1.0f; + assert contrast >= 0.0f; + int rampSize = getGammaRampLength(); + if (rampSize == 0) + return false; + FloatBuffer gammaRamp = ByteBuffer.allocateDirect(rampSize*4).order(ByteOrder.nativeOrder()).asFloatBuffer(); + for (int i = 0; i < rampSize; i++) { + float intensity = (float)i/(rampSize - 1); + // apply gamma + float rampEntry = (float)java.lang.Math.pow(intensity, gamma); + // apply brightness + rampEntry += brightness; + // apply contrast + rampEntry = (rampEntry - 0.5f)*contrast + 0.5f; + // Clamp entry to [0, 1] + if (rampEntry > 1.0f) + rampEntry = 1.0f; + else if (rampEntry < 0.0f) + rampEntry = 0.0f; + gammaRamp.put(i, rampEntry); + } + if (!setGammaRamp(Sys.getDirectBufferAddress(gammaRamp))) + return false; + return true; + } + /** - * Sets the display's gamma ramp. The gamma ramp should be an array of ints - * in 16:16 fixed point format, arranged as for getGammaRamp(). - * The length of the arrays must be 256. - * - * If the underlying hardware does not support gamma then this command is a no-op. - * - * When resetDisplaMode is called, any gamma changes are automatically undone. + * Return the length of the gamma ramp arrays. Returns 0 if gamma settings are + * unsupported. * - * @param red An array of ints to store red gamma in. Must be 256 in length. - * @param green An array of ints to store green gamma in. Must be 256 in length. - * @param blue An array of ints to store blue gamma in. Must be 256 in length. - * - * @return true if it succeeds, false if it fails + * @return the length of each gamma ramp array, or 0 if gamma settings are unsupported. */ - public static native boolean setGammaRamp(int[] red, int[] green, int[] blue); + private static native int getGammaRampLength(); + /** + * Native method to set the gamma ramp. + */ + private static native boolean setGammaRamp(int gammaRampAddress); } |
|
From: Elias N. <eli...@us...> - 2003-05-27 14:12:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv14635/src/native/common Modified Files: org_lwjgl_Display.h Log Message: Implemented gamma, brightness and contrast controls on win32 and linux using a simplified gamma ramp API Index: org_lwjgl_Display.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Display.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_Display.h 29 Mar 2003 21:52:00 -0000 1.11 +++ org_lwjgl_Display.h 27 May 2003 14:12:10 -0000 1.12 @@ -18,7 +18,7 @@ #define org_lwjgl_Display_PLATFORM_GLX 1L #undef org_lwjgl_Display_PLATFORM_AGL #define org_lwjgl_Display_PLATFORM_AGL 2L -/* Inaccessible static: class_000240 */ +/* Inaccessible static: class_00024org_00024lwjgl_00024Display */ /* * Class: org_lwjgl_Display * Method: init @@ -61,19 +61,19 @@ /* * Class: org_lwjgl_Display - * Method: getGammaRamp - * Signature: ([I[I[I)Z + * Method: getGammaRampLength + * Signature: ()I */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_getGammaRamp - (JNIEnv *, jclass, jintArray, jintArray, jintArray); +JNIEXPORT jint JNICALL Java_org_lwjgl_Display_getGammaRampLength + (JNIEnv *, jclass); /* * Class: org_lwjgl_Display * Method: setGammaRamp - * Signature: ([I[I[I)Z + * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp - (JNIEnv *, jclass, jintArray, jintArray, jintArray); + (JNIEnv *, jclass, jint); #ifdef __cplusplus } |
|
From: Elias N. <eli...@us...> - 2003-05-27 14:12:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv14635/src/java/org/lwjgl/test Added Files: DisplayConfigurationTest.java Log Message: Implemented gamma, brightness and contrast controls on win32 and linux using a simplified gamma ramp API --- NEW FILE: DisplayConfigurationTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/DisplayConfigurationTest.java /* * Created on 18-03-2003 * * To change this generated comment go to * Window>Preferences>Java>Code Generation>Code Template */ package org.lwjgl.test; import org.lwjgl.*; import org.lwjgl.opengl.GL; /** * @author Elias Naur */ public class DisplayConfigurationTest { private static void changeConfig(float gamma, float brightness, float contrast) { Display.setDisplayConfiguration(gamma, brightness, contrast); System.out.println("Configuration changed, gamma = " + gamma + " brightness = " + brightness + " contrast = " + contrast); try { Thread.sleep(3000); } catch (Exception e) { e.printStackTrace(); } } public static void main(String[] args) { System.out.println("Testing normal setting"); changeConfig(1.0f, 0f, 1f); System.out.println("Testing gamma settings"); changeConfig(5.0f, 0f, 1f); changeConfig(0.5f, 0f, 1f); System.out.println("Testing brightness settings"); changeConfig(1.0f, -1.0f, 1f); changeConfig(1.0f, -0.5f, 1f); changeConfig(1.0f, 0.5f, 1f); changeConfig(1.0f, 1.0f, 1f); System.out.println("Testing contrast settings"); changeConfig(1.0f, 0f, 0f); changeConfig(1.0f, 0f, 0.5f); changeConfig(1.0f, 0f, 10000.0f); System.out.println("Test done - Resetting configuration"); Display.resetDisplayMode(); } } |
|
From: Elias N. <eli...@us...> - 2003-05-27 14:12:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv14635/src/native/linux Modified Files: org_lwjgl_Display.cpp Log Message: Implemented gamma, brightness and contrast controls on win32 and linux using a simplified gamma ramp API Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- org_lwjgl_Display.cpp 7 Apr 2003 17:04:23 -0000 1.33 +++ org_lwjgl_Display.cpp 27 May 2003 14:12:10 -0000 1.34 @@ -48,44 +48,45 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> +#include <math.h> #include <jni.h> #include "org_lwjgl_Display.h" static int saved_width; static int saved_height; +static int gamma_ramp_length = 0; +static unsigned short *r_ramp; +static unsigned short *g_ramp; +static unsigned short *b_ramp; -static int getDisplayModes(Display *disp, int screen, int *num_modes, XF86VidModeModeInfo ***avail_modes) { - int event_base, error_base, xvid_ver, xvid_rev; +static bool getVidModeExtensionVersion(Display *disp, int screen, int *major, int *minor) { + int event_base, error_base; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { #ifdef _DEBUG printf("XF86VidMode extension not available\n"); #endif - return 0; + return false; } - XF86VidModeQueryVersion(disp, &xvid_ver, &xvid_rev); + XF86VidModeQueryVersion(disp, major, minor); #ifdef _DEBUG - printf("XF86VidMode extension version %i.%i\n", xvid_ver, xvid_rev); + printf("XF86VidMode extension version %i.%i\n", major, minor); #endif + return true; +} + +static bool getDisplayModes(Display *disp, int screen, int *num_modes, XF86VidModeModeInfo ***avail_modes) { + int minor_ver, major_ver; + if (!getVidModeExtensionVersion(disp, screen, &major_ver, &minor_ver)) + return false; XF86VidModeGetAllModeLines(disp, screen, num_modes, avail_modes); - return 1; + return true; } -static bool setMode(int width, int height, bool lock_mode) { +static bool setMode(Display *disp, int screen, int width, int height, bool lock_mode) { int num_modes, i; XF86VidModeModeInfo **avail_modes; - int screen; - Display *disp = XOpenDisplay(NULL); - - if (disp == NULL) { -#ifdef _DEBUG - printf("Could not open X connection\n"); -#endif - return false; - } - screen = DefaultScreen(disp); if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { - XCloseDisplay(disp); #ifdef _DEBUG printf("Could not get display modes\n"); #endif @@ -107,15 +108,40 @@ if (lock_mode) XF86VidModeLockModeSwitch(disp, screen, 1); XFree(avail_modes); - XCloseDisplay(disp); return true; } } XFree(avail_modes); - XCloseDisplay(disp); return false; } +static void freeSavedGammaRamps() { + free(r_ramp); + free(g_ramp); + free(b_ramp); + r_ramp = NULL; + g_ramp = NULL; + b_ramp = NULL; + gamma_ramp_length = 0; +} + +static int getGammaRampLength(Display *disp, int screen) { + int minor_ver, major_ver, ramp_size; + if (!getVidModeExtensionVersion(disp, screen, &major_ver, &minor_ver) || major_ver < 2) { +#ifdef _DEBUG + printf("XF86VidMode extension version >= 2 not found\n"); +#endif + return 0; + } + if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { +#ifdef _DEBUG + printf("XF86VidModeGetGammaRampSize call failed\n"); +#endif + return 0; + } + return ramp_size; +} + JNIEXPORT void JNICALL Java_org_lwjgl_Display_init (JNIEnv * env, jclass clazz) { @@ -149,6 +175,16 @@ env->SetStaticObjectField(clazz, fid_initialMode, newMode); XFree(avail_modes); + + /* Fetch the current gamma ramp */ + gamma_ramp_length = getGammaRampLength(disp, screen); + if (gamma_ramp_length > 0) { + r_ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); + g_ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); + b_ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); + if (!XF86VidModeGetGammaRamp(disp, screen, gamma_ramp_length, r_ramp, g_ramp, b_ramp)) + freeSavedGammaRamps(); + } XCloseDisplay(disp); } @@ -158,14 +194,40 @@ jfieldID fid_height = env->GetFieldID(cls_displayMode, "height", "I"); int width = env->GetIntField(mode, fid_width); int height = env->GetIntField(mode, fid_height); - if (setMode(width, height, true)) { + int screen; + Display *disp = XOpenDisplay(NULL); + + if (disp == NULL) { +#ifdef _DEBUG + printf("Could not open X connection\n"); +#endif + return; + } + screen = DefaultScreen(disp); + if (setMode(disp, screen, width, height, true)) { jfieldID fid_initialMode = env->GetStaticFieldID(clazz, "mode", "Lorg/lwjgl/DisplayMode;"); env->SetStaticObjectField(clazz, fid_initialMode, mode); } + XCloseDisplay(disp); } JNIEXPORT void JNICALL Java_org_lwjgl_Display_resetDisplayMode(JNIEnv * env, jclass clazz) { - setMode(saved_width, saved_height, false); + int screen; + Display *disp = XOpenDisplay(NULL); + + if (disp == NULL) { +#ifdef _DEBUG + printf("Could not open X connection\n"); +#endif + return; + } + screen = DefaultScreen(disp); + setMode(disp, screen, saved_width, saved_height, false); + if (gamma_ramp_length > 0) { + XF86VidModeSetGammaRamp(disp, screen, gamma_ramp_length, r_ramp, g_ramp, b_ramp); + freeSavedGammaRamps(); + } + XCloseDisplay(disp); } /* @@ -225,22 +287,48 @@ /* * Class: org_lwjgl_Display - * Method: getGammaRamp - * Signature: ()[I + * Method: getGammaRampLength + * Signature: ()I */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_getGammaRamp - (JNIEnv * env, jclass clazz, jintArray red, jintArray green, jintArray blue) +JNIEXPORT jint JNICALL Java_org_lwjgl_Display_getGammaRampLength + (JNIEnv *env, jclass clazz) { - return false; + return gamma_ramp_length; } /* * Class: org_lwjgl_Display * Method: setGammaRamp - * Signature: ([I[I[I)V + * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_setGammaRamp - (JNIEnv * env, jclass clazz, jintArray red, jintArray green, jintArray blue) + (JNIEnv *env, jclass clazz, jint gamma_ramp_address) { - return false; + if (gamma_ramp_length == 0) + return JNI_FALSE; + Display * disp = XOpenDisplay(NULL); + if (disp == NULL) { +#ifdef _DEBUG + printf("Could not open X connection\n"); +#endif + return JNI_FALSE; + } + int screen = DefaultScreen(disp); + float *gamma_ramp = (float *)gamma_ramp_address; + unsigned short *ramp; + ramp = (unsigned short *)malloc(sizeof(unsigned short)*gamma_ramp_length); + for (int i = 0; i < gamma_ramp_length; i++) { + float scaled_gamma = gamma_ramp[i]*0xffff; + ramp[i] = (unsigned short)round(scaled_gamma); + } + if (XF86VidModeSetGammaRamp(disp, screen, gamma_ramp_length, ramp, ramp, ramp) == False) { +#ifdef _DEBUG + printf("Could not set gamma ramp\n"); +#endif + XCloseDisplay(disp); + return JNI_FALSE; + } + XCloseDisplay(disp); + return JNI_TRUE; } + |
|
From: Elias N. <eli...@us...> - 2003-05-26 18:29:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv21297/src/java/org/lwjgl Modified Files: Display.java Log Message: Doc fix: gamma arrays are three arrays, not one consecutive Index: Display.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Display.java 26 May 2003 18:26:10 -0000 1.26 +++ Display.java 26 May 2003 18:29:44 -0000 1.27 @@ -202,9 +202,8 @@ /** * Obtains the display's gamma ramp. The gamma ramp returned is an array of - * 16:16 fixed point values representing 0.0...1.0. The gamma ramp consists of three consecutive - * arrays, one for red, one for green, and one for blue. The length of the - * array is 768 values (so red will be 0..255, green 256...511, and blue 512..767) + * 16:16 fixed point values representing 0.0...1.0. The gamma ramp consists of three + * arrays, one for red, one for green, and one for blue. The array lengths must be 256. * * If gamma is not supported by the underlying hardware then false is returned. * @@ -218,7 +217,7 @@ /** * Sets the display's gamma ramp. The gamma ramp should be an array of ints * in 16:16 fixed point format, arranged as for getGammaRamp(). - * The length of the array must be 768. + * The length of the arrays must be 256. * * If the underlying hardware does not support gamma then this command is a no-op. * |
|
From: Elias N. <eli...@us...> - 2003-05-26 18:26:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv19537/src/java/org/lwjgl Modified Files: Display.java Log Message: Doc fix: Gamma changes are undone at resetDisplayMode Index: Display.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Display.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Display.java 3 May 2003 21:20:22 -0000 1.25 +++ Display.java 26 May 2003 18:26:10 -0000 1.26 @@ -222,7 +222,7 @@ * * If the underlying hardware does not support gamma then this command is a no-op. * - * When LWJGL exits, any gamma changes are automatically undone. + * When resetDisplaMode is called, any gamma changes are automatically undone. * * @param red An array of ints to store red gamma in. Must be 256 in length. * @param green An array of ints to store green gamma in. Must be 256 in length. |
|
From: Scott W P. <cfx...@us...> - 2003-05-23 04:21:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv25355/macosx Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: oops missed double buffer attribute Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_opengl_BaseGL.cpp 20 May 2003 13:48:44 -0000 1.11 +++ org_lwjgl_opengl_BaseGL.cpp 23 May 2003 04:21:09 -0000 1.12 @@ -87,6 +87,7 @@ CGLPixelFormatAttribute attribs[] = { kCGLPFAFullScreen, + kCGLPFADoubleBuffer, kCGLPFADisplayMask, displayMask, NULL |
|
From: Scott W P. <cfx...@us...> - 2003-05-23 03:07:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv23262/macosx Modified Files: org_lwjgl_Display.cpp Log Message: fixed sporadic Bus Error in GetAvailableDisplayModes Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_Display.cpp 20 May 2003 13:51:46 -0000 1.14 +++ org_lwjgl_Display.cpp 23 May 2003 03:07:46 -0000 1.15 @@ -79,7 +79,8 @@ jobjectArray GetAvailableDisplayModesOSX(JNIEnv * env) { - CFIndex i, count, availableModes; + CFIndex i, count; + CFIndex availableModes = 0; CFArrayRef displayModes = NULL; int n = 0; @@ -105,7 +106,7 @@ jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); jobjectArray ret = env->NewObjectArray( availableModes, displayModeClass, NULL); jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V"); - + for ( i = 0; i < count; i++ ) { CFDictionaryRef modeDict = static_cast<CFDictionaryRef>( CFArrayGetValueAtIndex( displayModes, i ) ); |
|
From: Elias N. <eli...@us...> - 2003-05-20 14:28:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv26408/linux Modified Files: extxcursor.cpp Log Message: Native cursor fixes Index: extxcursor.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- extxcursor.cpp 20 May 2003 13:59:30 -0000 1.3 +++ extxcursor.cpp 20 May 2003 14:28:30 -0000 1.4 @@ -39,7 +39,9 @@ load_success = false; xcursor_handle = dlopen(xcursor_lib_name, RTLD_GLOBAL | RTLD_LAZY); if (xcursor_handle == NULL) { +#ifdef _DEBUG printf("Could not load %s: %s\n", xcursor_lib_name, dlerror()); +#endif return load_success; } loadFunctionPointers(); |
|
From: Scott W P. <cfx...@us...> - 2003-05-20 14:00:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv12046/macosx Added Files: org_lwjgl_Window.cpp Log Message: Stubs for OS X --- NEW FILE: org_lwjgl_Window.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Window.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_Window.cpp,v 1.1 2003/05/20 14:00:18 cfxmarvin Exp $ * * Mac OS X specific window functions. * * @author Scott Palmer <cfx...@us...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_Window.h" JNIEXPORT void JNICALL Java_org_lwjgl_Window_nSetTitle (JNIEnv * env, jobject obj, jstring title_obj) { const char * title = env->GetStringUTFChars(title_obj, NULL); //setWindowTitle(title); env->ReleaseStringUTFChars(title_obj, title); } /* * Class: org_lwjgl_Window * Method: tick * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_Window_tick (JNIEnv *env, jobject obj) { //handleMessages(env, obj); } |
|
From: Scott W P. <cfx...@us...> - 2003-05-20 14:00:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv11788/common Modified Files: org_lwjgl_openal_eax_EAXListenerProperties.cpp Log Message: minor cleanup Index: org_lwjgl_openal_eax_EAXListenerProperties.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXListenerProperties.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXListenerProperties.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_eax_EAXListenerProperties.cpp 25 Nov 2002 13:52:23 -0000 1.1 +++ org_lwjgl_openal_eax_EAXListenerProperties.cpp 20 May 2003 13:59:58 -0000 1.2 @@ -45,6 +45,8 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_sizeOfEaxListenerProperties(JNIEnv *env, jobject obj) { #ifdef _WIN32 return sizeof(EAXLISTENERPROPERTIES); +#else + return 0; #endif } |
|
From: Elias N. <eli...@us...> - 2003-05-20 13:59:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv11500/linux Modified Files: extxcursor.cpp Log Message: Native cursor fixes Index: extxcursor.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- extxcursor.cpp 20 May 2003 12:33:51 -0000 1.2 +++ extxcursor.cpp 20 May 2003 13:59:30 -0000 1.3 @@ -51,14 +51,16 @@ } void closeXcursor(void) { - load_success = false; - dlclose(xcursor_handle); - xcursor_handle = NULL; - XcursorSupportsARGB = NULL; - XcursorSupportsAnim = NULL; - XcursorImageCreate = NULL; - XcursorImageDestroy = NULL; - XcursorImagesCreate = NULL; - XcursorImagesDestroy = NULL; - XcursorImagesLoadCursor = NULL; + if (load_success) { + load_success = false; + dlclose(xcursor_handle); + xcursor_handle = NULL; + XcursorSupportsARGB = NULL; + XcursorSupportsAnim = NULL; + XcursorImageCreate = NULL; + XcursorImageDestroy = NULL; + XcursorImagesCreate = NULL; + XcursorImagesDestroy = NULL; + XcursorImagesLoadCursor = NULL; + } } |
|
From: Scott W P. <cfx...@us...> - 2003-05-20 13:59:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv11416/common Modified Files: org_lwjgl_openal_eax_EAXBufferProperties.cpp Log Message: minor cleanup Index: org_lwjgl_openal_eax_EAXBufferProperties.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXBufferProperties.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXBufferProperties.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_eax_EAXBufferProperties.cpp 25 Nov 2002 13:52:23 -0000 1.1 +++ org_lwjgl_openal_eax_EAXBufferProperties.cpp 20 May 2003 13:59:24 -0000 1.2 @@ -44,6 +44,8 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_sizeOfEaxBufferProperties(JNIEnv *env, jobject obj) { #ifdef _WIN32 return sizeof(EAXBUFFERPROPERTIES); +#else + return 0; #endif } |
|
From: Scott W P. <cfx...@us...> - 2003-05-20 13:51:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv7709 Modified Files: org_lwjgl_Display.cpp Log Message: minor cleanup Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_Display.cpp 10 May 2003 21:49:30 -0000 1.13 +++ org_lwjgl_Display.cpp 20 May 2003 13:51:46 -0000 1.14 @@ -87,13 +87,11 @@ displayModes = CGDisplayAvailableModes( kCGDirectMainDisplay ); count = CFArrayGetCount( displayModes ); - printf("Found %d displaymodes\n", count ); - // get a count of the number of display modes on this machine with a bpp greater than 8 // for ( i = 0; i < count; i++ ) { - CFDictionaryRef mode = CFArrayGetValueAtIndex( displayModes, i ); + CFDictionaryRef mode = static_cast<CFDictionaryRef>( CFArrayGetValueAtIndex( displayModes, i ) ); long bpp = _getDictLong( mode, kCGDisplayBitsPerPixel ); if ( bpp > 8 ) @@ -105,13 +103,12 @@ // now that we have the count create the classes, and add 'em all - we'll remove dups in Java // Allocate an array of DisplayModes big enough jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); - jobjectArray ret = env->NewObjectArray( availableModes, displayModeClass, NULL); jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V"); for ( i = 0; i < count; i++ ) { - CFDictionaryRef modeDict = CFArrayGetValueAtIndex( displayModes, i ); + CFDictionaryRef modeDict = static_cast<CFDictionaryRef>( CFArrayGetValueAtIndex( displayModes, i ) ); long width = _getDictLong( modeDict, kCGDisplayWidth ); long height = _getDictLong( modeDict, kCGDisplayHeight ); long freq = (long)(_getDictDouble( modeDict, kCGDisplayRefreshRate ) + 0.5 ); |
|
From: Scott W P. <cfx...@us...> - 2003-05-20 13:48:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv6393 Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: fixed some more initialization issues Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_opengl_BaseGL.cpp 19 May 2003 02:56:54 -0000 1.10 +++ org_lwjgl_opengl_BaseGL.cpp 20 May 2003 13:48:44 -0000 1.11 @@ -48,7 +48,7 @@ static CGLContextObj contextObj; static CGDirectDisplayID displayID = kCGDirectMainDisplay; -/* TODO: move this to Window.cpp when it is ported +/* * Utility function to throw an Exception */ void throwException(JNIEnv * env, const char * err) @@ -83,11 +83,15 @@ CGDisplaySwitchToMode( displayID, displayMode ); - CGLPixelFormatAttribute attribs[2]; + CGOpenGLDisplayMask displayMask = CGDisplayIDToOpenGLDisplayMask( kCGDirectMainDisplay ) ; + CGLPixelFormatAttribute attribs[] = + { + kCGLPFAFullScreen, + kCGLPFADisplayMask, + displayMask, + NULL + } ; long swapInterval; - - attribs[0] = kCGLPFAFullScreen; - attribs[1] = kCGLPFADoubleBuffer; CGLChoosePixelFormat( attribs, &pixelFormatObj, &numPixelFormats ); if ( pixelFormatObj != NULL ) @@ -97,18 +101,23 @@ swapInterval = 1; CGLSetParameter( contextObj, kCGLCPSwapInterval, &swapInterval ); + CGLSetCurrentContext( contextObj ); + CGLSetFullScreen( contextObj ); + if (extgl_Initialize() != 0) + { + // TODO: destroy stuff created this far + throwException( env, "Could not init gl function pointers\n"); + CGLSetCurrentContext( NULL ); + CGLClearDrawable( contextObj ); + CGLDestroyContext( contextObj ); + contextObj = NULL; + return; + } } - - CGLSetCurrentContext( contextObj ); - CGLSetFullScreen( contextObj ); - - if (extgl_Initialize() != 0) + else { - // TODO: destroy stuff created this far - throwException( env, "Could not init gl function pointers\n"); - return; + throwException( env, "Failed to choose pixel format\n"); } - } /* |
|
From: Elias N. <eli...@us...> - 2003-05-20 12:33:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv12454/src/native/linux Modified Files: extxcursor.cpp Log Message: Cursor fixes Index: extxcursor.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extxcursor.cpp 16 May 2003 18:39:46 -0000 1.1 +++ extxcursor.cpp 20 May 2003 12:33:51 -0000 1.2 @@ -24,6 +24,7 @@ } static bool loadFunctionPointers(void) { + load_success = true; XcursorSupportsARGB = (XcursorSupportsARGBPROC)loadHandle("XcursorSupportsARGB"); XcursorSupportsAnim = (XcursorSupportsAnimPROC)loadHandle("XcursorSupportsAnim"); XcursorImageCreate = (XcursorImageCreatePROC)loadHandle("XcursorImageCreate"); @@ -35,11 +36,11 @@ } bool loadXcursor(void) { - load_success = true; + load_success = false; xcursor_handle = dlopen(xcursor_lib_name, RTLD_GLOBAL | RTLD_LAZY); if (xcursor_handle == NULL) { printf("Could not load %s: %s\n", xcursor_lib_name, dlerror()); - return false; + return load_success; } loadFunctionPointers(); return load_success; |
|
From: Elias N. <eli...@us...> - 2003-05-20 12:20:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv1447/src/java/org/lwjgl Modified Files: Window.java Log Message: Implemented Pbuffers on win32 and linux (render to texture will be done later) Implemented native cursor caps (one bit transparancy, alpha translucency and animations) Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Window.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Window.java 3 May 2003 21:20:22 -0000 1.8 +++ Window.java 20 May 2003 12:20:10 -0000 1.9 @@ -71,15 +71,15 @@ * * Only one Window can be created() at a time; to create another Window you must * first destroy() the first window. - * - * The dimensions may be ignored if the window cannot be made non- - * fullscreen. The position may be ignored in either case. + * + * The dimensions may be ignored if the window cannot be made non- + * fullscreen. The position may be ignored in either case. * * @param title The window's title * @param x Position on x axis of top left corner of window. - * @param y Position on y axis of top left corner of window. - * @param width Width of window - * @param height Height of window + * @param y Position on y axis of top left corner of window. + * @param width Width of window + * @param height Height of window * @throws RuntimeException if you attempt to create more than one window at the same time */ protected Window(String title, int x, int y, int width, int height) { |
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1447/src/native/win32 Modified Files: Window.h org_lwjgl_Window.cpp org_lwjgl_input_Cursor.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_BaseGL.cpp Added Files: org_lwjgl_opengl_Pbuffer.cpp Log Message: Implemented Pbuffers on win32 and linux (render to texture will be done later) Implemented native cursor caps (one bit transparancy, alpha translucency and animations) --- NEW FILE: org_lwjgl_opengl_Pbuffer.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Pbuffer.cpp #include <stdlib.h> #include "org_lwjgl_opengl_Pbuffer.h" #include "Window.h" #include "extgl.h" typedef struct _PbufferInfo { HGLRC Pbuffer_context; HPBUFFERARB Pbuffer; HDC Pbuffer_dc; } PbufferInfo; /* * Class: org_lwjgl_opengl_Pbuffer * Method: isPbufferSupported * Signature: ()Z */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps (JNIEnv *env, jclass clazz) { return extgl_Extensions.wgl.ARB_pbuffer ? org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED : 0; } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate * Signature: (IIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate (JNIEnv *env, jclass clazz, jint width, jint height, jint bpp, jint alpha, jint depth, jint stencil) { int iPixelFormat; unsigned int num_formats_returned; int attrib_list[] = {WGL_DRAW_TO_PBUFFER_ARB, TRUE, WGL_ACCELERATION_ARB, WGL_FULL_ACCELERATION_ARB, WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB, WGL_DOUBLE_BUFFER_ARB, FALSE, WGL_SUPPORT_OPENGL_ARB, TRUE, WGL_COLOR_BITS_ARB, bpp, WGL_ALPHA_BITS_ARB, alpha, WGL_DEPTH_BITS_ARB, depth, WGL_STENCIL_BITS_ARB, stencil, 0}; BOOL result = wglChoosePixelFormatARB(hdc, attrib_list, NULL, 1, &iPixelFormat, &num_formats_returned); if (result == FALSE) { throwException(env, "Could not choose pixel formats."); return (jint)NULL; } HPBUFFERARB Pbuffer = wglCreatePbufferARB(hdc, iPixelFormat, width, height, NULL); if (Pbuffer == NULL) { throwException(env, "Could not create Pbuffer."); return (jint)NULL; } HDC Pbuffer_dc = wglGetPbufferDCARB(Pbuffer); if (Pbuffer_dc == NULL) { wglDestroyPbufferARB(Pbuffer); throwException(env, "Could not get Pbuffer dc."); return (jint)NULL; } // Create a rendering context HGLRC Pbuffer_context = wglCreateContext(Pbuffer_dc); if (Pbuffer_context == NULL) { wglReleasePbufferDCARB(Pbuffer, Pbuffer_dc); wglDestroyPbufferARB(Pbuffer); throwException(env, "Failed to create Pbuffer rendering context"); return (jint)NULL; } if (!wglShareLists(hglrc, Pbuffer_context)) { wglDeleteContext(Pbuffer_context); wglReleasePbufferDCARB(Pbuffer, Pbuffer_dc); wglDestroyPbufferARB(Pbuffer); throwException(env, "Could not share buffer context."); return (jint)NULL; } PbufferInfo *Pbuffer_info = (PbufferInfo *)malloc(sizeof(PbufferInfo)); Pbuffer_info->Pbuffer = Pbuffer; Pbuffer_info->Pbuffer_context = Pbuffer_context; Pbuffer_info->Pbuffer_dc = Pbuffer_dc; return (jint)Pbuffer_info; } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nReleaseContext * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseContext (JNIEnv *env, jclass clazz) { wglMakeCurrent(hdc, hglrc); } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nIsBufferLost * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost (JNIEnv *env, jclass clazz, jint handle) { PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; BOOL buffer_lost; wglQueryPbufferARB(Pbuffer_info->Pbuffer, WGL_PBUFFER_LOST_ARB, &buffer_lost); return buffer_lost ? JNI_TRUE : JNI_FALSE; } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nMakeCurrent * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent (JNIEnv *env, jclass clazz, jint handle) { PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; wglMakeCurrent(Pbuffer_info->Pbuffer_dc, Pbuffer_info->Pbuffer_context); } /* * Class: org_lwjgl_opengl_Pbuffer * Method: nDestroyGL * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy (JNIEnv *env, jclass clazz, jint handle) { PbufferInfo *Pbuffer_info = (PbufferInfo *)handle; wglDeleteContext(Pbuffer_info->Pbuffer_context); wglReleasePbufferDCARB(Pbuffer_info->Pbuffer, Pbuffer_info->Pbuffer_dc); wglDestroyPbufferARB(Pbuffer_info->Pbuffer); free(Pbuffer_info); } Index: Window.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/Window.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/Window.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Window.h 16 May 2003 18:39:46 -0000 1.4 +++ Window.h 20 May 2003 12:20:12 -0000 1.5 @@ -48,6 +48,7 @@ #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0300 #include <dinput.h> + #include "extgl.h" #ifdef _PRIVATE_WINDOW_H_ #define WINDOW_H_API @@ -60,6 +61,7 @@ extern bool isFullScreen; // Whether we're fullscreen or not extern bool isMinimized; // Whether we're minimized or not extern RECT clientSize; + extern HGLRC hglrc; #endif /* _PRIVATE_WINDOW_H_ */ /* Index: org_lwjgl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Window.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_Window.cpp 16 May 2003 18:39:46 -0000 1.8 +++ org_lwjgl_Window.cpp 20 May 2003 12:20:13 -0000 1.9 @@ -139,9 +139,6 @@ #endif hwnd = NULL; } - - // Show the mouse - ShowCursor(TRUE); } /* @@ -239,7 +236,7 @@ windowClass.cbWndExtra = 0; windowClass.hInstance = dll_handle; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); - windowClass.hCursor = NULL/*LoadCursor(NULL, IDC_ARROW)*/; + windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); windowClass.lpszMenuName = NULL; windowClass.lpszClassName = WINDOWCLASSNAME; @@ -328,7 +325,6 @@ // 3. Hide the mouse if necessary isFullScreen = fullscreen == JNI_TRUE; - ShowCursor(FALSE); // 4. Create DirectInput if (!createDirectInput()) { Index: org_lwjgl_input_Cursor.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Cursor.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Cursor.cpp 16 May 2003 18:39:46 -0000 1.1 +++ org_lwjgl_input_Cursor.cpp 20 May 2003 12:20:13 -0000 1.2 @@ -5,10 +5,10 @@ /* * Class: org_lwjgl_input_Cursor * Method: nCreateCursor - * Signature: (IIIIIII)I + * Signature: (IIIIIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint image_address) + (JNIEnv *env, jclass clazz, jint width, jint height, jint x_hotspot, jint y_hotspot, jint num_images, jint image_address, jint delay_addresses) { int *pixels = (int *)image_address; Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- org_lwjgl_input_Mouse.cpp 16 May 2003 18:39:46 -0000 1.20 +++ org_lwjgl_input_Mouse.cpp 20 May 2003 12:20:13 -0000 1.21 @@ -108,6 +108,7 @@ mEnvironment = env; clsMouse = clazz; + ShowCursor(FALSE); CacheMouseFields(); /* skip enumeration, since we only want system mouse */ @@ -149,12 +150,12 @@ /* * Class: org_lwjgl_input_Mouse * Method: nIsNativeCursorSupported - * Signature: ()Z + * Signature: ()I */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nIsNativeCursorSupported +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps (JNIEnv *env, jclass clazz) { - return JNI_TRUE; + return org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARANCY; } /* @@ -187,24 +188,24 @@ SetCursorPos(clientRect.left, clientRect.top); cursorPos.x = clientRect.left; cursorPos.y = clientRect.top; - while (ShowCursor(TRUE) < 0) - ; + ShowCursor(TRUE); usingNativeCursor = true; } } else { - while (ShowCursor(FALSE) >= 0) - ; - SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); - SetCursor(NULL); - mDIDevice->Unacquire(); - if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { + if (usingNativeCursor) { + SetClassLong(hwnd, GCL_HCURSOR, (LONG)NULL); + SetCursor(NULL); + mDIDevice->Unacquire(); + if(mDIDevice->SetCooperativeLevel(hwnd, DISCL_EXCLUSIVE | DISCL_FOREGROUND) != DI_OK) { #if _DEBUG - printf("SetCooperativeLevel failed\n"); + printf("SetCooperativeLevel failed\n"); #endif - throwException(env, "Could not set the CooperativeLevel."); - return; + throwException(env, "Could not set the CooperativeLevel."); + return; + } + ShowCursor(FALSE); + usingNativeCursor = false; } - usingNativeCursor = false; } } @@ -236,9 +237,10 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy(JNIEnv *env, jclass clazz) { - mEnvironment = env; - clsMouse = clazz; - ShutdownMouse(); + mEnvironment = env; + clsMouse = clazz; + ShowCursor(FALSE); + ShutdownMouse(); } /* Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- org_lwjgl_opengl_BaseGL.cpp 26 Apr 2003 06:54:32 -0000 1.20 +++ org_lwjgl_opengl_BaseGL.cpp 20 May 2003 12:20:13 -0000 1.21 @@ -47,6 +47,89 @@ HGLRC hglrc = NULL; // OpenGL rendering context +static int findPixelFormat(JNIEnv *env, unsigned int flags, int bpp, int alpha, int depth, int stencil) { + PIXELFORMATDESCRIPTOR pfd = { + sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd + 1, // version number + flags, // RGBA type + PFD_TYPE_RGBA, + (BYTE)bpp, + 0, 0, 0, 0, 0, 0, // color bits ignored + (BYTE)alpha, + 0, // shift bit ignored + 0, // no accumulation buffer + 0, 0, 0, 0, // accum bits ignored + (BYTE)depth, + (BYTE)stencil, + 0, // No auxiliary buffer + PFD_MAIN_PLANE, // main layer + 0, // reserved + 0, 0, 0 // layer masks ignored + }; + + // get the best available match of pixel format for the device context + int iPixelFormat = ChoosePixelFormat(hdc, &pfd); + if (iPixelFormat == 0) { + throwException(env, "Failed to choose pixel format"); + return -1; + } + +#ifdef _DEBUG + printf("Pixel format is %d\n", iPixelFormat); +#endif + + // make that the pixel format of the device context + if (SetPixelFormat(hdc, iPixelFormat, &pfd) == FALSE) { + printf("Failed to set pixel format\n"); + throwException(env, "Failed to choose pixel format"); + return -1; + } + + // 3. Check the chosen format matches or exceeds our specifications + PIXELFORMATDESCRIPTOR desc; + if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) { + throwException(env, "Could not describe pixel format"); + return -1; + } + + if (desc.cColorBits < bpp) { + throwException(env, "This application requires a greater colour depth"); + return -1; + } + + if (desc.cAlphaBits < alpha) { + throwException(env, "This application requires a greater alpha depth"); + return -1; + } + + if (desc.cStencilBits < stencil) { + throwException(env, "This application requires a greater stencil depth"); + return -1; + } + + if (desc.cDepthBits < depth) { + throwException(env, "This application requires a greater depth buffer depth"); + return -1; + } + + if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0 || (desc.dwFlags & PFD_GENERIC_ACCELERATED) != 0) { + throwException(env, "Mode not supported by hardware"); + return -1; + } + + if ((desc.dwFlags & flags) != flags) { + throwException(env, "Capabilities not supported"); + return -1; + } + + // 4. Initialise other things now + if (extgl_Open() != 0) { + throwException(env, "Failed to open extgl"); + return -1; + } + return iPixelFormat; +} + /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate @@ -72,97 +155,12 @@ unsigned int flags = PFD_DRAW_TO_WINDOW | // support window PFD_SUPPORT_OPENGL | // support OpenGL PFD_DOUBLEBUFFER; // double buffered - - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd - 1, // version number - flags, // RGBA type - PFD_TYPE_RGBA, - (BYTE)bpp, - 0, 0, 0, 0, 0, 0, // color bits ignored - (BYTE)alpha, - 0, // shift bit ignored - 0, // no accumulation buffer - 0, 0, 0, 0, // accum bits ignored - (BYTE)depth, - (BYTE)stencil, - 0, // No auxiliary buffer - PFD_MAIN_PLANE, // main layer - 0, // reserved - 0, 0, 0 // layer masks ignored - }; - - // get the best available match of pixel format for the device context - int iPixelFormat = ChoosePixelFormat(hdc, &pfd); - if (iPixelFormat == 0) { - throwException(env, "Failed to choose pixel format"); - closeWindow(); - return; - } - -#ifdef _DEBUG - printf("Pixel format is %d\n", iPixelFormat); -#endif - - // make that the pixel format of the device context - if (SetPixelFormat(hdc, iPixelFormat, &pfd) == FALSE) { - printf("Failed to set pixel format\n"); - throwException(env, "Failed to choose pixel format"); - closeWindow(); - return; - } - - // 3. Check the chosen format matches or exceeds our specifications - PIXELFORMATDESCRIPTOR desc; - if (DescribePixelFormat(hdc, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &desc) == 0) { - throwException(env, "Could not describe pixel format"); - closeWindow(); - return; - } - - if (desc.cColorBits < bpp) { - throwException(env, "This application requires a greater colour depth"); - closeWindow(); - return; - } - - if (desc.cAlphaBits < alpha) { - throwException(env, "This application requires a greater alpha depth"); - closeWindow(); - return; - } - - if (desc.cStencilBits < stencil) { - throwException(env, "This application requires a greater stencil depth"); - closeWindow(); - return; - } - - if (desc.cDepthBits < depth) { - throwException(env, "This application requires a greater depth buffer depth"); - closeWindow(); - return; - } - - if ((desc.dwFlags & PFD_GENERIC_FORMAT) != 0 || (desc.dwFlags & PFD_GENERIC_ACCELERATED) != 0) { - throwException(env, "Mode not supported by hardware"); - closeWindow(); - return; - } - - if ((desc.dwFlags & flags) != flags) { - throwException(env, "Capabilities not supported"); - closeWindow(); - return; - } - - // 4. Initialise other things now - if (extgl_Open() != 0) { - throwException(env, "Failed to open extgl"); - closeWindow(); - return; - } - + + int iPixelFormat = findPixelFormat(env, flags, bpp, alpha, depth, stencil); + if (iPixelFormat == -1) { + closeWindow(); + return; + } // Create a rendering context hglrc = wglCreateContext(hdc); if (hglrc == NULL) { |
|
From: Elias N. <eli...@us...> - 2003-05-20 12:20:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv1447/src/java/org/lwjgl/input Modified Files: Cursor.java Mouse.java Log Message: Implemented Pbuffers on win32 and linux (render to texture will be done later) Implemented native cursor caps (one bit transparancy, alpha translucency and animations) Index: Cursor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Cursor.java 19 May 2003 08:54:46 -0000 1.3 +++ Cursor.java 20 May 2003 12:20:11 -0000 1.4 @@ -64,12 +64,14 @@ * @param height cursor image height * @param xHotspot the x coordinate of the cursor hotspot * @param yHotspot the y coordinate of the cursor hotspot + * @param numImages number of cursor images specified. Must be 1 if animations are not supported. * @param cursorAddress the address of an int array containing the cursor image + * @param delayAddresses the address of animation frame delays, if numImages is greater than 1, else Sys.NULL * @throws Exception if the cursor could not be created for any reason */ - public Cursor(int width, int height, int xHotspot, int yHotspot, int imageAddress) throws Exception { + public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, int imageAddress, int delayAddresses) throws Exception { assert Mouse.isCreated(); - nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, imageAddress); + nativeHandle = nCreateCursor(width, height, xHotspot, yHotspot, numImages, imageAddress, delayAddresses); } /** @@ -89,7 +91,7 @@ /** * Native method to create a native cursor */ - private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int imageAddresses); + private static native int nCreateCursor(int width, int height, int xHotspot, int yHotspot, int numImages, int imageAddresses, int delayAddresses); /** * Native method to destroy a native cursor Index: Mouse.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Mouse.java 16 May 2003 18:39:45 -0000 1.19 +++ Mouse.java 20 May 2003 12:20:11 -0000 1.20 @@ -48,6 +48,9 @@ * @version $Revision$ */ public class Mouse { + public final static int CURSOR_ONE_BIT_TRANSPARANCY = 1; + public final static int CURSOR_8_BIT_ALPHA = 2; + public final static int CURSOR_ANIMATION = 4; /** Has the mouse been created? */ private static boolean created; @@ -92,17 +95,21 @@ } /** - * Check native cursor support - * @return true if native cursors are supported + * Get the capabilities of the native cursor. Return a bit mask of the native cursor capabilities. + * The CURSOR_ONE_BIT_TRANSPARANCY indicates support for cursors with one bit transparancy, + * the CURSOR_8_BIT_ALPHA indicates support for 8 bit alpha and CURSOR_ANIMATION indicates + * support for cursor animations. + * + * @return A bit mask with native cursor capabilities. */ - public static boolean isNativeCursorSupported() { - return nIsNativeCursorSupported(); + public static int getNativeCursorCaps() { + return nGetNativeCursorCaps(); } /** * Native function to determine native cursor support */ - private static native boolean nIsNativeCursorSupported(); + private static native int nGetNativeCursorCaps(); /** * Binds a native cursor. If the cursor argument is null, the @@ -120,7 +127,7 @@ * @throws Exception if the cursor could not be set for any reason */ public static Cursor setNativeCursor(Cursor cursor) throws Exception { - assert created && isNativeCursorSupported(); + assert created && ((getNativeCursorCaps() | CURSOR_ONE_BIT_TRANSPARANCY) != 0); Cursor oldCursor = currentCursor; currentCursor = cursor; if (currentCursor != null) { @@ -136,7 +143,8 @@ /** * Gets the minimum size of a native cursor. Can only be called if - * The Mouse is created and isNativeCursorSupported() returns true + * The Mouse is created and cursor caps includes at least + * CURSOR_ONE_BIT_TRANSPARANCY. * * @return the maximum size of a native cursor */ @@ -149,7 +157,8 @@ /** * Gets the maximum size of a native cursor. Can only be called if - * The Mouse is created and isNativeCursorSupported() returns true + * The Mouse is created and cursor caps includes at least + * CURSOR_ONE_BIT_TRANSPARANCY. * * @return the maximum size of a native cursor */ |
|
From: Elias N. <eli...@us...> - 2003-05-20 12:20:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv1447/src/java/org/lwjgl/test/opengl Added Files: PbufferTest.java Log Message: Implemented Pbuffers on win32 and linux (render to texture will be done later) Implemented native cursor caps (one bit transparancy, alpha translucency and animations) --- NEW FILE: PbufferTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/PbufferTest.java /* * Copyright (c) 2003 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.opengl; import org.lwjgl.*; import org.lwjgl.input.*; import org.lwjgl.opengl.*; import org.lwjgl.vector.Vector2f; import java.nio.*; /** * $Id: PbufferTest.java,v 1.1 2003/05/20 12:20:12 elias_naur Exp $ * * Tests Pbuffers * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ public class PbufferTest { /** Intended deiplay mode */ private DisplayMode mode; /** GL instance */ private GL gl; /** GLU instance */ private GLU glu; /** our quad moving around */ private Vector2f quadPosition; /** our quadVelocity */ private Vector2f quadVelocity; /** angle of quad */ private float angle; /** degrees to rotate per frame */ private float angleRotation = 1.0f; /** Max speed of all changable attributes */ private static final float MAX_SPEED = 20.0f; /** Pbuffer instance */ private static Pbuffer pbuffer; /** The shared texture */ private static int tex_handle; /** * Executes the test */ public void execute() { initialize(); mainLoop(); cleanup(); } /** * Initializes the test */ private void initialize() { try { //find displaymode mode = findDisplayMode(800, 600, 16); // start of in windowed mode gl = new GL("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); // gl = new GL("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); gl.create(); glu = new GLU(gl); if ((Pbuffer.getPbufferCaps() & Pbuffer.PBUFFER_SUPPORTED) == 0) { System.out.println("No Pbuffer support!"); System.exit(1); } System.out.println("Pbuffer support detected"); glInit(); initPbuffer(); Keyboard.create(); quadPosition = new Vector2f(100f, 100f); quadVelocity = new Vector2f(1.0f, 1.0f); } catch (Exception e) { e.printStackTrace(); } } /** * Runs the main loop of the "test" */ private void mainLoop() { while (!Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !gl.isCloseRequested()) { // allow subsystem to get a chance to run too gl.tick(); if (!gl.isMinimized()) { // check keyboard input processKeyboard(); // do "game" logic, and render it logic(); render(); // paint window gl.paint(); } else { // no need to render/paint if nothing has changed (ie. window dragged over) if (gl.isDirty()) { render(); gl.paint(); } // don't waste cpu time, sleep more try { Thread.sleep(100); } catch (InterruptedException inte) { } } } } /** * Performs the logic */ private void logic() { angle += angleRotation; if (angle > 90.0f) { angle = 0.0f; } quadPosition.x += quadVelocity.x; quadPosition.y += quadVelocity.y; //check colision with vertical border border if (quadPosition.x + 50 >= mode.width || quadPosition.x - 50 <= 0) { quadVelocity.x *= -1; } //check collision with horizontal border if (quadPosition.y + 50 >= mode.height || quadPosition.y - 50 <= 0) { quadVelocity.y *= -1; } } private void render() { if (pbuffer.isBufferLost()) { System.out.println("Buffer contents lost - will recreate the buffer"); Pbuffer.releaseContext(); pbuffer.destroy(); initPbuffer(); } pbuffer.makeCurrent(); // Pbuffer rendering //clear background gl.clear(GL.COLOR_BUFFER_BIT); // draw white quad gl.pushMatrix(); { gl.translatef(quadPosition.x, quadPosition.y, 0); gl.rotated(angle, 0.0f, 0.0f, 1.0f); gl.color3f(1.0f, 1.0f, 1.0f); gl.begin(GL.QUADS); { gl.vertex2i(-50, -50); gl.vertex2i(50, -50); gl.vertex2i(50, 50); gl.vertex2i(-50, 50); } gl.end(); } gl.popMatrix(); gl.copyTexImage2D(GL.TEXTURE_2D, 0, GL.RGB, 0, 0, 256, 256, 0); Pbuffer.releaseContext(); // OpenGL window rendering gl.clear(GL.COLOR_BUFFER_BIT); // draw white quad gl.pushMatrix(); { gl.translatef(quadPosition.x, quadPosition.y, 0); gl.rotated(angle, 0.0f, 0.0f, 1.0f); gl.color3f(1.0f, 1.0f, 0.0f); gl.begin(GL.QUADS); { gl.texCoord2f(0f, 0f); gl.vertex2i(-50, -50); gl.texCoord2f(1f, 0f); gl.vertex2i(50, -50); gl.texCoord2f(1f, 1f); gl.vertex2i(50, 50); gl.texCoord2f(0f, 1f); gl.vertex2i(-50, 50); } gl.end(); } gl.popMatrix(); } private void initPbuffer() { try { pbuffer = new Pbuffer(256, 256, mode.bpp, 0, 0, 0); pbuffer.makeCurrent(); initGLState(256, 256, 0.5f); gl.bindTexture(GL.TEXTURE_2D, tex_handle); Pbuffer.releaseContext(); } catch (Exception e) { e.printStackTrace(); } } /** * Processes keyboard input */ private void processKeyboard() { Keyboard.poll(); //check for fullscreen key if (Keyboard.isKeyDown(Keyboard.KEY_F)) { try { destroyTexture(); Keyboard.destroy(); Pbuffer.releaseContext(); pbuffer.destroy(); gl.destroy(); Display.setDisplayMode(mode); gl = new GL("Test", mode.bpp, 0, 0, 0); gl.create(); glInit(); initPbuffer(); glu = new GLU(gl); Keyboard.create(); } catch (Exception e) { e.printStackTrace(); } } //check for window key if (Keyboard.isKeyDown(Keyboard.KEY_W)) { try { destroyTexture(); Keyboard.destroy(); Pbuffer.releaseContext(); pbuffer.destroy(); gl.destroy(); Display.resetDisplayMode(); gl = new GL("Test", 50, 50, mode.width, mode.height, mode.bpp, 0, 0, 0); gl.create(); glInit(); initPbuffer(); glu = new GLU(gl); Keyboard.create(); } catch (Exception e) { e.printStackTrace(); } } //check for speed changes if (Keyboard.isKeyDown(Keyboard.KEY_UP)) { quadVelocity.y += 0.1f; } if (Keyboard.isKeyDown(Keyboard.KEY_DOWN)) { quadVelocity.y -= 0.1f; } if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) { quadVelocity.x += 0.1f; } if (Keyboard.isKeyDown(Keyboard.KEY_LEFT)) { quadVelocity.x -= 0.1f; } if (Keyboard.isKeyDown(Keyboard.KEY_ADD)) { angleRotation += 0.1f; } if (Keyboard.isKeyDown(Keyboard.KEY_SUBTRACT)) { angleRotation -= 0.1f; } //throttle if (quadVelocity.x < -MAX_SPEED) { quadVelocity.x = -MAX_SPEED; } if (quadVelocity.x > MAX_SPEED) { quadVelocity.x = MAX_SPEED; } if (quadVelocity.y < -MAX_SPEED) { quadVelocity.y = -MAX_SPEED; } if (quadVelocity.y > MAX_SPEED) { quadVelocity.y = MAX_SPEED; } if (angleRotation < 0.0f) { angleRotation = 0.0f; } if (angleRotation > MAX_SPEED) { angleRotation = MAX_SPEED; } } private void destroyTexture() { IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); buffer.put(0, tex_handle); gl.deleteTextures(1, Sys.getDirectBufferAddress(buffer)); } /** * Cleans up the test */ private void cleanup() { destroyTexture(); Keyboard.destroy(); Pbuffer.releaseContext(); pbuffer.destroy(); gl.destroy(); } /** * Retrieves a displaymode, if one such is available * * @param width Required width * @param height Required height * @param bpp Minimum required bits per pixel * @return */ private DisplayMode findDisplayMode(int width, int height, int bpp) { DisplayMode[] modes = Display.getAvailableDisplayModes(); for (int i = 0; i < modes.length; i++) { if (modes[i].width == width && modes[i].height == height && modes[i].bpp >= bpp) { return modes[i]; } } return null; } private void initGLState(int width, int height, float color) { gl.matrixMode(GL.PROJECTION); gl.loadIdentity(); glu.ortho2D(0, mode.width, 0, mode.height); gl.matrixMode(GL.MODELVIEW); gl.loadIdentity(); gl.viewport(0, 0, width, height); //set clear color to black gl.clearColor(color, color, color, 0.0f); } /** * Initializes OGL */ private void glInit() { // Go into orthographic projection mode. gl.determineAvailableExtensions(); //sync frame (only works on windows) if (GL.WGL_EXT_swap_control) { GL.wglSwapIntervalEXT(1); } gl.texEnvf(GL.TEXTURE_ENV, GL.TEXTURE_ENV_MODE, GL.REPLACE); gl.enable(GL.TEXTURE_2D); // Create shared texture IntBuffer buffer = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); gl.genTextures(1, Sys.getDirectBufferAddress(buffer)); tex_handle = buffer.get(0); gl.bindTexture(GL.TEXTURE_2D, tex_handle); gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_S, GL.CLAMP); gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_WRAP_T, GL.CLAMP); gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MIN_FILTER, GL.LINEAR); gl.texParameteri(GL.TEXTURE_2D, GL.TEXTURE_MAG_FILTER, GL.LINEAR); initGLState(mode.width, mode.height, 0f); } /** * Test entry point */ public static void main(String[] args) { System.out.println( "Change between fullscreen and windowed mode, by pressing F and W respectively"); System.out.println("Move quad using arrowkeys, and change rotation using +/-"); PbufferTest fswTest = new PbufferTest(); fswTest.execute(); } } |
|
From: Elias N. <eli...@us...> - 2003-05-20 12:20:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv1447/src/native/common Modified Files: org_lwjgl_input_Cursor.h org_lwjgl_input_Mouse.h Added Files: org_lwjgl_opengl_Pbuffer.h Log Message: Implemented Pbuffers on win32 and linux (render to texture will be done later) Implemented native cursor caps (one bit transparancy, alpha translucency and animations) --- NEW FILE: org_lwjgl_opengl_Pbuffer.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_Pbuffer.h /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_opengl_Pbuffer */ #ifndef _Included_org_lwjgl_opengl_Pbuffer #define _Included_org_lwjgl_opengl_Pbuffer #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: _00024assertionsDisabled */ #undef org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED #define org_lwjgl_opengl_Pbuffer_PBUFFER_SUPPORTED 1L /* Inaccessible static: currentBuffer */ /* Inaccessible static: class_00024org_00024lwjgl_00024opengl_00024Pbuffer */ /* * Class: org_lwjgl_opengl_Pbuffer * Method: nIsBufferLost * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Pbuffer_nIsBufferLost (JNIEnv *, jclass, jint); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nReleaseContext * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nReleaseContext (JNIEnv *, jclass); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nMakeCurrent * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nMakeCurrent (JNIEnv *, jclass, jint); /* * Class: org_lwjgl_opengl_Pbuffer * Method: getPbufferCaps * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_getPbufferCaps (JNIEnv *, jclass); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nCreate * Signature: (IIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_Pbuffer_nCreate (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint); /* * Class: org_lwjgl_opengl_Pbuffer * Method: nDestroy * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Pbuffer_nDestroy (JNIEnv *, jclass, jint); #ifdef __cplusplus } #endif #endif Index: org_lwjgl_input_Cursor.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Cursor.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Cursor.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Cursor.h 16 May 2003 18:39:45 -0000 1.1 +++ org_lwjgl_input_Cursor.h 20 May 2003 12:20:12 -0000 1.2 @@ -12,10 +12,10 @@ /* * Class: org_lwjgl_input_Cursor * Method: nCreateCursor - * Signature: (IIIII)I + * Signature: (IIIIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Cursor_nCreateCursor - (JNIEnv *, jclass, jint, jint, jint, jint, jint); + (JNIEnv *, jclass, jint, jint, jint, jint, jint, jint, jint); /* * Class: org_lwjgl_input_Cursor Index: org_lwjgl_input_Mouse.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Mouse.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_input_Mouse.h 16 May 2003 18:39:45 -0000 1.4 +++ org_lwjgl_input_Mouse.h 20 May 2003 12:20:12 -0000 1.5 @@ -8,6 +8,12 @@ extern "C" { #endif /* Inaccessible static: _00024assertionsDisabled */ +#undef org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARANCY +#define org_lwjgl_input_Mouse_CURSOR_ONE_BIT_TRANSPARANCY 1L +#undef org_lwjgl_input_Mouse_CURSOR_8_BIT_ALPHA +#define org_lwjgl_input_Mouse_CURSOR_8_BIT_ALPHA 2L +#undef org_lwjgl_input_Mouse_CURSOR_ANIMATION +#define org_lwjgl_input_Mouse_CURSOR_ANIMATION 4L /* Inaccessible static: created */ /* Inaccessible static: buttons */ /* Inaccessible static: dx */ @@ -19,10 +25,10 @@ /* Inaccessible static: class_00024org_00024lwjgl_00024input_00024Mouse */ /* * Class: org_lwjgl_input_Mouse - * Method: nIsNativeCursorSupported - * Signature: ()Z + * Method: nGetNativeCursorCaps + * Signature: ()I */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nIsNativeCursorSupported +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNativeCursorCaps (JNIEnv *, jclass); /* |