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
|
4
(1) |
5
|
6
|
7
|
|
8
|
9
|
10
|
11
(7) |
12
(5) |
13
|
14
(10) |
|
15
(5) |
16
|
17
(2) |
18
(12) |
19
(7) |
20
(19) |
21
(42) |
|
22
(19) |
23
(4) |
24
(1) |
25
|
26
|
27
|
28
(1) |
|
29
|
30
(28) |
31
|
|
|
|
|
|
From: Gregory P. <gre...@us...> - 2002-12-23 21:50:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory sc8-pr-cvs1:/tmp/cvs-serv6352/src/native/macosx Modified Files: org_lwjgl_input_Keyboard.cpp Log Message: Started trimming the OSX keyboard interface to what OSX supports in Carbon. Won't use InputSprocket because there appears to be no support plan from Apple. Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Keyboard.cpp 18 Dec 2002 03:38:57 -0000 1.1 +++ org_lwjgl_input_Keyboard.cpp 23 Dec 2002 21:50:49 -0000 1.2 @@ -39,38 +39,11 @@ * @version $Revision$ */ -#include <X11/X.h> -#include <X11/Xlib.h> -#include <string.h> +#include <Carbon/Carbon.h> #include <assert.h> #include "org_lwjgl_input_Keyboard.h" -#define KEYBOARD_BUFFER_SIZE 50 -#define KEYBOARD_SIZE 256 -#define KEY_EVENT_BACKLOG 20 - -unsigned char readBuffer[KEYBOARD_BUFFER_SIZE * 2]; -jfieldID fid_readBuffer; -jfieldID fid_readBufferAddress; -unsigned char key_buf[KEYBOARD_SIZE]; -unsigned char key_map[KEYBOARD_SIZE]; - -typedef struct { - unsigned char keycode; - unsigned char state; -} input_event; - -input_event saved_key_events[KEY_EVENT_BACKLOG]; -int list_start = 0; -int list_end = 0; - -bool keyboard_grabbed; - -extern Display *disp; -extern Window win; -extern int current_fullscreen; - -extern int isFocused(void); +KeyMap keyMap; /* * Class: org_lwjgl_input_Keyboard @@ -91,33 +64,6 @@ fid_readBufferAddress = env->GetStaticFieldID(clazz, "readBufferAddress", "I"); } -int grabKeyboard(void) { - int result = XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); - if (result == GrabSuccess) - keyboard_grabbed = true; - return result; -} - -void ungrabKeyboard(void) { - keyboard_grabbed = false; - XUngrabKeyboard(disp, CurrentTime); -} - -int updateKeyboardGrab(void) { - if (current_fullscreen) { - if (!keyboard_grabbed) - return grabKeyboard(); - } else { - if (isFocused()) { - if (!keyboard_grabbed) - return grabKeyboard(); - } else { - if (keyboard_grabbed) - ungrabKeyboard(); - } - } - return GrabSuccess; -} /* * Class: org_lwjgl_input_Keyboard @@ -127,34 +73,11 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { - keyboard_grabbed = 0; - if (updateKeyboardGrab() != GrabSuccess) { + #ifdef _DEBUG - printf("Could not grab keyboard\n"); + printf("Creating OSX Carbon keyboard interface\n"); #endif - return JNI_FALSE; - } - for (int i = 0; i < KEYBOARD_SIZE; i++) - key_map[i] = i; - key_map[0x6b] = 0xdb; // Left doze key - key_map[0x6c] = 0xdc; // Right doze key - key_map[0x6d] = 0xdd; // Apps key - key_map[0x5a] = 0xc8; // Up arrow - key_map[0x5c] = 0xcb; // Left arrow - key_map[0x5e] = 0xcd; // Right arrow - key_map[0x60] = 0xd0; // Down arrow - key_map[0x59] = 0xc7; // Home - key_map[0x62] = 0xd2; // Insert - key_map[0x63] = 0xd3; // Delete - key_map[0x5f] = 0xcf; // End - key_map[0x5b] = 0xc9; // Page up - key_map[0x61] = 0xd1; // Page down - key_map[0x67] = 0xb7; // SysRQ - key_map[0x66] = 0xc5; // Pause - key_map[0x64] = 0x9c; // Numpad enter - key_map[0x68] = 0xb5; // Numpad divide - - memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); + return JNI_TRUE; } @@ -166,32 +89,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { - if (keyboard_grabbed) - ungrabKeyboard(); -} - -input_event *nextEventElement(void) { - if (list_start == list_end) - return NULL; - input_event *result = &(saved_key_events[list_start]); - list_start = (list_start + 1)%KEY_EVENT_BACKLOG; - return result; -} - -void putEventElement(unsigned char keycode, unsigned char state) { - int next_index = (list_end + 1)%KEY_EVENT_BACKLOG; - if (next_index == list_start) - return; - saved_key_events[list_end].keycode = keycode; - saved_key_events[list_end].state = state; - list_end = next_index; + // no specific methodology for doing this in OSX input system +#ifdef _DEBUG + printf("Destroying OSX Carbon keyboard interface\n"); +#endif } -unsigned char getKeycode(XEvent *event) { - unsigned char keycode = (unsigned char)((event->xkey.keycode - 8) & 0xff); - keycode = key_map[keycode]; - return keycode; -} /* * Class: org_lwjgl_input_Keyboard @@ -201,23 +104,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll (JNIEnv * env, jclass clazz, jint buf) { - XEvent event; - int state; - - updateKeyboardGrab(); - - while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { - unsigned char keycode = getKeycode(&event); - if (event.type == KeyPress) { - state = 1; - } else if (event.type == KeyRelease) { - state = 0; - } else - assert(0); - key_buf[keycode] = state; - putEventElement(keycode, state); - } - memcpy((unsigned char*)buf, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); + // get the keymap from the operating system's carbon layer + // + GetKeys( keyMap ); } /* @@ -228,40 +117,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead (JNIEnv * env, jclass clazz, jint keys) { - XEvent event; - int count = 0; - int buf_count = 0; - int state; - input_event *input_ev; - unsigned char *result_buf = (unsigned char *)keys; - - updateKeyboardGrab(); - while ((input_ev = nextEventElement()) != NULL) { - count++; -// printf("Reading a key %d %d count %d\n", (int)input_ev->keycode, (int)input_ev->state, count); - result_buf[buf_count++] = input_ev->keycode; - result_buf[buf_count++] = input_ev->state; - if (buf_count >= KEYBOARD_BUFFER_SIZE * 2) - return count; - } - - while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { - count++; - unsigned char keycode = getKeycode(&event); - if (event.type == KeyPress) { - state = 1; - } else if (event.type == KeyRelease) { - state = 0; - } else - assert(0); - key_buf[keycode] = state; - result_buf[buf_count++] = keycode; - result_buf[buf_count++] = state; - if (buf_count >= KEYBOARD_BUFFER_SIZE * 2) - return count; - } - return count; } /* @@ -272,8 +128,7 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nEnableBuffer (JNIEnv * env, jclass clazz) { - jobject newBuffer = env->NewDirectByteBuffer(&readBuffer, KEYBOARD_BUFFER_SIZE * 2); - env->SetStaticObjectField(clazz, fid_readBuffer, newBuffer); - env->SetStaticIntField(clazz, fid_readBufferAddress, (jint) (&readBuffer)); - return KEYBOARD_BUFFER_SIZE; + printf("Buffered input is currently not available\n"); + + return JNI_FALSE; } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2002-12-23 13:23:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv17844/src/native/win32 Modified Files: org_lwjgl_Display.cpp Log Message: Fixed? 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.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_Display.cpp 22 Dec 2002 20:31:22 -0000 1.12 +++ org_lwjgl_Display.cpp 23 Dec 2002 13:23:29 -0000 1.13 @@ -189,17 +189,17 @@ int i = 0, n = 0; while (EnumDisplaySettings(NULL, i ++, &mode) != 0) { // Filter out indexed modes - if (mode.dmBitsPerPel < 16) { + if (mode.dmBitsPerPel <=8) { continue; } else n ++; } - ; // Do nothing + // Allocate an array of DisplayModes big enough jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); - // Note the * 32 - this is because we are manufacturing available alpha/depth/stencil combos. + // Note the * 16 - this is because we are manufacturing available alpha/depth/stencil combos. jobjectArray ret = env->NewObjectArray(n * 16, displayModeClass, NULL); jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIIIIII)V"); |
|
From: Elias N. <eli...@us...> - 2002-12-23 11:31:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv22555/src/native/linux Modified Files: org_lwjgl_Display.cpp Log Message: Added more intelligent pixel format chooser in linux 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.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_Display.cpp 22 Dec 2002 20:58:25 -0000 1.10 +++ org_lwjgl_Display.cpp 23 Dec 2002 11:31:32 -0000 1.11 @@ -60,40 +60,123 @@ int win_height; XF86VidModeModeInfo **avail_modes; XVisualInfo * vis_info; +int gl_loaded = 0; struct pixelformat { + int bpp; int depth; int alpha; int stencil; }; -struct pixelformat * getAvailablePixelFormats(int *length) { - *length = 8; - struct pixelformat *formats = (struct pixelformat *)malloc((*length)*sizeof(struct pixelformat)); - formats[0].depth = 24; - formats[0].alpha = 8; - formats[0].stencil = 8; - formats[1].depth = 16; - formats[1].alpha = 8; - formats[1].stencil = 8; - formats[2].depth = 24; - formats[2].alpha = 0; - formats[2].stencil = 8; - formats[3].depth = 16; - formats[3].alpha = 0; - formats[3].stencil = 8; - formats[4].depth = 24; - formats[4].alpha = 8; - formats[4].stencil = 0; - formats[5].depth = 16; - formats[5].alpha = 8; - formats[5].stencil = 0; - formats[6].depth = 24; - formats[6].alpha = 0; - formats[6].stencil = 0; - formats[7].depth = 16; - formats[7].alpha = 0; - formats[7].stencil = 0; +int fillFormat(struct pixelformat *formats, int index, int bpp, int depth, int alpha, int stencil) { + for (int i = 0; i < index; i++) + if (formats[i].bpp == bpp && + formats[i].depth == depth && + formats[i].alpha == alpha && + formats[i].stencil == stencil) + return 0; + formats[index].bpp = bpp; + formats[index].depth = depth; + formats[index].stencil = stencil; + formats[index].alpha = alpha; + return 1; +} + +struct pixelformat *getGLXAvailablePixelFormats(Display *disp, int screen, int *length) { + if (extgl_Extensions.glx.GLX13 == 1) { + int num_formats; + int attriblist[] = {GLX_DOUBLEBUFFER, True, + GLX_STEREO, False, + GLX_RENDER_TYPE, GLX_RGBA_BIT, + GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT, + GLX_CONFIG_CAVEAT, GLX_NONE, + None}; + GLXFBConfig *configs = glXChooseFBConfig(disp, screen, attriblist, &num_formats); + struct pixelformat *formats = (struct pixelformat *)malloc(num_formats*sizeof(struct pixelformat)); + *length = 0; + for (int i = 0; i < num_formats; i++) { + int bpp, depth, alpha, stencil; + int val; + if (glXGetFBConfigAttrib(disp, configs[i], GLX_RED_SIZE, &val) != 0) { + free(formats); + return NULL; + } + bpp = val; + if (glXGetFBConfigAttrib(disp, configs[i], GLX_GREEN_SIZE, &val) != 0) { + free(formats); + return NULL; + } + bpp += val; + if (glXGetFBConfigAttrib(disp, configs[i], GLX_BLUE_SIZE, &val) != 0) { + free(formats); + return NULL; + } + bpp += val; + if (glXGetFBConfigAttrib(disp, configs[i], GLX_ALPHA_SIZE, &alpha) != 0) { + free(formats); + return NULL; + } + if (glXGetFBConfigAttrib(disp, configs[i], GLX_DEPTH_SIZE, &depth) != 0) { + free(formats); + return NULL; + } + if (glXGetFBConfigAttrib(disp, configs[i], GLX_STENCIL_SIZE, &stencil) != 0) { + free(formats); + return NULL; + } + if (fillFormat(formats, *length, bpp, depth, alpha, stencil) == 1) + (*length)++; + } + return formats; + } + return NULL; +} + +XVisualInfo *chooseVisual(Display *disp, int screen, int bpp, int depth, int alpha, int stencil) { + int bpe; + switch (bpp) { + case 32: + case 24: + bpe = 8; + break; + case 16: + bpe = 4; + break; + default: + return JNI_FALSE; + } + + int attriblist[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, depth, + GLX_RED_SIZE, bpe, + GLX_GREEN_SIZE, bpe, + GLX_BLUE_SIZE, bpe, + GLX_ALPHA_SIZE, alpha, + GLX_STENCIL_SIZE, stencil, + None }; + return glXChooseVisual(disp, screen, attriblist); +} + +struct pixelformat *getAvailablePixelFormats(Display *disp, int screen, int *length) { + struct pixelformat *formats = getGLXAvailablePixelFormats(disp, screen, length); + if (formats != NULL) + return formats; + *length = 16; + formats = (struct pixelformat *)malloc((*length)*sizeof(struct pixelformat)); + *length = 0; + for (int bpp = 16; bpp <= 24; bpp += 8) + for (int depth = 16; depth <= 24; depth += 8) + for (int alpha = 0; alpha <= 8; alpha += 8) + for (int stencil = 0; stencil <= 8; stencil += 8) { + XVisualInfo * visual = chooseVisual(disp, screen, bpp, depth, alpha, stencil); + if (visual != NULL) { + if (fillFormat(formats, *length, bpp, depth, alpha, stencil) == 1) + (*length)++; + XFree(visual); + } + } return formats; } @@ -116,6 +199,19 @@ return current_focused; } +int loadGL(Display *disp, int screen) { + if (gl_loaded == 1) + return JNI_TRUE; + if (extgl_Open(disp, screen) != 0) { +#ifdef _DEBUG + printf("Could not load gl libs\n"); +#endif + return JNI_FALSE; + } + gl_loaded = 1; + return JNI_TRUE; +} + int getDisplayModes(Display *disp, int screen, int *num_modes, XF86VidModeModeInfo ***avail_modes) { int event_base, error_base, xvid_ver, xvid_rev; @@ -138,38 +234,6 @@ XSetWindowAttributes attribs; Colormap cmap; int attribmask; - int bpe; - switch (bpp) { - case 32: - case 24: - bpe = 8; - break; - case 16: - bpe = 4; - break; - default: - return JNI_FALSE; - } - if (depth_bits == 32) - depth_bits = 24; - - int attriblist[] = { GLX_RGBA, - GLX_DOUBLEBUFFER, - GLX_DEPTH_SIZE, depth_bits, - GLX_RED_SIZE, bpe, - GLX_GREEN_SIZE, bpe, - GLX_BLUE_SIZE, bpe, - GLX_ALPHA_SIZE, alpha_bits, - GLX_STENCIL_SIZE, stencil_bits, - None }; -/* int attriblistna[] = { GLX_RGBA, - GLX_DOUBLEBUFFER, - GLX_DEPTH_SIZE, bpp, - GLX_RED_SIZE, bpe, - GLX_GREEN_SIZE, bpe, - GLX_BLUE_SIZE, bpe, - None }; -*/ int num_modes, i; @@ -186,27 +250,21 @@ return JNI_FALSE; } screen = DefaultScreen(disp); - if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { - XCloseDisplay(disp); + if (loadGL(disp, screen) != JNI_TRUE) { #ifdef _DEBUG - printf("Could not get display modes\n"); + printf("Could not load GL libs\n"); #endif return JNI_FALSE; } - root_win = RootWindow(disp, screen); - if (extgl_Open() != 0) { + if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { + XCloseDisplay(disp); #ifdef _DEBUG - printf("Could not load gl libs\n"); + printf("Could not get display modes\n"); #endif return JNI_FALSE; } - vis_info = glXChooseVisual(disp, screen, attriblist); - - /* might be a better way to handle not being able to set GLX_ALPHA_SIZE... */ -/* if (vis_info == NULL) { - vis_info = glXChooseVisual(disp, screen, attriblistna); - } -*/ + root_win = RootWindow(disp, screen); + vis_info = chooseVisual(disp, screen, bpp, depth_bits, alpha_bits, stencil_bits); if (vis_info == NULL) { XCloseDisplay(disp); #ifdef _DEBUG @@ -288,22 +346,29 @@ int screen = DefaultScreen(disp); XF86VidModeModeInfo **avail_modes; - int depth = DefaultDepth(disp, screen); - if (disp == NULL) { #ifdef _DEBUG printf("Could not open X connection\n"); #endif + XCloseDisplay(disp); return NULL; } + if (loadGL(disp, screen) != JNI_TRUE) { +#ifdef _DEBUG + printf("Could not load GL\n"); +#endif + XCloseDisplay(disp); + return JNI_FALSE; + } if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { #ifdef _DEBUG printf("Could not get display modes\n"); #endif + XCloseDisplay(disp); return NULL; } int num_pixelformats; - struct pixelformat *formats = getAvailablePixelFormats(&num_pixelformats); + struct pixelformat *formats = getAvailablePixelFormats(disp, screen, &num_pixelformats); // Allocate an array of DisplayModes big enough jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); jobjectArray ret = env->NewObjectArray(num_modes*num_pixelformats, displayModeClass, NULL); @@ -311,7 +376,7 @@ for (i = 0; i < num_modes; i++) { for (int j = 0; j < num_pixelformats; j++) { - jobject displayMode = env->NewObject(displayModeClass, displayModeConstructor, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay, depth, 0, formats[j].alpha, formats[j].depth, formats[j].stencil); + jobject displayMode = env->NewObject(displayModeClass, displayModeConstructor, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay, formats[j].bpp, 0, formats[j].alpha, formats[j].depth, formats[j].stencil); env->SetObjectArrayElement(ret, i*num_pixelformats + j, displayMode); } } |
|
From: Elias N. <eli...@us...> - 2002-12-23 11:31:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22555/src/native/common Modified Files: extgl.c extgl.h Log Message: Added more intelligent pixel format chooser in linux Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- extgl.c 11 Dec 2002 07:16:31 -0000 1.2 +++ extgl.c 23 Dec 2002 11:31:32 -0000 1.3 @@ -72,12 +72,12 @@ glXSelectEventPROC glXSelectEvent = NULL; glXGetSelectedEventPROC glXGetSelectedEvent = NULL; -glXGetContextIDEXTPROC glXGetContextIDEXT = NULL; +/*glXGetContextIDEXTPROC glXGetContextIDEXT = NULL; glXGetCurrentDrawableEXTPROC glXGetCurrentDrawableEXT = NULL; glXImportContextEXTPROC glXImportContextEXT = NULL; glXFreeContextEXTPROC glXFreeContextEXT = NULL; glXQueryContextInfoEXTPROC glXQueryContextInfoEXT = NULL; - +*/ glXGetProcAddressARBPROC glXGetProcAddressARB = NULL; glXChooseVisualPROC glXChooseVisual = NULL; @@ -1376,8 +1376,9 @@ if (t == NULL) { t = dlsym(lib_glu_handle, name); - if (t == NULL) + if (t == NULL) { extgl_error = 1; + } } } return t; @@ -1561,6 +1562,14 @@ return 0; } +#ifndef _WIN32 +/** returns true if the extention is available */ +int GLXQueryExtension(Display *disp, int screen, const char *name) +{ + return QueryExtension(glXQueryExtensionsString(disp, screen), name); +} +#endif + /** returns true if the extention is available */ int GLUQueryExtension(const char *name) { @@ -2410,7 +2419,7 @@ int extgl_InitGLX13(void) { if (extgl_Extensions.glx.GLX13 == 0) - return 1; + return extgl_error; glXGetFBConfigs = (glXGetFBConfigsPROC) extgl_GetProcAddress("glXGetFBConfigs"); glXChooseFBConfig = (glXChooseFBConfigPROC) extgl_GetProcAddress("glXChooseFBConfig"); glXGetFBConfigAttrib = (glXGetFBConfigAttribPROC) extgl_GetProcAddress("glXGetFBConfigAttrib"); @@ -2434,12 +2443,12 @@ int extgl_InitGLX12(void) { - glXGetContextIDEXT = (glXGetContextIDEXTPROC) extgl_GetProcAddress("glXGetContextIDEXT"); +/* glXGetContextIDEXT = (glXGetContextIDEXTPROC) extgl_GetProcAddress("glXGetContextIDEXT"); glXGetCurrentDrawableEXT = (glXGetCurrentDrawableEXTPROC) extgl_GetProcAddress("glXGetCurrentDrawableEXT"); glXImportContextEXT = (glXImportContextEXTPROC) extgl_GetProcAddress("glXImportContextEXT"); glXFreeContextEXT = (glXFreeContextEXTPROC) extgl_GetProcAddress("glXFreeContextEXT"); glXQueryContextInfoEXT = (glXQueryContextInfoEXTPROC) extgl_GetProcAddress("glXQueryContextInfoEXT"); - +*/ glXChooseVisual = (glXChooseVisualPROC) extgl_GetProcAddress("glXChooseVisual"); glXCopyContext = (glXCopyContextPROC) extgl_GetProcAddress("glXCopyContext"); glXCreateContext = (glXCreateContextPROC) extgl_GetProcAddress("glXCreateContext"); @@ -2463,18 +2472,30 @@ return extgl_error; } -int extgl_InitGLX(void) +#ifndef _WIN32 +void extgl_InitGLXSupportedExtensions(Display *disp, int screen) { - /* Assume glx ver >= 1.3 */ - extgl_Extensions.glx.GLX12 = 1; - extgl_Extensions.glx.GLX13 = 1; + extgl_Extensions.glx.EXT_visual_info = GLXQueryExtension(disp, screen, "GLX_EXT_visual_info"); + extgl_Extensions.glx.EXT_visual_rating = GLXQueryExtension(disp, screen, "GLX_EXT_visual_rating"); +} +#endif +int extgl_InitGLX(Display *disp, int screen) +{ + int major, minor; + /* Assume glx ver >= 1.2 */ + extgl_Extensions.glx.GLX12 = 1; glXGetProcAddressARB = (glXGetProcAddressARBPROC) dlsym(lib_gl_handle, "glXGetProcAddressARB"); if (glXGetProcAddressARB == NULL) return 1; if (extgl_InitGLX12() != 0) return 1; + extgl_InitGLXSupportedExtensions(disp, screen); + if (glXQueryVersion(disp, &major, &minor) != True) + return 1; + if (major > 1 || (major == 1 && minor >= 3)) + extgl_Extensions.glx.GLX13 = 1; if (extgl_InitGLX13() != 0) return 1; return 0; @@ -2989,6 +3010,7 @@ #endif /* GL_VERSION_1_4 */ } + void extgl_InitGLUSupportedExtensions() { char *s = (char*) gluGetString(GLU_VERSION); @@ -3198,9 +3220,9 @@ return extgl_error; } -int extgl_Open(void) -{ #ifndef _WIN32 +int extgl_Open(Display *disp, int screen) +{ lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; @@ -3208,9 +3230,13 @@ lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; - - extgl_InitGLX(); + if (extgl_InitGLX(disp, screen) != 0) + return 1; + return 0; +} #else +int extgl_Open(void) +{ lib_gl_handle = LoadLibrary("opengl32.dll"); if (lib_gl_handle == NULL) @@ -3218,10 +3244,9 @@ lib_glu_handle = LoadLibrary("glu32.dll"); if (lib_glu_handle == NULL) return 1; -#endif - - return 0; + return 0; } +#endif void extgl_Close(void) { Index: extgl.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- extgl.h 11 Dec 2002 07:16:31 -0000 1.2 +++ extgl.h 23 Dec 2002 11:31:32 -0000 1.3 @@ -354,12 +354,12 @@ extern glXSelectEventPROC glXSelectEvent; extern glXGetSelectedEventPROC glXGetSelectedEvent; -extern glXGetContextIDEXTPROC glXGetContextIDEXT; +/*extern glXGetContextIDEXTPROC glXGetContextIDEXT; extern glXGetCurrentDrawableEXTPROC glXGetCurrentDrawableEXT; extern glXImportContextEXTPROC glXImportContextEXT; extern glXFreeContextEXTPROC glXFreeContextEXT; extern glXQueryContextInfoEXTPROC glXQueryContextInfoEXT; - +*/ extern glXGetProcAddressARBPROC glXGetProcAddressARB; extern glXChooseVisualPROC glXChooseVisual; @@ -5547,6 +5547,8 @@ { int GLX12; int GLX13; + int EXT_visual_info; + int EXT_visual_rating; }; #endif /* WIN32 */ @@ -5661,7 +5663,11 @@ /* initializes everything, call this right after the rc is created. the function returns 0 if successful */ int extgl_Initialize(); +#ifndef _WIN32 +int extgl_Open(Display *disp, int screen); +#else int extgl_Open(void); +#endif void extgl_Close(void); int glInitialize(); /* deprecated, please do not use */ |