You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian M. <ma...@us...> - 2002-11-17 18:12:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv5047 Modified Files: org_lwjgl_input_Joystick.h Log Message: new joystick header Index: org_lwjgl_input_Joystick.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Joystick.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_input_Joystick.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Joystick.h 24 Aug 2002 21:17:37 -0000 1.1 +++ org_lwjgl_input_Joystick.h 17 Nov 2002 18:12:13 -0000 1.2 @@ -8,25 +8,24 @@ extern "C" { #endif /* Inaccessible static: _00024assertionsDisabled */ -/* Inaccessible static: created */ -/* Inaccessible static: button */ -/* Inaccessible static: x */ -/* Inaccessible static: y */ -/* Inaccessible static: z */ -/* Inaccessible static: readBuffer */ -/* Inaccessible static: readBufferAddress */ -#undef org_lwjgl_input_Joystick_JOYSTICK_EVENT_SIZE -#define org_lwjgl_input_Joystick_JOYSTICK_EVENT_SIZE 20L -#undef org_lwjgl_input_Joystick_JOYSTICK_EVENT_STRIDE -#define org_lwjgl_input_Joystick_JOYSTICK_EVENT_STRIDE 32L -/* Inaccessible static: class_000240 */ +#undef org_lwjgl_input_Joystick_POV_CENTER +#define org_lwjgl_input_Joystick_POV_CENTER -1L +#undef org_lwjgl_input_Joystick_POV_NORTH +#define org_lwjgl_input_Joystick_POV_NORTH 0L +#undef org_lwjgl_input_Joystick_POV_SOUTH +#define org_lwjgl_input_Joystick_POV_SOUTH 18000L +#undef org_lwjgl_input_Joystick_POV_EAST +#define org_lwjgl_input_Joystick_POV_EAST 27000L +#undef org_lwjgl_input_Joystick_POV_WEST +#define org_lwjgl_input_Joystick_POV_WEST 9000L +/* Inaccessible static: class_00024org_00024lwjgl_00024input_00024Joystick */ /* * Class: org_lwjgl_input_Joystick - * Method: initIDs + * Method: nPoll * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_initIDs - (JNIEnv *, jclass); +JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nPoll + (JNIEnv *, jobject); /* * Class: org_lwjgl_input_Joystick @@ -34,7 +33,7 @@ * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nCreate - (JNIEnv *, jclass); + (JNIEnv *, jobject); /* * Class: org_lwjgl_input_Joystick @@ -42,46 +41,14 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nDestroy - (JNIEnv *, jclass); + (JNIEnv *, jobject); /* * Class: org_lwjgl_input_Joystick - * Method: nPoll + * Method: initIDs * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nPoll - (JNIEnv *, jclass); - -/* - * Class: org_lwjgl_input_Joystick - * Method: nGetNumButtons - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nGetNumButtons - (JNIEnv *, jclass); - -/* - * Class: org_lwjgl_input_Joystick - * Method: nHasZValue - * Signature: ()Z - */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nHasZValue - (JNIEnv *, jclass); - -/* - * Class: org_lwjgl_input_Joystick - * Method: nRead - * Signature: (I)I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nRead - (JNIEnv *, jclass, jint); - -/* - * Class: org_lwjgl_input_Joystick - * Method: nEnableBuffer - * Signature: ()I - */ -JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nEnableBuffer +JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_initIDs (JNIEnv *, jclass); #ifdef __cplusplus |
From: Elias N. <eli...@us...> - 2002-11-17 17:09:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv29961 Modified Files: Game.java Makefile Added Files: checkGLerror.h Log Message: Added debug support --- NEW FILE: checkGLerror.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/checkGLerror.h /* checkGLerror.h Author: C. Prince Created: 8 November 2001 Error checking for OpenGL bindings */ #ifndef _CHECKGLERROR_H_INCLUDED_ #define _CHECKGLERROR_H_INCLUDED_ #ifdef _DEBUG #include <jni.h> #include <GL/glu.h> #define CHECK_GL_ERROR \ { \ int err = glGetError(); \ if (err != GL_NO_ERROR) { \ jclass cls = (*env)->FindClass(env, "org/lwjgl/opengl/OpenGLException"); \ (*env)->ThrowNew(env, cls, (const char *)gluErrorString(err)); \ (*env)->DeleteLocalRef(env, cls); \ } \ } #else #define CHECK_GL_ERROR #endif /* _DEBUG */ #endif /* _CHECKGLERROR_H_INCLUDED_ */ Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Game.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Game.java 17 Nov 2002 16:49:16 -0000 1.5 +++ Game.java 17 Nov 2002 17:09:40 -0000 1.6 @@ -33,7 +33,7 @@ /** * $Id$ * - * Simple test java program. + * Simple java test program. * * @author elias_naur <eli...@us...> * @version $Revision$ Index: Makefile CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile 15 Nov 2002 11:10:32 -0000 1.2 +++ Makefile 17 Nov 2002 17:09:40 -0000 1.3 @@ -42,25 +42,25 @@ GCC = gcc LINK = gcc JAVAHOME=/usr/java/j2sdk1.4.1_01 -JAVAC=$(JAVAHOME)/bin/javac -JAVAH=$(JAVAHOME)/bin/javah -CP=../../java -JAVAFILES=$(shell find ../../java -name \*.java -print|grep -v CVS) -CLASSFILES=$(JAVAFILES:.java=.class) +LIBOBJS=org_lwjgl_Display.o org_lwjgl_Sys.o org_lwjgl_opengl_BaseGL.o org_lwjgl_opengl_GL.o org_lwjgl_opengl_CoreGL.o org_lwjgl_input_Keyboard.o org_lwjgl_opengl_GLU.o org_lwjgl_input_Mouse.o +DEBUG_FLAGS=-D_DEBUG +LINKOPTS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU all: liblwjgl.so -liblwjgl.so: org_lwjgl_Display.o org_lwjgl_Sys.o org_lwjgl_opengl_BaseGL.o org_lwjgl_opengl_GL.o org_lwjgl_opengl_CoreGL.o org_lwjgl_input_Keyboard.o org_lwjgl_opengl_GLU.o org_lwjgl_input_Mouse.o - $(LINK) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU + +liblwjgl_d.so: $(LIBOBJS) + $(LINK) -shared -o $@ $^ $(LINKOPTS) cp $@ ../../../bin/ -.SUFFIXES: .cpp .so .o .java .h .class +liblwjgl.so: $(LIBOBJS) + $(LINK) -shared -o $@ $^ $(LINKOPTS) + cp $@ ../../../bin/ -%.class: %.java - $(JAVAC) -deprecation -O -source 1.4 -classpath $(CP) $< +.SUFFIXES: .cpp .so .o .java .h .class %.o : %.c - $(GCC) -Wall -I$(JAVAHOME)/include -I../common -I$(JAVAHOME)/include/linux -c -o $@ $< + $(GCC) $(DEBUG_FLAGS) -Wall -I$(JAVAHOME)/include -I../common -I$(JAVAHOME)/include/linux -c -o $@ $< testprog : main.o $(LINK) -o $@ $< -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU |
From: Elias N. <eli...@us...> - 2002-11-17 16:49:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv723 Modified Files: Game.java org_lwjgl_input_Mouse.c Log Message: Cursor z movement added Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Game.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Game.java 16 Nov 2002 20:10:42 -0000 1.4 +++ Game.java 17 Nov 2002 16:49:16 -0000 1.5 @@ -109,8 +109,8 @@ angle = 0.0f; Mouse.poll(); - if (Mouse.dx != 0 || Mouse.dy != 0) - System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy); + if (Mouse.dx != 0 || Mouse.dy != 0 || Mouse.dz != 0) + System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy + " " + Mouse.dz); for (int i = 0; i < 8; i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); Index: org_lwjgl_input_Mouse.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_input_Mouse.c 17 Nov 2002 16:14:53 -0000 1.3 +++ org_lwjgl_input_Mouse.c 17 Nov 2002 16:49:16 -0000 1.4 @@ -46,7 +46,7 @@ #include <string.h> #include "org_lwjgl_input_Mouse.h" -#define NUM_BUTTONS 8 +#define NUM_BUTTONS 3 extern Display *disp; extern Window win; @@ -58,8 +58,10 @@ int last_x; int last_y; +int last_z; int current_x; int current_y; +int current_z; unsigned char buttons[NUM_BUTTONS]; Cursor blank_cursor; @@ -107,10 +109,10 @@ gc_values.foreground = 0; GC gc = XCreateGC(disp, mask, GCForeground, &gc_values); XFillRectangle(disp, mask, gc, 0, 0, best_width, best_height); + XFreeGC(disp, gc); XColor dummy_color; blank_cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0); XFreePixmap(disp, mask); - XFreeGC(disp, gc); XDefineCursor(disp, win, blank_cursor); return 1; } @@ -124,7 +126,7 @@ (JNIEnv * env, jclass clazz) { int i; - current_x = current_y = last_x = last_y = 0; + current_x = current_y = current_z = last_x = last_y = last_z = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; if (!blankCursor()) { @@ -145,6 +147,25 @@ /* * Class: org_lwjgl_input_Mouse + * Method: nGetNumButtons + * Signature: ()I + */ +JNIEXPORT jint JNICALL Java_org_lwjgl_input_Mouse_nGetNumButtons(JNIEnv *env, jclass clazz) { + return (jint)NUM_BUTTONS; +} + +/* + * Class: org_lwjgl_input_Mouse + * Method: nHasZValue + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nHasZValue(JNIEnv *env, jclass clazz) { + return JNI_TRUE; +} + + +/* + * Class: org_lwjgl_input_Mouse * Method: nDestroy * Signature: ()V */ @@ -156,27 +177,6 @@ XUngrabPointer(disp, CurrentTime); } -void setButtonState(XButtonEvent event, unsigned char val) { - switch (event.button) { - case Button1: - buttons[0] = val; - break; - case Button2: - buttons[1] = val; - break; - case Button3: - buttons[2] = val; - break; - case Button4: - buttons[3] = val; - break; - case Button5: - buttons[4] = val; - break; - default: assert(0); - } -} - int checkPointer() { XEvent event; int count = 0; @@ -184,10 +184,41 @@ count++; switch (event.type) { case ButtonPress: - setButtonState(event.xbutton, 1); + switch (event.xbutton.button) { + case Button1: + buttons[0] = 1; + break; + case Button2: + buttons[1] = 1; + break; + case Button3: + buttons[2] = 1; + break; + case Button4: + current_z--; + break; + case Button5: + current_z++; + break; + default: assert(0); + } break; case ButtonRelease: - setButtonState(event.xbutton, 0); + switch (event.xbutton.button) { + case Button1: + buttons[0] = 0; + break; + case Button2: + buttons[1] = 0; + break; + case Button3: + buttons[2] = 0; + break; + case Button4: /* Fall through */ + case Button5: + break; + default: assert(0); + } break; case MotionNotify: current_x = event.xbutton.x; @@ -210,11 +241,13 @@ checkPointer(); int moved_x = current_x - last_x; int moved_y = current_y - last_y; + int moved_z = current_z - last_z; (*env)->SetStaticIntField(env, clazz, fid_dx, (jint)moved_x); (*env)->SetStaticIntField(env, clazz, fid_dy, (jint)moved_y); - (*env)->SetStaticIntField(env, clazz, fid_dz, (jint)0); + (*env)->SetStaticIntField(env, clazz, fid_dz, (jint)moved_z); last_x = current_x; last_y = current_y; + last_z = current_z; jbooleanArray buttonsArray = (jbooleanArray) (*env)->GetStaticObjectField(env, clazz, fid_button); unsigned char * class_buttons = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, buttonsArray, NULL); memcpy(class_buttons, buttons, NUM_BUTTONS*sizeof(unsigned char)); |
From: Elias N. <eli...@us...> - 2002-11-17 16:14:56
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv23498 Modified Files: org_lwjgl_Display.c org_lwjgl_input_Mouse.c Log Message: Cursor blanking added Index: org_lwjgl_Display.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_Display.c 16 Nov 2002 20:10:42 -0000 1.5 +++ org_lwjgl_Display.c 17 Nov 2002 16:14:53 -0000 1.6 @@ -102,10 +102,18 @@ return JNI_FALSE; } screen = DefaultScreen(disp); + if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { + XCloseDisplay(disp); +#ifdef _DEBUG + printf("Could not get display modes\n"); +#endif + return JNI_FALSE; + } root_win = RootWindow(disp, screen); vis_info = glXChooseVisual(disp, screen, attriblist); if (vis_info == NULL) { + XCloseDisplay(disp); #ifdef _DEBUG printf("Could not choose glx visual\n"); #endif @@ -129,18 +137,16 @@ if (fullscreen) { XMapRaised(disp, win); waitMapped(disp, win); - if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { -#ifdef _DEBUG - printf("Could not get display modes\n"); -#endif - return JNI_FALSE; - } for ( i = 0; i < num_modes; ++i ) { #ifdef _DEBUG printf("Mode %d: %dx%d\n", i, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay); #endif if (avail_modes[i]->hdisplay == width && avail_modes[i]->vdisplay == height) { if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[i])) { + XFree(vis_info); + XFree(avail_modes); + XDestroyWindow(disp, win); + XCloseDisplay(disp); #ifdef _DEBUG printf("Could not switch mode\n"); #endif @@ -167,8 +173,8 @@ printf("Could not switch mode\n"); #endif } - XFree(avail_modes); } + XFree(avail_modes); XFree(vis_info); XCloseDisplay(disp); #ifdef _DEBUG Index: org_lwjgl_input_Mouse.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_input_Mouse.c 15 Nov 2002 11:10:32 -0000 1.2 +++ org_lwjgl_input_Mouse.c 17 Nov 2002 16:14:53 -0000 1.3 @@ -62,6 +62,8 @@ int current_y; unsigned char buttons[NUM_BUTTONS]; +Cursor blank_cursor; + /* * Class: org_lwjgl_input_Mouse * Method: initIDs @@ -92,6 +94,27 @@ } } +int blankCursor(void) { + int best_width, best_height; + if (XQueryBestCursor(disp, win, 1, 1, &best_width, &best_height) == 0) { +#ifdef _DEBUG + printf("Could not query best cursor size\n"); +#endif + return 0; + } + Pixmap mask = XCreatePixmap(disp, win, best_width, best_height, 1); + XGCValues gc_values; + gc_values.foreground = 0; + GC gc = XCreateGC(disp, mask, GCForeground, &gc_values); + XFillRectangle(disp, mask, gc, 0, 0, best_width, best_height); + XColor dummy_color; + blank_cursor = XCreatePixmapCursor(disp, mask, mask, &dummy_color, &dummy_color, 0, 0); + XFreePixmap(disp, mask); + XFreeGC(disp, gc); + XDefineCursor(disp, win, blank_cursor); + return 1; +} + /* * Class: org_lwjgl_input_Mouse * Method: nCreate @@ -104,6 +127,12 @@ current_x = current_y = last_x = last_y = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; + if (!blankCursor()) { +#ifdef _DEBUG + printf("Could not blank cursor\n"); +#endif + return JNI_FALSE; + } int result = XGrabPointer(disp, win, False, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); if (result != GrabSuccess) { #ifdef _DEBUG @@ -122,6 +151,8 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { + XUndefineCursor(disp, win); + XFreeCursor(disp, blank_cursor); XUngrabPointer(disp, CurrentTime); } |
From: Elias N. <eli...@us...> - 2002-11-16 20:10:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv11174 Modified Files: Game.java org_lwjgl_Display.c org_lwjgl_Sys.c Log Message: Added Sys setPriority support Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Game.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Game.java 16 Nov 2002 19:46:18 -0000 1.3 +++ Game.java 16 Nov 2002 20:10:42 -0000 1.4 @@ -152,6 +152,7 @@ Keyboard.enableBuffer(); Mouse.create(); Sys.setTime(0); + Sys.setProcessPriority(Sys.REALTIME_PRIORITY); System.out.println("Timer resolution: " + Sys.getTimerResolution()); // Go into orthographic projection mode. gl.matrixMode(GL.PROJECTION); Index: org_lwjgl_Display.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_Display.c 15 Nov 2002 11:10:32 -0000 1.4 +++ org_lwjgl_Display.c 16 Nov 2002 20:10:42 -0000 1.5 @@ -54,6 +54,7 @@ Display * disp; int screen; +int current_fullscreen; Window win; XF86VidModeModeInfo **avail_modes; XVisualInfo * vis_info; @@ -92,6 +93,7 @@ int attriblist[] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_RED_SIZE, bpe, GLX_GREEN_SIZE, bpe, GLX_BLUE_SIZE, bpe, GLX_ALPHA_SIZE, bpe, None}; int num_modes, i; + current_fullscreen = fullscreen; disp = XOpenDisplay(NULL); if (disp == NULL) { #ifdef _DEBUG @@ -159,13 +161,15 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Display_nDestroy(JNIEnv * env, jclass clazz) { XDestroyWindow(disp, win); - if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[0])) { + if (current_fullscreen) { + if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[0])) { #ifdef _DEBUG - printf("Could not switch mode\n"); + printf("Could not switch mode\n"); #endif + } + XFree(avail_modes); } XFree(vis_info); - XFree(avail_modes); XCloseDisplay(disp); #ifdef _DEBUG printf("Closed X connection\n"); Index: org_lwjgl_Sys.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_Sys.c 16 Nov 2002 19:46:18 -0000 1.3 +++ org_lwjgl_Sys.c 16 Nov 2002 20:10:42 -0000 1.4 @@ -40,6 +40,7 @@ */ #include <sys/time.h> +#include <sys/resource.h> #include "org_lwjgl_Sys.h" long int hires_timer_freq; // Hires timer frequency @@ -128,29 +129,27 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority (JNIEnv * env, jclass clazz, jint priority) { -/* HANDLE me = GetCurrentProcess(); - int win32priority; - + int linux_priority; switch (priority) { case org_lwjgl_Sys_REALTIME_PRIORITY: - win32priority = REALTIME_PRIORITY_CLASS; + linux_priority = -20; break; case org_lwjgl_Sys_HIGH_PRIORITY: - win32priority = HIGH_PRIORITY_CLASS; + linux_priority = -10; break; case org_lwjgl_Sys_NORMAL_PRIORITY: - win32priority = NORMAL_PRIORITY_CLASS; + linux_priority = 0; break; case org_lwjgl_Sys_LOW_PRIORITY: - win32priority = IDLE_PRIORITY_CLASS; + linux_priority = 20; break; default: return; } - if (!SetPriorityClass(me, win32priority)) { + if (setpriority(PRIO_PROCESS, 0, linux_priority) == -1) { #ifdef _DEBUG - printf("Failed to set priority class.\n"); + printf("Failed to set priority.\n"); #endif - }*/ + } } |
From: Elias N. <eli...@us...> - 2002-11-16 19:46:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv29246 Modified Files: Game.java org_lwjgl_Sys.c Log Message: Added Sys timer support Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Game.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Game.java 15 Nov 2002 11:10:32 -0000 1.2 +++ Game.java 16 Nov 2002 19:46:18 -0000 1.3 @@ -118,10 +118,12 @@ if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) finished = true;*/ Keyboard.read(); - if (Keyboard.getNumKeyboardEvents() > 0) { + for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { Keyboard.next(); if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) finished = true; + if (Keyboard.key == Keyboard.KEY_T && Keyboard.state) + System.out.println("Current time: " + Sys.getTime()); } } @@ -149,6 +151,8 @@ Keyboard.create(); Keyboard.enableBuffer(); Mouse.create(); + Sys.setTime(0); + System.out.println("Timer resolution: " + Sys.getTimerResolution()); // Go into orthographic projection mode. gl.matrixMode(GL.PROJECTION); gl.loadIdentity(); Index: org_lwjgl_Sys.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_Sys.c 15 Nov 2002 11:10:32 -0000 1.2 +++ org_lwjgl_Sys.c 16 Nov 2002 19:46:18 -0000 1.3 @@ -39,6 +39,7 @@ * @version $Revision$ */ +#include <sys/time.h> #include "org_lwjgl_Sys.h" long int hires_timer_freq; // Hires timer frequency @@ -78,6 +79,20 @@ return hires_timer_freq; } +long queryTime(void) { + struct timeval tv; + if (gettimeofday(&tv, NULL) == -1) { +#ifdef _DEBUG + printf("Could not read current time\n"); +#endif + } + long result = tv.tv_sec * 1000000l + tv.tv_usec; +#ifdef _DEBUG + printf("Current time (native): %ld\n", result); +#endif + return result; +} + /* * Class: org_lwjgl_Sys * Method: getTime @@ -86,7 +101,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTime (JNIEnv * env, jclass clazz) { -// QueryPerformanceCounter((LARGE_INTEGER*) &hires_timer); + hires_timer = queryTime(); hires_timer -= hires_timer_start; return hires_timer; } @@ -99,8 +114,9 @@ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setTime (JNIEnv * env, jclass clazz, jlong startTime) { -/* QueryPerformanceFrequency((LARGE_INTEGER*) &hires_timer_freq); - QueryPerformanceCounter((LARGE_INTEGER*) &hires_timer_start);*/ + hires_timer_start = queryTime(); + // We don't have a real resolution so assume highest possible + hires_timer_freq = 1000000; hires_timer_start -= startTime; } |
From: Elias N. <eli...@us...> - 2002-11-15 11:11:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv16028 Modified Files: Game.java Makefile org_lwjgl_Display.c org_lwjgl_Sys.c org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_BaseGL.c org_lwjgl_opengl_CoreGL.c org_lwjgl_opengl_GL.c org_lwjgl_opengl_GLU.c Log Message: Corrected revision and id tags Index: Game.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Game.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Game.java 15 Nov 2002 10:40:54 -0000 1.1 +++ Game.java 15 Nov 2002 11:10:32 -0000 1.2 @@ -1,3 +1,44 @@ +/* + * 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$ + * + * Simple test java program. + * + * @author elias_naur <eli...@us...> + * @version $Revision$ + */ + import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; Index: Makefile CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile 15 Nov 2002 10:40:55 -0000 1.1 +++ Makefile 15 Nov 2002 11:10:32 -0000 1.2 @@ -1,3 +1,44 @@ + +# 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$ +# +# Linux specific Makefile to compile liblwjgl.so. +# +# author elias_naur <eli...@us...> +# version $Revision$ +# + GCC = gcc LINK = gcc JAVAHOME=/usr/java/j2sdk1.4.1_01 Index: org_lwjgl_Display.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_Display.c 15 Nov 2002 11:00:19 -0000 1.3 +++ org_lwjgl_Display.c 15 Nov 2002 11:10:32 -0000 1.4 @@ -33,7 +33,7 @@ /** * $Id$ * - * Linux specific library for display handdling. + * Linux specific library for display handling. * * @author elias_naur <eli...@us...> * @version $Revision$ Index: org_lwjgl_Sys.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Sys.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_Sys.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Win32 system library. + * Linux system library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_input_Keyboard.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Keyboard.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_input_Keyboard.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Win32 keyboard handling. + * Linux keyboard handling. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_input_Mouse.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_input_Mouse.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_input_Mouse.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Win32 mouse handling. + * Linux mouse handling. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_opengl_BaseGL.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_BaseGL.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_opengl_BaseGL.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -33,9 +33,9 @@ /** * $Id$ * - * Base Win32 functionality for GL. + * Base linux functionality for GL. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_opengl_CoreGL.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_CoreGL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_CoreGL.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_CoreGL.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_opengl_CoreGL.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -35,7 +35,7 @@ * * Core OpenGL functions. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_opengl_GL.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GL.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_GL.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_opengl_GL.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -35,7 +35,7 @@ * * GL extensions library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ Index: org_lwjgl_opengl_GLU.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GLU.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GLU.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_GLU.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_opengl_GLU.c 15 Nov 2002 11:10:32 -0000 1.2 @@ -35,7 +35,7 @@ * * GLU library. * - * @author cix_foo <ci...@us...> + * @author elias_naur <eli...@us...> * @version $Revision$ */ |
From: Elias N. <eli...@us...> - 2002-11-15 11:01:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv12861 Modified Files: org_lwjgl_Display.c Log Message: corrected id and revisions tags Index: org_lwjgl_Display.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_Display.c 15 Nov 2002 10:58:57 -0000 1.2 +++ org_lwjgl_Display.c 15 Nov 2002 11:00:19 -0000 1.3 @@ -31,12 +31,12 @@ */ /** - * $id$ + * $Id$ * * Linux specific library for display handdling. * * @author elias_naur <eli...@us...> - * @version $revision$ + * @version $Revision$ */ |
From: Elias N. <eli...@us...> - 2002-11-15 11:00:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv12347 Modified Files: org_lwjgl_Display.c Log Message: corrected revision and id Index: org_lwjgl_Display.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Display.c 15 Nov 2002 10:40:55 -0000 1.1 +++ org_lwjgl_Display.c 15 Nov 2002 10:58:57 -0000 1.2 @@ -1,3 +1,45 @@ +/* + * 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$ + * + * Linux specific library for display handdling. + * + * @author elias_naur <eli...@us...> + * @version $revision$ + */ + + #include <X11/X.h> #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> |
From: Elias N. <eli...@us...> - 2002-11-15 10:42:10
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory usw-pr-cvs1:/tmp/cvs-serv7181 Added Files: Game.java Makefile org_lwjgl_Display.c org_lwjgl_Sys.c org_lwjgl_input_Keyboard.c org_lwjgl_input_Mouse.c org_lwjgl_opengl_BaseGL.c org_lwjgl_opengl_CoreGL.c org_lwjgl_opengl_GL.c org_lwjgl_opengl_GLU.c Log Message: Added linux native src files --- NEW FILE: Game.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Game.java import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; public final class Game { static { try { DisplayMode[] modes = Display.getAvailableDisplayModes(); System.out.println("Available display modes:"); for (int i = 0; i < modes.length; i ++) System.out.println(modes[i]); // For now let's just pick a mode we're certain to have Display.create(new DisplayMode(640, 480, 16, 60), true); System.out.println("Created display."); } catch (Exception e) { System.err.println("Failed to create display due to "+e); System.exit(1); } } public static final GL gl = new GL(16, 0, 16, 8); public static final GLU glu = new GLU(gl); static { try { gl.create(); System.out.println("Created OpenGL."); } catch (Exception e) { System.err.println("Failed to create OpenGL due to "+e); System.exit(1); } } /** Is the game finished? */ private static boolean finished; /** A rotating square! */ private static float angle; /** * No construction allowed */ private Game() { } public static void main(String[] arguments) { try { init(); while (!finished) { // Keyboard.poll(); mainLoop(); render(); gl.swapBuffers(); } } catch (Throwable t) { t.printStackTrace(); } finally { cleanup(); } } /** * All calculations are done in here */ private static void mainLoop() { angle += 1f; if (angle > 360.0f) angle = 0.0f; Mouse.poll(); if (Mouse.dx != 0 || Mouse.dy != 0) System.out.println("Mouse moved " + Mouse.dx + " " + Mouse.dy); for (int i = 0; i < 8; i++) if (Mouse.isButtonDown(i)) System.out.println("Button " + i + " down"); /* Keyboard.poll(); if (Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) finished = true;*/ Keyboard.read(); if (Keyboard.getNumKeyboardEvents() > 0) { Keyboard.next(); if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) finished = true; } } /** * All rendering is done in here */ private static void render() { gl.clear(GL.COLOR_BUFFER_BIT); gl.pushMatrix(); gl.translatef(Display.getWidth() / 2, Display.getHeight() / 2, 0.0f); gl.rotatef(angle, 0, 0, 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(); } /** * Initialize */ private static void init() throws Exception { Keyboard.create(); Keyboard.enableBuffer(); Mouse.create(); // Go into orthographic projection mode. gl.matrixMode(GL.PROJECTION); gl.loadIdentity(); glu.ortho2D(0, Display.getWidth(), 0, Display.getHeight()); gl.matrixMode(GL.MODELVIEW); gl.loadIdentity(); gl.viewport(0, 0, Display.getWidth(), Display.getHeight()); // Fix the refresh rate to the display frequency. gl.wglSwapIntervalEXT(1); } /** * Cleanup */ private static void cleanup() { Keyboard.destroy(); Mouse.destroy(); gl.destroy(); Display.destroy(); } } --- NEW FILE: Makefile --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile GCC = gcc LINK = gcc JAVAHOME=/usr/java/j2sdk1.4.1_01 JAVAC=$(JAVAHOME)/bin/javac JAVAH=$(JAVAHOME)/bin/javah CP=../../java JAVAFILES=$(shell find ../../java -name \*.java -print|grep -v CVS) CLASSFILES=$(JAVAFILES:.java=.class) all: liblwjgl.so liblwjgl.so: org_lwjgl_Display.o org_lwjgl_Sys.o org_lwjgl_opengl_BaseGL.o org_lwjgl_opengl_GL.o org_lwjgl_opengl_CoreGL.o org_lwjgl_input_Keyboard.o org_lwjgl_opengl_GLU.o org_lwjgl_input_Mouse.o $(LINK) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU cp $@ ../../../bin/ .SUFFIXES: .cpp .so .o .java .h .class %.class: %.java $(JAVAC) -deprecation -O -source 1.4 -classpath $(CP) $< %.o : %.c $(GCC) -Wall -I$(JAVAHOME)/include -I../common -I$(JAVAHOME)/include/linux -c -o $@ $< testprog : main.o $(LINK) -o $@ $< -L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU .PHONY clean: rm -rf *.o *.so rm -rf `find ../../ -name \*.class -print` --- NEW FILE: org_lwjgl_Display.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.c #include <X11/X.h> #include <X11/Xlib.h> #include <X11/extensions/xf86vmode.h> #include <GL/glx.h> #include <X11/Xutil.h> #include <GL/gl.h> #include <GL/glu.h> #include <stdio.h> #include <jni.h> #include "org_lwjgl_Display.h" Display * disp; int screen; Window win; XF86VidModeModeInfo **avail_modes; XVisualInfo * vis_info; void waitMapped(Display *disp, Window win) { XEvent event; do { XMaskEvent(disp, StructureNotifyMask, &event); } while ((event.type != MapNotify) || (event.xmap.event != win)); } int getDisplayModes(Display *disp, int screen, int *num_modes, XF86VidModeModeInfo ***avail_modes) { unsigned int event_base, error_base, xvid_ver, xvid_rev; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { #ifdef _DEBUG printf("XF86VidMode extention not available\n"); #endif return 0; } XF86VidModeQueryVersion(disp, &xvid_ver, &xvid_rev); #ifdef _DEBUG printf("XF86VidMode extention version %i.%i\n", xvid_ver, xvid_rev); #endif XF86VidModeGetAllModeLines(disp, screen, num_modes, avail_modes); return 1; } JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_nCreate(JNIEnv * env, jclass clazz, jint width, jint height, jint bpp, jint freq, jboolean fullscreen) { Window root_win; XSetWindowAttributes attribs; Colormap cmap; int attribmask; int bpe = bpp/4; int attriblist[] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_RED_SIZE, bpe, GLX_GREEN_SIZE, bpe, GLX_BLUE_SIZE, bpe, GLX_ALPHA_SIZE, bpe, None}; int num_modes, i; disp = XOpenDisplay(NULL); if (disp == NULL) { #ifdef _DEBUG printf("Could not open X connection\n"); #endif return JNI_FALSE; } screen = DefaultScreen(disp); root_win = RootWindow(disp, screen); vis_info = glXChooseVisual(disp, screen, attriblist); if (vis_info == NULL) { #ifdef _DEBUG printf("Could not choose glx visual\n"); #endif return JNI_FALSE; } cmap = XCreateColormap(disp, root_win, vis_info->visual, AllocNone); attribs.colormap = cmap; attribs.event_mask = ExposureMask | FocusChangeMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask; attribs.background_pixel = 0xFF000000; attribs.event_mask = StructureNotifyMask; attribmask = CWColormap | CWBackPixel | CWEventMask; if (fullscreen) { attribmask |= CWOverrideRedirect; attribs.override_redirect = True; } win = XCreateWindow(disp, root_win, 0, 0, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); #ifdef _DEBUG printf("Created window\n"); #endif if (fullscreen) { XMapRaised(disp, win); waitMapped(disp, win); if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { #ifdef _DEBUG printf("Could not get display modes\n"); #endif return JNI_FALSE; } for ( i = 0; i < num_modes; ++i ) { #ifdef _DEBUG printf("Mode %d: %dx%d\n", i, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay); #endif if (avail_modes[i]->hdisplay == width && avail_modes[i]->vdisplay == height) { if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[i])) { #ifdef _DEBUG printf("Could not switch mode\n"); #endif return JNI_FALSE; } } } XF86VidModeSetViewPort(disp, screen, 0, 0); } else { XMapWindow(disp, win); waitMapped(disp, win); } XClearWindow(disp, win); XSync(disp, True); return JNI_TRUE; } JNIEXPORT void JNICALL Java_org_lwjgl_Display_nDestroy(JNIEnv * env, jclass clazz) { XDestroyWindow(disp, win); if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[0])) { #ifdef _DEBUG printf("Could not switch mode\n"); #endif } XFree(vis_info); XFree(avail_modes); XCloseDisplay(disp); #ifdef _DEBUG printf("Closed X connection\n"); #endif } /* * Class: org_lwjgl_Display * Method: getAvailableDisplayModes * Signature: ()[Lorg/lwjgl/DisplayMode; */ JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_Display_getAvailableDisplayModes (JNIEnv * env, jclass clazz) { int num_modes, i; Display *disp = XOpenDisplay(NULL); 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 return NULL; } if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { #ifdef _DEBUG printf("Could not get display modes\n"); #endif return NULL; } // Allocate an array of DisplayModes big enough jclass displayModeClass = (*env)->FindClass(env, "org/lwjgl/DisplayMode"); jobjectArray ret = (*env)->NewObjectArray(env, num_modes, displayModeClass, NULL); jmethodID displayModeConstructor = (*env)->GetMethodID(env, displayModeClass, "<init>", "(IIII)V"); for (i = 0; i < num_modes; i++) { jobject displayMode = (*env)->NewObject(env, displayModeClass, displayModeConstructor, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay, depth, 0); (*env)->SetObjectArrayElement(env, ret, i, displayMode); } XFree(avail_modes); XCloseDisplay(disp); return ret; } --- NEW FILE: org_lwjgl_Sys.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.c /* * 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_Sys.c,v 1.1 2002/11/15 10:40:55 elias_naur Exp $ * * Win32 system library. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_Sys.h" long int hires_timer_freq; // Hires timer frequency long int hires_timer_start; // Hires timer start long int hires_timer; // Hires timer current time /* * Class: org_lwjgl_Sys * Method: getDirectBufferAddress * Signature: (Ljava/nio/Buffer;)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress (JNIEnv * env, jclass clazz, jobject buf) { return (jint) (*env)->GetDirectBufferAddress(env, buf); } /* * Class: org_lwjgl_Sys * Method: createDirectBuffer * Signature: (II)Ljava/nio/ByteBuffer; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_Sys_createDirectBuffer (JNIEnv * env, jclass clazz, jint address, jint length) { return (*env)->NewDirectByteBuffer(env, (void *)address, length); } /* * Class: org_lwjgl_Sys * Method: getTimerResolution * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTimerResolution (JNIEnv * env, jclass clazz) { return hires_timer_freq; } /* * Class: org_lwjgl_Sys * Method: getTime * Signature: ()J */ JNIEXPORT jlong JNICALL Java_org_lwjgl_Sys_getTime (JNIEnv * env, jclass clazz) { // QueryPerformanceCounter((LARGE_INTEGER*) &hires_timer); hires_timer -= hires_timer_start; return hires_timer; } /* * Class: org_lwjgl_Sys * Method: setTime * Signature: (J)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setTime (JNIEnv * env, jclass clazz, jlong startTime) { /* QueryPerformanceFrequency((LARGE_INTEGER*) &hires_timer_freq); QueryPerformanceCounter((LARGE_INTEGER*) &hires_timer_start);*/ hires_timer_start -= startTime; } /* * Class: org_lwjgl_Sys * Method: setProcessPriority * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setProcessPriority (JNIEnv * env, jclass clazz, jint priority) { /* HANDLE me = GetCurrentProcess(); int win32priority; switch (priority) { case org_lwjgl_Sys_REALTIME_PRIORITY: win32priority = REALTIME_PRIORITY_CLASS; break; case org_lwjgl_Sys_HIGH_PRIORITY: win32priority = HIGH_PRIORITY_CLASS; break; case org_lwjgl_Sys_NORMAL_PRIORITY: win32priority = NORMAL_PRIORITY_CLASS; break; case org_lwjgl_Sys_LOW_PRIORITY: win32priority = IDLE_PRIORITY_CLASS; break; default: return; } if (!SetPriorityClass(me, win32priority)) { #ifdef _DEBUG printf("Failed to set priority class.\n"); #endif }*/ } --- NEW FILE: org_lwjgl_input_Keyboard.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.c /* * 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_input_Keyboard.c,v 1.1 2002/11/15 10:40:55 elias_naur Exp $ * * Win32 keyboard handling. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <string.h> #include <assert.h> #include "org_lwjgl_input_Keyboard.h" #define KEYBOARD_BUFFER_SIZE 50 #define KEYBOARD_SIZE 256 short readBuffer[KEYBOARD_BUFFER_SIZE]; jfieldID fid_readBuffer; jfieldID fid_readBufferAddress; unsigned char key_buf[KEYBOARD_SIZE]; extern Display *disp; extern Window win; /* * Class: org_lwjgl_input_Keyboard * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_initIDs (JNIEnv * env, jclass clazz) { // Get a global class instance, just to be sure static jobject globalClassLock = NULL; if (globalClassLock == NULL) { globalClassLock = (*env)->NewGlobalRef(env, clazz); } fid_readBuffer = (*env)->GetStaticFieldID(env, clazz, "readBuffer", "Ljava/nio/ByteBuffer;"); fid_readBufferAddress = (*env)->GetStaticFieldID(env, clazz, "readBufferAddress", "I"); } /* * Class: org_lwjgl_input_Keyboard * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Keyboard_nCreate (JNIEnv * env, jclass clazz) { int result = XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); if (result != GrabSuccess) { #ifdef _DEBUG printf("Could not grab keyboard\n"); #endif return JNI_FALSE; } memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); return JNI_TRUE; } /* * Class: org_lwjgl_input_Keyboard * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nDestroy (JNIEnv * env, jclass clazz) { XUngrabKeyboard(disp, CurrentTime); } int checkKeyEvents(unsigned char *result_buf) { XEvent event; int count = 0; int buf_count = 0; while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { unsigned char keycode = (unsigned char)((event.xkey.keycode - 8) & 0xff); if (result_buf != NULL) { result_buf[buf_count++] = keycode; result_buf[buf_count++] = 1; } count++; if (event.type == KeyPress) { key_buf[keycode] = 1; } else if (event.type == KeyRelease) { key_buf[keycode] = 0; } else assert(0); } return count; } /* * Class: org_lwjgl_input_Keyboard * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll (JNIEnv * env, jclass clazz, jint buf) { checkKeyEvents(NULL); memcpy((unsigned char*)buf, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); } /* * Class: org_lwjgl_input_Keyboard * Method: nRead * Signature: (I)V */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nRead (JNIEnv * env, jclass clazz, jint keys) { return checkKeyEvents((unsigned char *)keys); } /* * Class: org_lwjgl_input_Keyboard * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Keyboard_nEnableBuffer (JNIEnv * env, jclass clazz) { jobject newBuffer = (*env)->NewDirectByteBuffer(env, &readBuffer, KEYBOARD_BUFFER_SIZE); (*env)->SetStaticObjectField(env, clazz, fid_readBuffer, newBuffer); (*env)->SetStaticIntField(env, clazz, fid_readBufferAddress, (jint) (&readBuffer)); return KEYBOARD_BUFFER_SIZE; } --- NEW FILE: org_lwjgl_input_Mouse.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.c /* * 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_input_Mouse.c,v 1.1 2002/11/15 10:40:55 elias_naur Exp $ * * Win32 mouse handling. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include <X11/X.h> #include <X11/Xlib.h> #include <assert.h> #include <string.h> #include "org_lwjgl_input_Mouse.h" #define NUM_BUTTONS 8 extern Display *disp; extern Window win; jfieldID fid_button; jfieldID fid_dx; jfieldID fid_dy; jfieldID fid_dz; int last_x; int last_y; int current_x; int current_y; unsigned char buttons[NUM_BUTTONS]; /* * Class: org_lwjgl_input_Mouse * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_initIDs (JNIEnv * env, jclass clazz) { // Get a global class instance, just to be sure static jobject globalClassLock = NULL; if (globalClassLock == NULL) { globalClassLock = (*env)->NewGlobalRef(env, clazz); } // Now cache the field IDs: if (fid_button == NULL) { fid_button = (*env)->GetStaticFieldID(env, clazz, "button", "[Z"); } if (fid_dx == NULL) { fid_dx = (*env)->GetStaticFieldID(env, clazz, "dx", "I"); } if (fid_dy == NULL) { fid_dy = (*env)->GetStaticFieldID(env, clazz, "dy", "I"); } if (fid_dz == NULL) { fid_dz = (*env)->GetStaticFieldID(env, clazz, "dz", "I"); } } /* * Class: org_lwjgl_input_Mouse * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Mouse_nCreate (JNIEnv * env, jclass clazz) { int i; current_x = current_y = last_x = last_y = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = 0; int result = XGrabPointer(disp, win, False, PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, win, None, CurrentTime); if (result != GrabSuccess) { #ifdef _DEBUG printf("Could not grab mouse\n"); #endif return JNI_FALSE; } return JNI_TRUE; } /* * Class: org_lwjgl_input_Mouse * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nDestroy (JNIEnv * env, jclass clazz) { XUngrabPointer(disp, CurrentTime); } void setButtonState(XButtonEvent event, unsigned char val) { switch (event.button) { case Button1: buttons[0] = val; break; case Button2: buttons[1] = val; break; case Button3: buttons[2] = val; break; case Button4: buttons[3] = val; break; case Button5: buttons[4] = val; break; default: assert(0); } } int checkPointer() { XEvent event; int count = 0; while (XCheckMaskEvent(disp, ButtonPressMask | ButtonReleaseMask | PointerMotionMask, &event)) { count++; switch (event.type) { case ButtonPress: setButtonState(event.xbutton, 1); break; case ButtonRelease: setButtonState(event.xbutton, 0); break; case MotionNotify: current_x = event.xbutton.x; current_y = event.xbutton.y; break; default: assert(0); } } return count; } /* * Class: org_lwjgl_input_Mouse * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nPoll (JNIEnv * env, jclass clazz) { checkPointer(); int moved_x = current_x - last_x; int moved_y = current_y - last_y; (*env)->SetStaticIntField(env, clazz, fid_dx, (jint)moved_x); (*env)->SetStaticIntField(env, clazz, fid_dy, (jint)moved_y); (*env)->SetStaticIntField(env, clazz, fid_dz, (jint)0); last_x = current_x; last_y = current_y; jbooleanArray buttonsArray = (jbooleanArray) (*env)->GetStaticObjectField(env, clazz, fid_button); unsigned char * class_buttons = (unsigned char *) (*env)->GetPrimitiveArrayCritical(env, buttonsArray, NULL); memcpy(class_buttons, buttons, NUM_BUTTONS*sizeof(unsigned char)); (*env)->ReleasePrimitiveArrayCritical(env, buttonsArray, class_buttons, 0); } --- NEW FILE: org_lwjgl_opengl_BaseGL.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.c /* * 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_opengl_BaseGL.c,v 1.1 2002/11/15 10:40:55 elias_naur Exp $ * * Base Win32 functionality for GL. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include <GL/glx.h> #include "org_lwjgl_opengl_BaseGL.h" GLXContext context = NULL; // OpenGL rendering context extern XVisualInfo * vis_info; extern Window win; extern Display * disp; /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate * Signature: (IIII)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_BaseGL_nCreate (JNIEnv * env, jobject obj, jint colorBits, jint alphaBits, jint depthBits, jint stencilBits) { if (!vis_info) { #ifdef _DEBUG printf("No visual info\n"); #endif return JNI_FALSE; } context = glXCreateContext(disp, vis_info, NULL, True); if (!context) { #ifdef _DEBUG printf("Could not create context\n"); #endif return JNI_FALSE; } return JNI_TRUE; } /* * Class: org_lwjgl_opengl_BaseGL * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroy (JNIEnv * env, jobject obj) { glXMakeCurrent(disp, None, NULL); // Delete the rendering context if (context != NULL) glXDestroyContext(disp, context); } /* * Class: org_lwjgl_opengl_BaseGL * Method: swapBuffers * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers(JNIEnv * env, jobject obj) { glXSwapBuffers(disp, win); } /* * Class: org_lwjgl_opengl_BaseGL * Method: nMakeCurrent * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nMakeCurrent (JNIEnv * env, jobject obj) { glXMakeCurrent(disp, win, context); } --- NEW FILE: org_lwjgl_opengl_CoreGL.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_CoreGL.c /* * 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. * [...3171 lines suppressed...] */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_getColorTableParameteriv (JNIEnv * env, jobject obj, jint target, jint pname, jint params) { glGetColorTableParameteriv(target, pname, (int *)params); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_CoreGL * Method: getColorTableParameterfv * Signature: (III)V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_getColorTableParameterfv (JNIEnv * env, jobject obj, jint target, jint pname, jint params) { glGetColorTableParameterfv(target, pname, (float *)params); CHECK_GL_ERROR } --- NEW FILE: org_lwjgl_opengl_GL.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GL.c /* * 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. * [...4071 lines suppressed...] //CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GL * Method: checkWGLExtensionsString */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL_checkWGLExtensionsString(JNIEnv * env, jclass clazz) { //jfieldID fid_WGL_ARB_extensions_string = env->GetStaticFieldID(clazz, "WGL_ARB_extensions_string", "Z"); //jfieldID fid_WGL_EXT_extensions_string = env->GetStaticFieldID(clazz, "WGL_EXT_extensions_string", "Z"); //if (wglGetExtensionsStringARB) // env->SetStaticBooleanField(clazz, fid_WGL_ARB_extensions_string, JNI_TRUE); //if (wglGetExtensionsStringEXT) // env->SetStaticBooleanField(clazz, fid_WGL_EXT_extensions_string, JNI_TRUE); } --- NEW FILE: org_lwjgl_opengl_GLU.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GLU.c /* * 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_opengl_GLU.c,v 1.1 2002/11/15 10:40:55 elias_naur Exp $ * * GLU library. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_opengl_GLU.h" #include "checkGLerror.h" #include <GL/glu.h> /* * Class: org_lwjgl_opengl_GLU * Method: getString */ JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_getString(JNIEnv * env, jobject obj, jint p0) { const char * msg = (const char *) gluGetString((GLint) p0); jstring ret = (*env)->NewStringUTF(env, msg); return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: errorString */ JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_errorString(JNIEnv * env, jobject obj, jint p0) { const GLubyte * msg = gluErrorString((GLint) p0); jstring ret = (*env)->NewStringUTF(env, (const char *) msg); return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: ortho2D */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_ortho2D(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3) { gluOrtho2D((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: perspective */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_perspective(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3) { gluPerspective((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: pickMatrix */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_pickMatrix(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jint p4) { gluPickMatrix((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, (GLint *) p4); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: lookAt */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_lookAt(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jdouble p4, jdouble p5, jdouble p6, jdouble p7, jdouble p8) { gluLookAt((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, (GLdouble) p4, (GLdouble) p5, (GLdouble) p6, (GLdouble) p7, (GLdouble) p8); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: project */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_project(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (const GLdouble *) p3, (const GLdouble *) p4, (const GLint *) p5, (GLdouble *) p6, (GLdouble *) p7, (GLdouble *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: unProject */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_unProject(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluUnProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (const GLdouble *) p3, (const GLdouble *) p4, (const GLint *) p5, (GLdouble *) p6, (GLdouble *) p7, (GLdouble *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: scaleImage */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_scaleImage(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluScaleImage((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (const void *) p4, (GLint) p5, (GLint) p6, (GLint) p7, (void *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: build1DMipmaps */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_build1DMipmaps(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5) { jint ret = (jint) gluBuild1DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, (const void *) p5); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: build2DMipmaps */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_build2DMipmaps(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5, jint p6) { jint ret = (jint) gluBuild2DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, (GLint) p5, (const void *) p6); CHECK_GL_ERROR return ret; } |
From: Tristan C. <ex...@us...> - 2002-10-28 20:01:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv5421 Modified Files: Matrix4f.java Matrix3f.java Log Message: Fixed inversion error. Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Matrix4f.java 16 Oct 2002 22:34:40 -0000 1.10 +++ Matrix4f.java 28 Oct 2002 20:01:24 -0000 1.11 @@ -575,15 +575,7 @@ float determinant = determinant(); - if (determinant == 1) - // proper orthogonal - transpose(); - else if (determinant == -1) - { // improper orthogonal - transpose(); - negate(); - } - else if (determinant != 0) + if (determinant != 0) { /* m00 m01 m02 m03 Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Matrix3f.java 16 Oct 2002 22:34:40 -0000 1.10 +++ Matrix3f.java 28 Oct 2002 20:01:26 -0000 1.11 @@ -371,15 +371,7 @@ + m01 * (m12 * m20 - m10 * m22) + m02 * (m10 * m21 - m11 * m20); - if (determinant == 1) - // matrix is proper orthogonal - transpose(); - else if (determinant == -1) - { // matrix is improper orthogonal - transpose(); - negate(); - } - else if (determinant != 0) + if (determinant != 0) { // do it the ordinary way |
From: Tristan C. <ex...@us...> - 2002-10-26 18:54:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv15860 Modified Files: org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp Log Message: Fixed some bugs. Index: org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 28 Sep 2002 16:53:13 -0000 1.5 +++ org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 26 Oct 2002 18:54:54 -0000 1.6 @@ -98,48 +98,7 @@ #ifdef _DEBUG printf("Matrix Determinant: %f\n", det); printf("Matrix Determinant - 1 = %f\n", det -1); - printf("FLOATING POINT ERROR: %f\n", FLOATING_POINT_ERROR); -#endif - - // use approxEqual to avoid direct comparisons - if (approxEqual(det, 1.0f) || - approxEqual(det, -1.0f)) - { - -#ifdef _DEBUG - printf("Matrix is Orthogonal\n"); #endif - /* this matrix is orthogonal - - since inv(M) * M = I - when orthogonal - trans(M) * M = I - - proper orthogonal - inv(M) = trans(M) - improper orthogonal - inv(M) = -trans(M) - */ - - if (approxEqual(det, 1)) - { - // proper orthogonal - int srcIndex = 0; - for (int col = 0; col < source.width; col++) - for (int row = 0; row < source.height; row++) - destMatrix[col + row * source.width] = srcMatrix[srcIndex++]; - } - else - { - // improper orthogonal - int srcIndex = 0; - for (int col = 0; col < source.width; col++) - for (int row = 0; row < source.height; row++) - destMatrix[col + row * source.width] = -srcMatrix[srcIndex++]; - } - } - else - { float sign; @@ -167,12 +126,10 @@ = (sign / det) * determinant(temp_matrix, temp_side); // swap signs - sign = (sign == 1) ? -1.0f : 1.0f; + sign *= -1.0f; } } - - } dest.writeComplete(); } } Index: org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp 28 Sep 2002 16:53:13 -0000 1.5 +++ org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp 26 Oct 2002 18:54:54 -0000 1.6 @@ -98,49 +98,9 @@ #ifdef _DEBUG printf("Matrix Determinant: %f\n", det); printf("Matrix Determinant - 1: %f\n", det-1); - printf("FLOATING POINT ERROR: %f\n", FLOATING_POINT_ERROR); -#endif - - // use approxEqual to avoid direct comparisons - if (approxEqual(det,1) || approxEqual(det, -1)) - { - -#ifdef _DEBUG - printf("Matrix is Orthogonal\n"); #endif - /* this matrix is orthogonal - since inv(M) * M = I - when orthogonal - trans(M) * M = I - - proper orthogonal - inv(M) = trans(M) - improper orthogonal - inv(M) = -trans(M) - */ - - if (approxEqual(det, 1)) - { - // proper orthogonal - int srcIndex = 0; - for (int col = 0; col < source.width; col++) - for (int row = 0; row < source.height; row++) - destMatrix[col + row * source.width] = srcMatrix[srcIndex++]; - } - else - { - // improper orthogonal - int srcIndex = 0; - for (int col = 0; col < source.width; col++) - for (int row = 0; row < source.height; row++) - destMatrix[col + row * source.width] = -srcMatrix[srcIndex++]; - } - } - else - { - - float sign; + float sign; for (int col = 0; col < source.width; col++) { @@ -166,11 +126,10 @@ = (sign / det) * determinant(temp_matrix, temp_side); // swap signs - sign = (sign == 1) ? -1.0f : 1.0f; + sign *= -1.0f; } } - } dest.writeComplete(); } |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-19 14:27:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv10062/src/native/win32 Added Files: org_lwjgl_input_Joystick.cpp org_lwjgl_input_GamePad.cpp Log Message: Ready to fill in. Go on, you know you want to. --- NEW FILE: org_lwjgl_input_Joystick.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Joystick.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$ * * Win32 analogue joystick handling. * * @author cix_foo <ci...@us...> * @version $Revision$ */ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include "org_lwjgl_input_Joystick.h" #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0300 #include <dinput.h> extern LPDIRECTINPUT lpdi; LPDIRECTINPUTDEVICE lpdiJoystick; extern HWND hwnd; // The display, which must have been created /* * Class: org_lwjgl_input_Joystick * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_initIDs (JNIEnv * env, jclass clazz) {} /* * Class: org_lwjgl_input_Joystick * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nCreate (JNIEnv * env, jclass clazz) { printf("Joystick not implemented yet!\n"); return JNI_FALSE; } /* * Class: org_lwjgl_input_Joystick * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nDestroy (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_Joystick * Method: nPoll * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Joystick_nPoll (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_Joystick * Method: nGetNumButtons * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nGetNumButtons (JNIEnv * env, jclass clazz) { return 0; } /* * Class: org_lwjgl_input_Joystick * Method: nHasZValue * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_Joystick_nHasZValue (JNIEnv * env, jclass clazz) { return JNI_FALSE; } /* * Class: org_lwjgl_input_Joystick * Method: nRead * Signature: (I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nRead (JNIEnv * env, jclass clazz, jint buf) { int * bufPtr = (int *) buf; return 0; } /* * Class: org_lwjgl_input_Joystick * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_Joystick_nEnableBuffer (JNIEnv * env, jclass clazz) { return 0; } --- NEW FILE: org_lwjgl_input_GamePad.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_GamePad.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$ * * Win32 digital (Atari) joystick handling. These days it's a gamepad. * * @author cix_foo <ci...@us...> * @version $Revision$ */ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include "org_lwjgl_input_GamePad.h" #undef DIRECTINPUT_VERSION #define DIRECTINPUT_VERSION 0x0300 #include <dinput.h> extern LPDIRECTINPUT lpdi; LPDIRECTINPUTDEVICE lpdiGamePad; extern HWND hwnd; // The display, which must have been created /* * Class: org_lwjgl_input_GamePad * Method: initIDs * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_initIDs (JNIEnv * env, jclass clazz) {} /* * Class: org_lwjgl_input_GamePad * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_input_GamePad_nCreate (JNIEnv * env, jclass clazz) { printf("GamePad not implemented yet!\n"); return JNI_FALSE; } /* * Class: org_lwjgl_input_GamePad * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nDestroy (JNIEnv * env, jclass clazz) { } /* * Class: org_lwjgl_input_GamePad * Method: nPoll * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_input_GamePad_nPoll (JNIEnv * env, jclass clazz, jint buf) { } /* * Class: org_lwjgl_input_GamePad * Method: nRead * Signature: (I)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nRead (JNIEnv * env, jclass clazz, jint buf) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nEnableBuffer * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nEnableBuffer (JNIEnv * env, jclass clazz) { return 0; } /* * Class: org_lwjgl_input_GamePad * Method: nGetNumButtons * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_input_GamePad_nGetNumButtons (JNIEnv * env, jclass clazz) { return 0; } |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-18 23:28:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory usw-pr-cvs1:/tmp/cvs-serv30591/src/java/org/lwjgl/opengl Modified Files: CoreGL.java GLConstants.java Log Message: *** keyword substitution change *** Index: CoreGL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 Index: GLConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLConstants.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-18 23:28:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory usw-pr-cvs1:/tmp/cvs-serv30591/src/java/org/lwjgl Modified Files: Display.java Sys.java DisplayMode.java Math.java Log Message: *** keyword substitution change *** 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.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 Index: Sys.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 Index: DisplayMode.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/DisplayMode.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Index: Math.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Math.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-18 23:28:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext In directory usw-pr-cvs1:/tmp/cvs-serv30591/src/java/org/lwjgl/opengl/ext Modified Files: EXTAbgr.java EXTBgra.java EXTSeparateSpecularColor.java EXTLightMaxExponent.java EXTSharedTexturePalette.java EXTBlendSubtract.java EXTRescaleNormal.java EXTPackedPixels.java EXTTextureEnvCombine.java EXTTextureEnvDot3.java EXTVertexArray.java EXTBlendColor.java EXTBlendMinmax.java Log Message: *** keyword substitution change *** Index: EXTAbgr.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTAbgr.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTAbgr.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTBgra.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBgra.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBgra.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTSeparateSpecularColor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTLightMaxExponent.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTSharedTexturePalette.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTBlendSubtract.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTRescaleNormal.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTPackedPixels.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTTextureEnvCombine.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTTextureEnvDot3.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTVertexArray.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTBlendColor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Index: EXTBlendMinmax.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-18 23:21:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext In directory usw-pr-cvs1:/tmp/cvs-serv28727/src/java/org/lwjgl/opengl/ext Added Files: EXTAbgr.java EXTBgra.java EXTSeparateSpecularColor.java EXTLightMaxExponent.java EXTSharedTexturePalette.java EXTBlendSubtract.java EXTRescaleNormal.java EXTPackedPixels.java EXTTextureEnvCombine.java EXTTextureEnvDot3.java EXTVertexArray.java EXTBlendColor.java EXTBlendMinmax.java Removed Files: EXTAgbr.java Log Message: New extensions --- NEW FILE: EXTAbgr.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTAbgr.java /* * 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. */ /* * Created by IntelliJ IDEA. * User: nj * Date: 12-08-2002 * Time: 15:29:12 * To change template for new interface use * Code Style | Class Templates options (Tools | IDE Options). */ package org.lwjgl.opengl.ext; public interface EXTAbgr { public static final int ABGR_EXT = 0x8000; } --- NEW FILE: EXTBgra.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBgra.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_bgra_constants * * @author: cas */ public interface EXTBgra { /* public static final int BGR_EXT = 0x80E0; public static final int BGRA_EXT = 0x80E1; */ } --- NEW FILE: EXTSeparateSpecularColor.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSeparateSpecularColor.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_separate_specular_color constants. * @author: cas */ public interface EXTSeparateSpecularColor { public static final int SINGLE_COLOR_EXT = 0x81F9; public static final int SEPARATE_SPECULAR_COLOR_EXT = 0x81FA; public static final int LIGHT_MODEL_COLOR_CONTROL_EXT = 0x81F8; } --- NEW FILE: EXTLightMaxExponent.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTLightMaxExponent.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_light_max_exponent constants * @author: cas */ public interface EXTLightMaxExponent { public static final int MAX_SHININESS_EXT = 0x8504; public static final int MAX_SPOT_EXPONENT_EXT = 0x8505; } --- NEW FILE: EXTSharedTexturePalette.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTSharedTexturePalette.java /* * 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. */ package org.lwjgl.opengl.ext; /** * Insert the type's description here. * Creation date: (07/11/99 19:15:54) * @author: */ public interface EXTSharedTexturePalette { public static final int SHARED_TEXTURE_PALETTE_EXT = 0x81FB; } --- NEW FILE: EXTBlendSubtract.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendSubtract.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_blend_subtract constants * @author: cas */ public interface EXTBlendSubtract { public static final int FUNC_SUBTRACT_EXT = 0x800A; public static final int FUNC_REVERSE_SUBTRACT_EXT = 0x800B; } --- NEW FILE: EXTRescaleNormal.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTRescaleNormal.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_rescale_normal * @author: cas */ public interface EXTRescaleNormal { public static final int RESCALE_NORMAL_EXT = 0x803A; } --- NEW FILE: EXTPackedPixels.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTPackedPixels.java /* * 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. */ package org.lwjgl.opengl.ext; /** * Insert the type's description here. * Creation date: (07/11/99 19:16:17) * @author: */ public interface EXTPackedPixels { public static final int UNSIGNED_BYTE_3_3_2_EXT = 0x8032; public static final int UNSIGNED_SHORT_4_4_4_4_EXT = 0x8033; public static final int UNSIGNED_SHORT_5_5_5_1_EXT = 0x8034; public static final int UNSIGNED_INT_8_8_8_8_EXT = 0x8035; public static final int UNSIGNED_INT_10_10_10_2_EXT = 0x8036; } --- NEW FILE: EXTTextureEnvCombine.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvCombine.java /* * 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. */ package org.lwjgl.opengl.ext; /** * Insert the type's description here. * Creation date: (22/02/00 01:26:05) * @author: */ public interface EXTTextureEnvCombine { public static final int COMBINE_EXT = 0x8570; public static final int COMBINE_RGB_EXT = 0x8571; public static final int COMBINE_ALPHA_EXT = 0x8572; public static final int SOURCE0_RGB_EXT = 0x8580; public static final int SOURCE1_RGB_EXT = 0x8581; public static final int SOURCE2_RGB_EXT = 0x8582; public static final int SOURCE0_ALPHA_EXT = 0x8588; public static final int SOURCE1_ALPHA_EXT = 0x8589; public static final int SOURCE2_ALPHA_EXT = 0x858A; public static final int OPERAND0_RGB_EXT = 0x8590; public static final int OPERAND1_RGB_EXT = 0x8591; public static final int OPERAND2_RGB_EXT = 0x8592; public static final int OPERAND0_ALPHA_EXT = 0x8598; public static final int OPERAND1_ALPHA_EXT = 0x8599; public static final int OPERAND2_ALPHA_EXT = 0x859A; public static final int RGB_SCALE_EXT = 0x8573; public static final int ADD_SIGNED_EXT = 0x8574; public static final int INTERPOLATE_EXT = 0x8575; public static final int CONSTANT_EXT = 0x8576; public static final int PRIMARY_COLOR_EXT = 0x8577; public static final int PREVIOUS_EXT = 0x8578; } --- NEW FILE: EXTTextureEnvDot3.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTTextureEnvDot3.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_texture_env_dot3 constants. * @author: cas */ public interface EXTTextureEnvDot3 { public static final int DOT3_RGB_EXT = 0x8740; public static final int DOT3_RGBA_EXT = 0x8741; } --- NEW FILE: EXTVertexArray.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTVertexArray.java /* * 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. */ package org.lwjgl.opengl.ext; /** * Insert the type's description here. * Creation date: (07/11/99 18:58:04) * @author: */ public interface EXTVertexArray { public static final int VERTEX_ARRAY_EXT = 0x8074; public static final int NORMAL_ARRAY_EXT = 0x8075; public static final int COLOR_ARRAY_EXT = 0x8076; public static final int INDEX_ARRAY_EXT = 0x8077; public static final int TEXTURE_COORD_ARRAY_EXT = 0x8078; public static final int EDGE_FLAG_ARRAY_EXT = 0x8079; public static final int VERTEX_ARRAY_SIZE_EXT = 0x807A; public static final int VERTEX_ARRAY_TYPE_EXT = 0x807B; public static final int VERTEX_ARRAY_STRIDE_EXT = 0x807C; public static final int VERTEX_ARRAY_COUNT_EXT = 0x807D; public static final int NORMAL_ARRAY_TYPE_EXT = 0x807E; public static final int NORMAL_ARRAY_STRIDE_EXT = 0x807F; public static final int NORMAL_ARRAY_COUNT_EXT = 0x8080; public static final int COLOR_ARRAY_SIZE_EXT = 0x8081; public static final int COLOR_ARRAY_TYPE_EXT = 0x8082; public static final int COLOR_ARRAY_STRIDE_EXT = 0x8083; public static final int COLOR_ARRAY_COUNT_EXT = 0x8084; public static final int INDEX_ARRAY_TYPE_EXT = 0x8085; public static final int INDEX_ARRAY_STRIDE_EXT = 0x8086; public static final int INDEX_ARRAY_COUNT_EXT = 0x8087; public static final int TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088; public static final int TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089; public static final int TEXTURE_COORD_ARRAY_STRIDE_EXT = 0x808A; public static final int TEXTURE_COORD_ARRAY_COUNT_EXT = 0x808B; public static final int EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C; public static final int EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D; public static final int VERTEX_ARRAY_POINTER_EXT = 0x808E; public static final int NORMAL_ARRAY_POINTER_EXT = 0x808F; public static final int COLOR_ARRAY_POINTER_EXT = 0x8090; public static final int INDEX_ARRAY_POINTER_EXT = 0x8091; public static final int TEXTURE_COORD_ARRAY_POINTER_EXT = 0x8092; public static final int EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093; } --- NEW FILE: EXTBlendColor.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendColor.java /* * 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. */ package org.lwjgl.opengl.ext; /** * Insert the type's description here. * Creation date: (29/06/2000 00:45:10) * @author: */ public interface EXTBlendColor { public static final int CONSTANT_COLOR_EXT = 0x8001; public static final int ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002; public static final int CONSTANT_ALPHA_EXT = 0x8003; public static final int ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; public static final int BLEND_COLOR_EXT = 0x8005; } --- NEW FILE: EXTBlendMinmax.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTBlendMinmax.java /* * 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. */ package org.lwjgl.opengl.ext; /** * EXT_blend_minmax constants * @author: cas */ public interface EXTBlendMinmax { public static final int FUNC_ADD_EXT = 0x8006; public static final int MIN_EXT = 0x8007; public static final int MAX_EXT = 0x8008; public static final int BLEND_EQUATION_EXT = 0x8009; } --- EXTAgbr.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ext/EXTAgbr.java |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-18 23:21:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory usw-pr-cvs1:/tmp/cvs-serv28727/src/java/org/lwjgl/opengl Modified Files: GL.java CoreGL.java GLConstants.java Log Message: New extensions Index: GL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- GL.java 20 Sep 2002 16:57:13 -0000 1.10 +++ GL.java 18 Oct 2002 23:21:49 -0000 1.11 @@ -1337,14 +1337,10 @@ public static native void wglFreeMemoryNV(int pointer); - - public static native int wglGetCurrentReadDCARB(); public static native String wglGetExtensionsStringARB(int hdc); - - public static native String wglGetExtensionsStringEXT(); public static native int wglGetPbufferDCARB(int hPbuffer); @@ -1379,7 +1375,9 @@ public static native int wglReleasePbufferDCARB(int hPbuffer, int hDC); - public static native boolean wglReleaseTexImageARB(int hPbuffer, int iBuffer); + public static native boolean wglReleaseTexImageARB( + int hPbuffer, + int iBuffer); public static native boolean wglRestoreBufferRegionARB( int hRegion, @@ -1468,21 +1466,32 @@ public boolean ARB_window_pos; public boolean EXT_abgr; public boolean EXT_bgra; + public boolean EXT_blend_color; public boolean EXT_blend_function_separate; + public boolean EXT_blend_minmax; + public boolean EXT_blend_subtract; public boolean EXT_compiled_vertex_array; public boolean EXT_cull_vertex; public boolean EXT_draw_range_elements; public boolean EXT_fog_coord; + public boolean EXT_light_max_exponent; public boolean EXT_multi_draw_arrays; + public boolean EXT_packed_pixels; + public boolean EXT_paletted_texture; public boolean EXT_point_parameters; - public boolean EXT_secondary_color ; + public boolean EXT_rescale_normal; + public boolean EXT_secondary_color; public boolean EXT_separate_specular_color; public boolean EXT_shadow_funcs; + public boolean EXT_shared_texture_palette; public boolean EXT_stencil_two_side; public boolean EXT_stencil_wrap; public boolean EXT_texture_compression_s3tc; + public boolean EXT_texture_env_combine; + public boolean EXT_texture_env_dot3; public boolean EXT_texture_filter_anisotropic; public boolean EXT_texture_lod_bias; + public boolean EXT_vertex_array; public boolean EXT_vertex_shader; public boolean EXT_vertex_weighting; public boolean ATI_element_array; @@ -1536,22 +1545,23 @@ * Determine which extensions are available */ private void determineAvailableExtensions() { - + determineAvailableWGLExtensions(); - + // Grab all the public booleans out of this class Field[] fields = GL.class.getDeclaredFields(); HashMap map = new HashMap(fields.length); - for (int i = 0; i < fields.length; i ++) { - if (!Modifier.isStatic(fields[i].getModifiers()) && fields[i].getType() == boolean.class) + for (int i = 0; i < fields.length; i++) { + if (!Modifier.isStatic(fields[i].getModifiers()) + && fields[i].getType() == boolean.class) map.put(fields[i].getName(), fields[i]); } - + String exts = getString(EXTENSIONS); StringTokenizer st = new StringTokenizer(exts); while (st.hasMoreTokens()) { String ext = st.nextToken(); - + Field f = (Field) map.get(ext); if (f != null) { try { @@ -1560,9 +1570,9 @@ e.printStackTrace(System.err); } } - + } - + // Let's see what openGL version we are too: String version = getString(VERSION); int i = version.indexOf("1."); @@ -1580,7 +1590,7 @@ } } } - + /* * Available WGL extensions */ @@ -1588,7 +1598,7 @@ public static boolean WGL_ARB_extensions_string; public static boolean WGL_ARB_pbuffer; public static boolean WGL_ARB_pixel_format; - public static boolean WGL_ARB_render_texture; + public static boolean WGL_ARB_render_texture; public static boolean WGL_EXT_extensions_string; public static boolean WGL_EXT_swap_control; @@ -1597,42 +1607,44 @@ * if available. */ private static native void checkWGLExtensionsString(); - + /** * Determine which WGL extensions are available */ private void determineAvailableWGLExtensions() { - + // First we must determine if WGL_EXT_extensions_string is available checkWGLExtensionsString(); if (!WGL_EXT_extensions_string && !WGL_ARB_extensions_string) return; - + // Grab all the public booleans out of this class Field[] fields = GL.class.getDeclaredFields(); HashMap map = new HashMap(fields.length); - for (int i = 0; i < fields.length; i ++) { - if (Modifier.isStatic(fields[i].getModifiers()) && fields[i].getType() == boolean.class) + for (int i = 0; i < fields.length; i++) { + if (Modifier.isStatic(fields[i].getModifiers()) + && fields[i].getType() == boolean.class) map.put(fields[i].getName(), fields[i]); } - + final String exts; - + if (WGL_ARB_extensions_string) - exts = wglGetExtensionsStringARB(Display.getHandle()); // Remember - this is an HWND not an HDC, which is what's required + exts = wglGetExtensionsStringARB(Display.getHandle()); + // Remember - this is an HWND not an HDC, which is what's required else exts = wglGetExtensionsStringEXT(); - + if (exts == null) return; - System.out.println("Available WGL extensions:"); + System.out.println("Available WGL extensions:"); StringTokenizer st = new StringTokenizer(exts); while (st.hasMoreTokens()) { String ext = st.nextToken(); - + System.out.println(ext); - + Field f = (Field) map.get(ext); if (f != null) { try { @@ -1641,8 +1653,8 @@ e.printStackTrace(System.err); } } - - } + + } } /* (non-Javadoc) Index: CoreGL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGL.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- CoreGL.java 19 Aug 2002 14:01:03 -0000 1.4 +++ CoreGL.java 18 Oct 2002 23:21:49 -0000 1.5 @@ -57,6 +57,38 @@ public native void accum(int op, float value); public native void alphaFunc(int func, float ref); + public native void colorTable( + int target, + int internalFormat, + int width, + int format, + int type, + int data); + + public native void colorSubTable( + int target, + int start, + int count, + int format, + int type, + int data); + + public native void getColorTable( + int target, + int format, + int type, + int data); + + public native void getColorTableParameteriv( + int target, + int pname, + int params); + + public native void getColorTableParameterfv( + int target, + int pname, + int params); + public native void clearColor(float red, float green, float blue, float alpha); public native void clearAccum(float red, float green, float blue, float alpha); public native void clear(int mask); Index: GLConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLConstants.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GLConstants.java 16 Aug 2002 21:53:02 -0000 1.4 +++ GLConstants.java 18 Oct 2002 23:21:49 -0000 1.5 @@ -39,7 +39,7 @@ import org.lwjgl.opengl.atix.ATIXPointSprites; import org.lwjgl.opengl.atix.ATIXTextureEnvRoute; import org.lwjgl.opengl.ext.*; -import org.lwjgl.opengl.ext.EXTAgbr; +import org.lwjgl.opengl.ext.EXTAbgr; import org.lwjgl.opengl.ext.EXTCompiledVertexArray; import org.lwjgl.opengl.hp.HPOcclusionTest; import org.lwjgl.opengl.nv.*; @@ -89,17 +89,28 @@ ATIVertexStreams, ATIXPointSprites, ATIXTextureEnvRoute, - EXTAgbr, + EXTAbgr, + EXTBgra, + EXTBlendColor, + EXTBlendMinmax, EXTCompiledVertexArray, EXTDrawRangeElements, EXTFogCoord, + EXTLightMaxExponent, + EXTPackedPixels, EXTPointParameters, + EXTRescaleNormal, EXTSecondaryColor, + EXTSeparateSpecularColor, + EXTSharedTexturePalette, EXTStencilTwoSide, EXTStencilWrap, EXTTextureCompressionS3TC, + EXTTextureEnvCombine, + EXTTextureEnvDot3, EXTTextureFilterAnisotropic, EXTTextureLODBias, + EXTVertexArray, EXTVertexShader, EXTVertexWeighting, HPOcclusionTest, |
From: Tristan C. <ex...@us...> - 2002-10-16 22:34:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv11404 Modified Files: Matrix2f.java Matrix3f.java Matrix4f.java Log Message: added invert/determinant Index: Matrix2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Matrix2f.java 28 Aug 2002 00:05:45 -0000 1.8 +++ Matrix2f.java 16 Oct 2002 22:34:40 -0000 1.9 @@ -292,8 +292,24 @@ * Invert this matrix * @return this */ - public Matrix invert() { - assert false : "Not implemented yet!"; + public Matrix invert() + { + + /* + inv(A) = 1/det(A) * adj(A); + */ + + float determinant = m00 * m11 - m01*m10; + float t00 = m11/determinant; + float t01 = -m01/determinant; + float t11 = m00/determinant; + float t10 = -m10/determinant; + + m00 = t00; + m01 = t01; + m10 = t10; + m11 = t11; + return this; } @@ -357,8 +373,7 @@ * @see org.lwjgl.vector.Matrix#determinant() */ public float determinant() { - assert false : "Not implemented yet!"; - return 0; + return m00 * m11 - m01*m10; } } Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Matrix3f.java 28 Aug 2002 00:05:45 -0000 1.9 +++ Matrix3f.java 16 Oct 2002 22:34:40 -0000 1.10 @@ -365,8 +365,55 @@ * Invert this matrix * @return this */ - public Matrix invert() { - assert false : "Not implemented yet!"; + public Matrix invert() + { + float determinant = m00 * (m11 * m22 - m12 * m21) + + m01 * (m12 * m20 - m10 * m22) + + m02 * (m10 * m21 - m11 * m20); + + if (determinant == 1) + // matrix is proper orthogonal + transpose(); + else if (determinant == -1) + { // matrix is improper orthogonal + transpose(); + negate(); + } + else if (determinant != 0) + { + // do it the ordinary way + + /* inv(A) = 1/det(A) * adj(T), where adj(T) = transpose(Conjugate Matrix) + + m00 m01 m02 + m10 m11 m12 + m20 m21 m22 + */ + + // get the conjugate matrix + float t00 = m11 * m22 - m12* m22; + float t01 = - m10 * m22 + m12 *m20; + float t02 = m10 * m21 - m11 * m20; + float t10 = - m01 * m22 + m02 * m21; + float t11 = m00 * m22 - m02 * m20; + float t12 = - m00 * m21 + m01 * m20; + float t20 = m01 * m12 - m02 * m11; + float t21 = -m00 * m12 + m02 * m10; + float t22 = m00 * m11 - m01 * m10; + + + m00 = t00/determinant; + m11 = t11/determinant; + m22 = t22/determinant; + m01 = t10/determinant; + m10 = t01/determinant; + m20 = t02/determinant; + m02 = t20/determinant; + m12 = t21/determinant; + m21 = t12/determinant; + } + + return this; } Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- Matrix4f.java 28 Aug 2002 00:05:45 -0000 1.9 +++ Matrix4f.java 16 Oct 2002 22:34:40 -0000 1.10 @@ -553,13 +553,84 @@ return f; } + /** + * Calculate the determinant of a 3x3 matrix + * @return result + */ + + private float determinant3x3(float t00, float t01, float t02, + float t10, float t11, float t12, + float t20, float t21, float t22) + { + return t00 * (t11 * t22 - t12 * t21) + + t01 * (t12 * t20 - t10 * t22) + + t02 * (t10 * t21 - t11 * t20); + } /** * Invert this matrix * @return this */ public Matrix invert() { - assert false : "Not implemented yet!"; + + float determinant = determinant(); + + if (determinant == 1) + // proper orthogonal + transpose(); + else if (determinant == -1) + { // improper orthogonal + transpose(); + negate(); + } + else if (determinant != 0) + { + /* + m00 m01 m02 m03 + m10 m11 m12 m13 + m20 m21 m22 m23 + m30 m31 m32 m33 + */ + + // first row + float t00 = determinant3x3( m11, m12, m13, m21, m22, m23, m31, m32, m33 ); + float t01 = -determinant3x3(m10, m12, m13, m20, m22, m23, m30, m32, m33 ); + float t02 = determinant3x3( m10, m11, m13, m20, m21, m23, m30, m31, m33 ); + float t03 = -determinant3x3(m10, m11, m12, m20, m21, m22, m30, m31, m32 ); + // second row + float t10 = -determinant3x3(m01, m02, m03, m21, m22, m23, m31, m32, m33 ); + float t11 = determinant3x3( m00, m02, m03, m20, m22, m23, m30, m32, m33 ); + float t12 = -determinant3x3(m00, m01, m03, m20, m21, m23, m30, m31, m33 ); + float t13 = determinant3x3( m00, m01, m02, m20, m21, m22, m30, m31, m32 ); + // third row + float t20 = determinant3x3( m01, m02, m03, m11, m12, m13, m31, m32, m33 ); + float t21 = -determinant3x3(m00, m02, m03, m10, m12, m13, m30, m32, m33 ); + float t22 = determinant3x3( m00, m01, m03, m10, m11, m13, m30, m31, m33 ); + float t23 = -determinant3x3(m00, m01, m02, m10, m11, m12, m30, m31, m32 ); + // fourth row + float t30 = -determinant3x3(m01, m02, m03, m11, m12, m13, m21, m22, m23 ); + float t31 = determinant3x3( m00, m02, m03, m10, m12, m13, m20, m22, m23 ); + float t32 = -determinant3x3(m00, m01, m03, m10, m11, m13, m20, m21, m23 ); + float t33 = determinant3x3( m00, m01, m02, m10, m11, m12, m20, m21, m22 ); + + // transpose and divide by the determinant + m00 = t00/determinant; + m11 = t11/determinant; + m22 = t22/determinant; + m33 = t33/determinant; + m01 = t10/determinant; + m10 = t01/determinant; + m20 = t02/determinant; + m02 = t20/determinant; + m12 = t21/determinant; + m21 = t12/determinant; + m03 = t30/determinant; + m30 = t03/determinant; + m13 = t31/determinant; + m31 = t13/determinant; + m32 = t23/determinant; + m23 = t32/determinant; + } return this; } |
From: Tristan C. <ex...@us...> - 2002-10-16 21:00:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv1607 Modified Files: MatrixOpCommon.cpp Log Message: fixed some memory errors Index: MatrixOpCommon.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- MatrixOpCommon.cpp 15 Oct 2002 20:30:45 -0000 1.5 +++ MatrixOpCommon.cpp 16 Oct 2002 21:00:21 -0000 1.6 @@ -310,28 +310,22 @@ float determinant (const float * matrix , int side) { - // We'll keep a scratch bit of memory around for doing temporary calculations: - static int current_side_size = 0; - static float * temp_matrix = NULL; // we are assuming for this case that the data is in column major format float det = 0; if (side == 2) - // your basic cross product + // your basic cross product aka 2x2 determinant det = matrix[0] * matrix[3] - matrix[2] * matrix[1]; else { - int temp_side = side - 1; // the dimensions of the sub matrix - if (temp_side > current_side_size) { - if (temp_matrix) - delete[] temp_matrix; - current_side_size = temp_side; - temp_matrix = new float[current_side_size * current_side_size]; - } + // create room to store the sub matrix + int temp_side = side - 1; // the dimensions of the sub matrix + float * temp_matrix = new float[temp_side * temp_side]; - bool sign_pos = 1; // the sign is positive + // keep the sign (this way we avoid an additional branch in the inner loop) + float sign = 1; for (int row = 0; row < side; row++) { @@ -339,12 +333,13 @@ subMatrix(matrix, side, temp_matrix, 0, row); // add to the determinant sign * [a]i0 * [M]i0 - det += ((sign_pos) ? matrix[row] : - -matrix[row]) * determinant (temp_matrix, temp_side); + det += sign * matrix[row] * determinant (temp_matrix, temp_side); // alternate the sign - sign_pos ^= 1; + sign *= -1; } + + delete [] temp_matrix; } return det; |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-15 20:30:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv1691/src/native/common Modified Files: org_lwjgl_opengl_CoreGL.h Log Message: Fixed native matrix code so it compiles. Added EXT_paletted_texture functions to CoreGL - whoops Index: org_lwjgl_opengl_CoreGL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_CoreGL.h 15 Aug 2002 16:11:43 -0000 1.3 +++ org_lwjgl_opengl_CoreGL.h 15 Oct 2002 20:30:47 -0000 1.4 @@ -1,2568 +1,2608 @@ /* DO NOT EDIT THIS FILE - it is machine generated */ -#include <jni.h> +#include <jni.h> /* Header for class org_lwjgl_opengl_CoreGL */ #ifndef _Included_org_lwjgl_opengl_CoreGL -#define _Included_org_lwjgl_opengl_CoreGL +#define _Included_org_lwjgl_opengl_CoreGL #ifdef __cplusplus extern "C" { -#endif [...4818 lines suppressed...] - * Method: viewport - * Signature: (IIII)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_viewport + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: viewport + * Signature: (IIII)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_viewport (JNIEnv *, jobject, jint, jint, jint, jint); - + #ifdef __cplusplus } -#endif -#endif +#endif +#endif |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-15 20:30:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv1691/src/native/win32 Modified Files: org_lwjgl_opengl_CoreGL.cpp MatrixOpCommon.cpp Log Message: Fixed native matrix code so it compiles. Added EXT_paletted_texture functions to CoreGL - whoops Index: org_lwjgl_opengl_CoreGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreGL.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_opengl_CoreGL.cpp 15 Aug 2002 16:08:16 -0000 1.5 +++ org_lwjgl_opengl_CoreGL.cpp 15 Oct 2002 20:30:44 -0000 1.6 @@ -3149,3 +3149,79 @@ CHECK_GL_ERROR } + void GetColorTableEXT( + enum target, + enum format, + enum type, + void *data); + + void GetColorTableParameterivEXT( + enum target, + enum pname, + int *params); + + void GetColorTableParameterfvEXT( + enum target, + enum pname, + float *params); + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: colorTable + * Signature: (IIIIII)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_colorTable + (JNIEnv * env, jobject obj, jint target, jint internalFormat, jint width, jint format, jint type, jint data) +{ + glColorTable(target, internalFormat, width, format, type, (const void *) data); + CHECK_GL_ERROR +} + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: colorSubTable + * Signature: (IIIIII)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_colorSubTable + (JNIEnv * env, jobject obj, jint target, jint start, jint count, jint format, jint type, jint data) +{ + glColorSubTable(target, start, count, format, type, (const void *) data); + CHECK_GL_ERROR +} + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: getColorTable + * Signature: (IIII)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_getColorTable + (JNIEnv * env, jobject obj, jint target, jint format, jint type, jint data) +{ + glGetColorTable(target, format, type, (void *) data); + CHECK_GL_ERROR +} + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: getColorTableParameteriv + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_getColorTableParameteriv + (JNIEnv * env, jobject obj, jint target, jint pname, jint params) +{ + glGetColorTableParameteriv(target, pname, (int *)params); + CHECK_GL_ERROR +} + +/* + * Class: org_lwjgl_opengl_CoreGL + * Method: getColorTableParameterfv + * Signature: (III)V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_CoreGL_getColorTableParameterfv + (JNIEnv * env, jobject obj, jint target, jint pname, jint params) +{ + glGetColorTableParameterfv(target, pname, (float *)params); + CHECK_GL_ERROR +} + Index: MatrixOpCommon.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- MatrixOpCommon.cpp 28 Sep 2002 16:53:13 -0000 1.4 +++ MatrixOpCommon.cpp 15 Oct 2002 20:30:45 -0000 1.5 @@ -1,6 +1,7 @@ //#include <iostream> #include <jni.h> +#include <memory.h> #include "MatrixOpCommon.h" bool Matrix::identicalDataSpaces(Matrix & other) @@ -308,6 +309,11 @@ float determinant (const float * matrix , int side) { + + // We'll keep a scratch bit of memory around for doing temporary calculations: + static int current_side_size = 0; + static float * temp_matrix = NULL; + // we are assuming for this case that the data is in column major format float det = 0; @@ -318,7 +324,13 @@ else { int temp_side = side - 1; // the dimensions of the sub matrix - float temp_matrix [temp_side * temp_side]; // hold a sub matrix of this matrix + if (temp_side > current_side_size) { + if (temp_matrix) + delete[] temp_matrix; + current_side_size = temp_side; + temp_matrix = new float[current_side_size * current_side_size]; + } + bool sign_pos = 1; // the sign is positive for (int row = 0; row < side; row++) |
From: Caspian Rychlik-P. <ci...@us...> - 2002-10-06 21:35:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory usw-pr-cvs1:/tmp/cvs-serv28359/src/java/org/lwjgl/vector Modified Files: Vector3f.java Vector4f.java Log Message: Added load method Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Vector3f.java 28 Aug 2002 00:05:45 -0000 1.6 +++ Vector3f.java 6 Oct 2002 21:34:56 -0000 1.7 @@ -244,7 +244,10 @@ * @see org.lwjgl.vector.Vector#load(FloatBuffer) */ public Vector load(FloatBuffer buf) { - return null; + x = buf.get(); + y = buf.get(); + z = buf.get(); + return this; } /* (non-Javadoc) Index: Vector4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Vector4f.java 26 Aug 2002 20:24:29 -0000 1.5 +++ Vector4f.java 6 Oct 2002 21:34:56 -0000 1.6 @@ -222,7 +222,11 @@ * @see org.lwjgl.vector.Vector#load(FloatBuffer) */ public Vector load(FloatBuffer buf) { - return null; + x = buf.get(); + y = buf.get(); + z = buf.get(); + w = buf.get(); + return this; } /* (non-Javadoc) |
From: Tristan C. <ex...@us...> - 2002-09-28 16:53:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv12922 Modified Files: MatrixOpCommon.cpp MatrixOpCommon.h org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp Log Message: Optimised INVERT cases for Orthogonal Matricies (Rotations) Index: MatrixOpCommon.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MatrixOpCommon.cpp 8 Sep 2002 23:57:33 -0000 1.3 +++ MatrixOpCommon.cpp 28 Sep 2002 16:53:13 -0000 1.4 @@ -90,9 +90,7 @@ record = new float[width * height]; // vectors do not need to be transposed - transpose = (t == JNI_TRUE) - && (w != 1) - && (h != 1); + transpose = (t == JNI_TRUE) && (w != 1) && (h != 1); if (transpose && (width != height)) // only need temp storage for transpose if the matrix is not square @@ -175,7 +173,7 @@ else transpose_record = 0; - data_buffered = JNI_FALSE; + data_buffered = JNI_FALSE; record_buffered = JNI_FALSE; record_offset = address - stride; @@ -244,8 +242,9 @@ float * MatrixDst::nextMatrix() { record_offset = &record_offset[stride]; + int alignment = ((unsigned int)(record_offset)) & FLOAT_ALIGNMENT; - if ((((unsigned int)(record_offset)) & FLOAT_ALIGNMENT) || transpose || record_buffered) + if (transpose || record_buffered || alignment) { last_record_in_temp = JNI_TRUE; return record; @@ -276,7 +275,7 @@ } else if (transpose) { - transposeMatrix(record, (float *) record_offset, width, height); + transposeMatrix(record, (float *) &record_offset[0], width, height); } else memcpy (record_offset, record, record_size * sizeof(jfloat)); Index: MatrixOpCommon.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/MatrixOpCommon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MatrixOpCommon.h 8 Sep 2002 23:57:33 -0000 1.2 +++ MatrixOpCommon.h 28 Sep 2002 16:53:13 -0000 1.3 @@ -9,10 +9,30 @@ +//////////////////////////////////////////////////////////////////////////////////////// +// Utility Functions +//////////////////////////////////////////////////////////////////////////////////////// + #define FLOAT_ALIGNMENT 0x00000003 +// 23 bit mantisa on a float (we need error for checking if two nums are equal) +// for now use error of 1/2^18, this could be refined up to 1/2^22 if needed +#define FLOATING_POINT_ERROR (1.0f/262144.0f) + +// check if two numbers are approximately equal, used when floating point errors +// occur. Should NEVER check to see if two floats are identical + +inline bool approxEqual(float a, float b) +{ + a -= b; + a = (a < 0) ? -a: a; + return (a < FLOATING_POINT_ERROR); +} + float determinant (const float * matrix , int side); -void subMatrix (const float * src, int side, float * dst , int col_omit, int row_omit); +void subMatrix (const float * src, int side, float * dst , int col_omit, int row_omit); + + /////////////////////////////////////////////////////////////////////////////////////// // Matrix Index: org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 8 Sep 2002 23:57:33 -0000 1.4 +++ org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.cpp 28 Sep 2002 16:53:13 -0000 1.5 @@ -42,6 +42,9 @@ #include <windows.h> #include "org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect.h" #include "MatrixOpCommon.h" +#ifdef _DEBUG +#include <stdio.h> +#endif /* * Class: org_lwjgl_Math_MatrixOpInvert_MatrixOpDirect * Method: execute @@ -62,6 +65,13 @@ jboolean transposeDest ) { + if (transposeSource == transposeDest) + { + transposeSource = JNI_FALSE; + transposeDest = JNI_FALSE; + } + + // We are under the assumption that sourceWidth == sourceHeight and the matrix // defined within is invertable @@ -79,46 +89,90 @@ for (int i = 0; i < source.elements; i++) { - srcMatrix = source.nextMatrix(); - destMatrix = dest.nextMatrix(); + srcMatrix = source.nextMatrix(); + destMatrix = dest .nextMatrix(); // calculate the determinant float det = determinant(srcMatrix, source.width); #ifdef _DEBUG - printf("Determinant: %f\n", det); + printf("Matrix Determinant: %f\n", det); + printf("Matrix Determinant - 1 = %f\n", det -1); + printf("FLOATING POINT ERROR: %f\n", FLOATING_POINT_ERROR); #endif - - float sign; - - for (int col = 0; col < source.width; col++) + + // use approxEqual to avoid direct comparisons + if (approxEqual(det, 1.0f) || + approxEqual(det, -1.0f)) { - /* - Maintain sign: - - + - + - ... - - + - + .. - + - + - .. - - + - + .. - : : : : \ - */ - sign = (col & 1) ? -1.0f : 1.0f; +#ifdef _DEBUG + printf("Matrix is Orthogonal\n"); +#endif + /* this matrix is orthogonal - for (int row = 0; row < source.height; row++) + since inv(M) * M = I + when orthogonal + trans(M) * M = I + + proper orthogonal + inv(M) = trans(M) + improper orthogonal + inv(M) = -trans(M) + */ + + if (approxEqual(det, 1)) { - // get the sub matrix - subMatrix(srcMatrix, source.width, temp_matrix, col, row); - - // transpose the result - destMatrix[col + row * source.height] - = (sign / det) * determinant(temp_matrix, temp_side); + // proper orthogonal + int srcIndex = 0; + for (int col = 0; col < source.width; col++) + for (int row = 0; row < source.height; row++) + destMatrix[col + row * source.width] = srcMatrix[srcIndex++]; + } + else + { + // improper orthogonal + int srcIndex = 0; + for (int col = 0; col < source.width; col++) + for (int row = 0; row < source.height; row++) + destMatrix[col + row * source.width] = -srcMatrix[srcIndex++]; + } + } + else + { + + float sign; + + for (int col = 0; col < source.width; col++) + { + /* + Maintain sign: + + + - + - ... + - + - + .. + + - + - .. + - + - + .. + : : : : \ + */ + + sign = (col & 1) ? -1.0f : 1.0f; - // swap signs - sign = (sign == 1) ? -1.0f : 1.0f; + for (int row = 0; row < source.height; row++) + { + // get the sub matrix + subMatrix(srcMatrix, source.width, temp_matrix, col, row); + + // transpose the result + destMatrix[col + row * source.height] + = (sign / det) * determinant(temp_matrix, temp_side); + + // swap signs + sign = (sign == 1) ? -1.0f : 1.0f; + } } + + } - dest.writeComplete(); } } Index: org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp 8 Sep 2002 23:57:33 -0000 1.4 +++ org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.cpp 28 Sep 2002 16:53:13 -0000 1.5 @@ -39,15 +39,14 @@ * @version $Revision$ */ - -#ifdef _DEBUG -#include <stdio.h> -#endif - #include <windows.h> #include "org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe.h" #include "MatrixOpCommon.h" +#ifdef _DEBUG +#include <stdio.h> +#endif + /* * Class: org_lwjgl_Math_MatrixOpInvert_MatrixOpSafe * Method: execute @@ -68,6 +67,13 @@ jboolean transposeDest ) { + + if (transposeSource == transposeDest) + { + transposeSource = JNI_FALSE; + transposeDest = JNI_FALSE; + } + // We are under the assumption that sourceWidth == sourceHeight and the matrix // defined within is invertable @@ -90,39 +96,82 @@ float det = determinant(srcMatrix, source.width); #ifdef _DEBUG - printf("Determinant: %f\n", det); + printf("Matrix Determinant: %f\n", det); + printf("Matrix Determinant - 1: %f\n", det-1); + printf("FLOATING POINT ERROR: %f\n", FLOATING_POINT_ERROR); #endif - - float sign; - for (int col = 0; col < source.width; col++) + // use approxEqual to avoid direct comparisons + if (approxEqual(det,1) || approxEqual(det, -1)) { - /* - Maintain sign: - - + - + - ... - - + - + .. - + - + - .. - - + - + .. - : : : : \ - */ - sign = (col & 1) ? -1.0f : 1.0f; +#ifdef _DEBUG + printf("Matrix is Orthogonal\n"); +#endif + /* this matrix is orthogonal - for (int row = 0; row < source.height; row++) + since inv(M) * M = I + when orthogonal + trans(M) * M = I + + proper orthogonal + inv(M) = trans(M) + improper orthogonal + inv(M) = -trans(M) + */ + + if (approxEqual(det, 1)) { - // get the sub matrix - subMatrix(srcMatrix, source.width, temp_matrix, col, row); - - // transpose the result - destMatrix[col + row * source.height] - = (sign / det) * determinant(temp_matrix, temp_side); + // proper orthogonal + int srcIndex = 0; + for (int col = 0; col < source.width; col++) + for (int row = 0; row < source.height; row++) + destMatrix[col + row * source.width] = srcMatrix[srcIndex++]; + } + else + { + // improper orthogonal + int srcIndex = 0; + for (int col = 0; col < source.width; col++) + for (int row = 0; row < source.height; row++) + destMatrix[col + row * source.width] = -srcMatrix[srcIndex++]; + } + } + else + { + + float sign; + + for (int col = 0; col < source.width; col++) + { + /* + Maintain sign: + + + - + - ... + - + - + .. + + - + - .. + - + - + .. + : : : : \ + */ + + sign = (col & 1) ? -1.0f : 1.0f; - // swap signs - sign = (sign == 1) ? -1.0f : 1.0f; + for (int row = 0; row < source.height; row++) + { + // get the sub matrix + subMatrix(srcMatrix, source.width, temp_matrix, col, row); + + // transpose the result + destMatrix[col + row * source.height] + = (sign / det) * determinant(temp_matrix, temp_side); + + // swap signs + sign = (sign == 1) ? -1.0f : 1.0f; + } } + } - dest.writeComplete(); + } } |
From: Caspian Rychlik-P. <ci...@us...> - 2002-09-20 17:00:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv18196/src/native/win32 Modified Files: org_lwjgl_opengl_GL.cpp Log Message: Fixed wglGetExtensionsStringARB problem Index: org_lwjgl_opengl_GL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_GL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_GL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_GL.cpp 17 Aug 2002 14:13:11 -0000 1.3 +++ org_lwjgl_opengl_GL.cpp 20 Sep 2002 17:00:30 -0000 1.4 @@ -3787,8 +3787,10 @@ */ JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GL_wglGetExtensionsStringARB(JNIEnv * env, jclass clazz, jint p0) { - jstring ret = env->NewStringUTF(wglGetExtensionsStringARB(GetDC((HWND) p0))); - return ret; + if (wglGetExtensionsStringARB) + return env->NewStringUTF(wglGetExtensionsStringARB(GetDC((HWND) p0))); + else + return NULL; } /* |