You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(8) |
2
(34) |
|
3
(15) |
4
(17) |
5
(7) |
6
(2) |
7
(4) |
8
|
9
|
|
10
(1) |
11
(8) |
12
(5) |
13
(7) |
14
|
15
|
16
(1) |
|
17
(70) |
18
|
19
(5) |
20
(1) |
21
|
22
|
23
(7) |
|
24
(3) |
25
(3) |
26
(1) |
27
|
28
(1) |
29
(4) |
30
(3) |
|
31
|
|
|
|
|
|
|
|
From: Brian M. <ma...@us...> - 2003-08-13 21:18:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv12425 Modified Files: ALC.java Log Message: fix: naming Index: ALC.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ALC.java 11 Aug 2003 19:57:52 -0000 1.10 +++ ALC.java 13 Aug 2003 21:03:30 -0000 1.11 @@ -215,10 +215,10 @@ * @return String property from device */ public static String alcGetString(int pname) { - return nGetString(AL.device.device, pname); + return nalcGetString(AL.device.device, pname); } - native static String nGetString(int device, int pname); + native static String nalcGetString(int device, int pname); /** * The application can query ALC for information using an integer query function. @@ -241,10 +241,10 @@ * @param integerdata ByteBuffer to write integers to */ public static void alcGetInteger(int pname, IntBuffer integerdata) { - nGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); + nalcGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); } - native static void nGetIntegerv(int device, int pname, int size, Buffer integerdata, int offset); + native static void nalcGetIntegerv(int device, int pname, int size, Buffer integerdata, int offset); /** * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to @@ -316,10 +316,10 @@ * alcCreateContext is that it is not marked as processing. */ public static void alcProcessContext() { - nProcessContext(AL.context.context); + nalcProcessContext(AL.context.context); } - native static void nProcessContext(int context); + native static void nalcProcessContext(int context); /** * The application can query for, and obtain an handle to, the current context for the @@ -375,10 +375,10 @@ * @return Errorcode from ALC statemachine */ public static int alcGetError() { - return nGetError(AL.device.device); + return nalcGetError(AL.device.device); } - native static int nGetError(int device); + native static int nalcGetError(int device); /** * Verify that a given extension is available for the current context and the device it @@ -390,10 +390,10 @@ * @return true if extension is available, false if not */ public static boolean alcIsExtensionPresent(String extName) { - return nIsExtensionPresent(AL.device.device, extName); + return nalcIsExtensionPresent(AL.device.device, extName); } - native static boolean nIsExtensionPresent(int device, String extName); + native static boolean nalcIsExtensionPresent(int device, String extName); /** * Enumeration/token values are device independend, but tokens defined for @@ -406,8 +406,8 @@ * @return value of enumeration */ public static int alcGetEnumValue(String enumName) { - return nGetEnumValue(AL.device.device, enumName); + return nalcGetEnumValue(AL.device.device, enumName); } - native static int nGetEnumValue(int device, String enumName); + native static int nalcGetEnumValue(int device, String enumName); } |
|
From: Brian M. <ma...@us...> - 2003-08-13 21:14:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv12384 Modified Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALC.h Log Message: fix: naming Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_openal_ALC.cpp 11 Aug 2003 19:58:12 -0000 1.10 +++ org_lwjgl_openal_ALC.cpp 13 Aug 2003 21:03:18 -0000 1.11 @@ -74,7 +74,7 @@ * C Specification: * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nGetString (JNIEnv *env, jclass clazz, jint deviceaddress, jint token) { +JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *env, jclass clazz, jint deviceaddress, jint token) { const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); if(alcString == NULL) { return NULL; @@ -92,7 +92,7 @@ * C Specification: * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest, int offset) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest, int offset) { ALint* address = NULL; if (dest != NULL) { address = offset + (ALint*) env->GetDirectBufferAddress(dest); @@ -212,7 +212,7 @@ * C Specification: * void alcProcessContext(ALCcontext *context); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nProcessContext (JNIEnv *env, jclass clazz, jint contextaddress) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *env, jclass clazz, jint contextaddress) { alcProcessContext((ALCcontext*) contextaddress); } @@ -298,7 +298,7 @@ * C Specification: * ALCenum alcGetError(ALCdevice *device); */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetError (JNIEnv *env, jclass clazz, jint deviceaddress) { +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *env, jclass clazz, jint deviceaddress) { jint result = alcGetError((ALCdevice*) deviceaddress); CHECK_ALC_ERROR return result; @@ -310,7 +310,7 @@ * C Specification: * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nIsExtensionPresent (JNIEnv *env, jclass clazz, jint deviceaddress, jstring extName) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *env, jclass clazz, jint deviceaddress, jstring extName) { /* get extension */ ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(extName, 0)); @@ -328,7 +328,7 @@ * C Specification: * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName); */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetEnumValue (JNIEnv *env, jclass clazz, jint deviceaddress, jstring enumName) { +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *env, jclass clazz, jint deviceaddress, jstring enumName) { /* get extension */ ALubyte* enumerationname = (ALubyte*) (env->GetStringUTFChars(enumName, 0)); Index: org_lwjgl_openal_ALC.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_ALC.h 11 Aug 2003 19:58:12 -0000 1.6 +++ org_lwjgl_openal_ALC.h 13 Aug 2003 21:03:18 -0000 1.7 @@ -64,18 +64,18 @@ /* * Class: org_lwjgl_openal_ALC - * Method: nGetString + * Method: nalcGetString * Signature: (II)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nGetString +JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nalcGetString (JNIEnv *, jclass, jint, jint); /* * Class: org_lwjgl_openal_ALC - * Method: nGetIntegerv + * Method: nalcGetIntegerv * Signature: (IIILjava/nio/Buffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nalcGetIntegerv (JNIEnv *, jclass, jint, jint, jint, jobject, jint); /* @@ -112,10 +112,10 @@ /* * Class: org_lwjgl_openal_ALC - * Method: nProcessContext + * Method: nalcProcessContext * Signature: (I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nProcessContext +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nalcProcessContext (JNIEnv *, jclass, jint); /* @@ -152,26 +152,26 @@ /* * Class: org_lwjgl_openal_ALC - * Method: nGetError + * Method: nalcGetError * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetError +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetError (JNIEnv *, jclass, jint); /* * Class: org_lwjgl_openal_ALC - * Method: nIsExtensionPresent + * Method: nalcIsExtensionPresent * Signature: (ILjava/lang/String;)Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nIsExtensionPresent +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nalcIsExtensionPresent (JNIEnv *, jclass, jint, jstring); /* * Class: org_lwjgl_openal_ALC - * Method: nGetEnumValue + * Method: nalcGetEnumValue * Signature: (ILjava/lang/String;)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetEnumValue +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nalcGetEnumValue (JNIEnv *, jclass, jint, jstring); #ifdef __cplusplus |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv12529/openal Modified Files: ALCTest.java MovingSoundTest.java OpenALCreationTest.java PlayTest.java PlayTestMemory.java SourceLimitTest.java StressTest.java Log Message: fix: updated to 0.7 Index: ALCTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ALCTest.java 2 Jul 2003 22:35:26 -0000 1.7 +++ ALCTest.java 13 Aug 2003 21:03:57 -0000 1.8 @@ -77,14 +77,9 @@ //mo query buffer.rewind(); - ALC.alcGetIntegerv( - ALC.ALC_MAJOR_VERSION, - 4, - buffer); - ALC.alcGetIntegerv( - ALC.ALC_MINOR_VERSION, - 4, - ((IntBuffer)buffer.position(4)).slice()); + buffer.limit(1); + ALC.alcGetInteger(ALC.ALC_MAJOR_VERSION, buffer); + ALC.alcGetInteger(ALC.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1).limit(2)); System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0)); System.out.println("ALC_MINOR_VERSION: " + buffer.get(1)); Index: MovingSoundTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- MovingSoundTest.java 4 Aug 2003 10:09:39 -0000 1.16 +++ MovingSoundTest.java 13 Aug 2003 21:03:57 -0000 1.17 @@ -35,9 +35,9 @@ import org.lwjgl.openal.eax.*; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.Window; +import org.lwjgl.vector.Vector3f; import java.nio.IntBuffer; -import java.nio.FloatBuffer; /** * $Id$ @@ -76,8 +76,8 @@ int lastError; - FloatBuffer sourcePosition = createFloatBuffer(3); - FloatBuffer listenerPosition = createFloatBuffer(3); + Vector3f sourcePosition = new Vector3f(); + Vector3f listenerPosition = new Vector3f(); boolean eaxApplied = false; EAXListenerProperties eaxListenerProp = null; @@ -94,12 +94,14 @@ IntBuffer sources = createIntBuffer(1); // al generate buffers and sources - AL.alGenBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alGenBuffers(buffers); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alGenSources(1, sources); + sources.position(0).limit(1); + AL.alGenSources(sources); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } @@ -159,24 +161,24 @@ Keyboard.poll(); if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) { if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - listenerPosition.put(0, listenerPosition.get(0) - MOVEMENT); - AL.alListenerfv(AL.AL_POSITION, listenerPosition); - System.out.println("listenerx: " + listenerPosition.get(0)); + listenerPosition.x -= MOVEMENT; + AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z); + System.out.println("listenerx: " + listenerPosition.x); } else { - sourcePosition.put(0, sourcePosition.get(0) - MOVEMENT); - AL.alSourcefv(sources.get(0), AL.AL_POSITION, sourcePosition); - System.out.println("sourcex: " + sourcePosition.get(0)); + sourcePosition.x -= MOVEMENT; + AL.alSource3f(sources.get(0), AL.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z); + System.out.println("sourcex: " + sourcePosition.x); } } if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) { if(Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { - listenerPosition.put(0, listenerPosition.get(0) + MOVEMENT); - AL.alListenerfv(AL.AL_POSITION, listenerPosition); - System.out.println("listenerx: " + listenerPosition.get(0)); + listenerPosition.x += MOVEMENT; + AL.alListener3f(AL.AL_POSITION, listenerPosition.x, listenerPosition.y, listenerPosition.z); + System.out.println("listenerx: " + listenerPosition.x); } else { - sourcePosition.put(0, sourcePosition.get(0) + MOVEMENT); - AL.alSourcefv(sources.get(0), AL.AL_POSITION, sourcePosition); - System.out.println("sourcex: " + sourcePosition.get(0)); + sourcePosition.x += MOVEMENT; + AL.alSource3f(sources.get(0), AL.AL_POSITION, sourcePosition.x, sourcePosition.y, sourcePosition.z); + System.out.println("sourcex: " + sourcePosition.x); } } @@ -208,12 +210,14 @@ } //delete buffers and sources - AL.alDeleteSources(1, sources); + sources.position(0).limit(1); + AL.alDeleteSources(sources); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alDeleteBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alDeleteBuffers(buffers); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } Index: OpenALCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- OpenALCreationTest.java 2 Jul 2003 22:35:26 -0000 1.4 +++ OpenALCreationTest.java 13 Aug 2003 21:03:57 -0000 1.5 @@ -136,12 +136,14 @@ IntBuffer sources = createIntBuffer(1); // al generate buffers and sources - AL.alGenBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alGenBuffers(buffers); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alGenSources(1, sources); + sources.position(0).limit(1); + AL.alGenSources(sources); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } @@ -196,12 +198,14 @@ } //delete buffers and sources - AL.alDeleteSources(1, sources); + sources.position(0).limit(1); + AL.alDeleteSources(sources); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alDeleteBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alDeleteBuffers(buffers); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- PlayTest.java 2 Jul 2003 22:35:26 -0000 1.7 +++ PlayTest.java 13 Aug 2003 21:03:57 -0000 1.8 @@ -69,12 +69,14 @@ IntBuffer sources = createIntBuffer(1); // al generate buffers and sources - AL.alGenBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alGenBuffers(buffers); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alGenSources(1, sources); + sources.position(0).limit(1); + AL.alGenSources(sources); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } @@ -123,12 +125,14 @@ } //delete buffers and sources - AL.alDeleteSources(1, sources); + sources.position(0).limit(1); + AL.alDeleteSources(sources); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alDeleteBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alDeleteBuffers(buffers); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- PlayTestMemory.java 2 Jul 2003 22:35:26 -0000 1.7 +++ PlayTestMemory.java 13 Aug 2003 21:03:57 -0000 1.8 @@ -73,12 +73,14 @@ IntBuffer sources = createIntBuffer(1); // al generate buffers and sources - AL.alGenBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alGenBuffers(buffers); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alGenSources(1, sources); + sources.position(0).limit(1); + AL.alGenSources(sources); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } @@ -135,12 +137,14 @@ } //delete buffers and sources - AL.alDeleteSources(1, sources); + sources.position(0).limit(1); + AL.alDeleteSources(sources); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - AL.alDeleteBuffers(1, buffers); + buffers.position(0).limit(1); + AL.alDeleteBuffers(buffers); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } Index: SourceLimitTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- SourceLimitTest.java 2 Jul 2003 22:35:26 -0000 1.6 +++ SourceLimitTest.java 13 Aug 2003 21:03:57 -0000 1.7 @@ -96,14 +96,16 @@ IntBuffer sources = createIntBuffer(sourcesToCreate); //Create sourcesToCreate sources in one fell swoop - AL.alGenSources(sourcesToCreate, sources); + sources.position(0).limit(sourcesToCreate); + AL.alGenSources(sources); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { System.out.println("failed to create " + sourcesToCreate + " sources (" + AL.alGetString(lastError) + ")"); return; } //delete sources - AL.alDeleteSources(sourcesToCreate, sources); + sources.position(0).limit(sourcesToCreate); + AL.alDeleteSources(sources); System.out.println("created " + sourcesToCreate + " sources successfully!"); } @@ -121,7 +123,8 @@ //create the sources for (int i = 0; i <= sourcesToCreate; i++) { sources[i] = createIntBuffer(1); - AL.alGenSources(1, sources[i]); + sources[i].position(0).limit(1); + AL.alGenSources(sources[i]); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { System.out.println("failed to create source: " + (i + 1)); break; @@ -132,7 +135,8 @@ //delete allocated sources for (int i = 0; i < sourcesCreated; i++) { //delete buffers and sources - AL.alDeleteSources(1, sources[i]); + sources[i].position(0).limit(1); + AL.alDeleteSources(sources[i]); if ((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { System.out.println("failed to delete source: " + i + "(" + AL.alGetString(lastError) + ")"); break; Index: StressTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- StressTest.java 2 Jul 2003 22:35:26 -0000 1.5 +++ StressTest.java 13 Aug 2003 21:03:57 -0000 1.6 @@ -79,7 +79,8 @@ private void createSources() { sources = createIntBuffer(4); - AL.alGenSources(4, sources); + sources.position(0).limit(4); + AL.alGenSources(sources); if (AL.alGetError() != AL.AL_NO_ERROR) { System.out.println("Unable to create 4 sources"); alExit(); @@ -88,10 +89,12 @@ private void createBuffers() { buffers = createIntBuffer(10); - AL.alGenBuffers(10, buffers); + buffers.position(0).limit(10); + AL.alGenBuffers(buffers); if (AL.alGetError() != AL.AL_NO_ERROR) { System.out.println("Unable to create 10 buffers"); - AL.alDeleteSources(4, sources); + sources.position(0).limit(4); + AL.alDeleteSources(sources); alExit(); } } @@ -109,8 +112,11 @@ if (AL.alGetError() != AL.AL_NO_ERROR) { System.out.println("Failed to load " + i + ".wav into buffer"); - AL.alDeleteSources(4, sources); - AL.alDeleteBuffers(10, buffers); + sources.position(0).limit(4); + AL.alDeleteSources(sources); + buffers.position(0).limit(10); + AL.alDeleteBuffers(buffers); + alExit(); } } @@ -191,8 +197,10 @@ } catch (Exception e) { } - AL.alDeleteSources(4, sources); - AL.alDeleteBuffers(10, buffers); + sources.position(0).limit(4); + AL.alDeleteSources(sources); + buffers.position(0).limit(10); + AL.alDeleteBuffers(buffers); } private int getRandomBuffer() { |
|
From: Brian M. <ma...@us...> - 2003-08-13 21:04:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1:/tmp/cvs-serv12529 Modified Files: WindowCreationTest.java Log Message: fix: updated to 0.7 Index: WindowCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- WindowCreationTest.java 4 Aug 2003 10:09:39 -0000 1.8 +++ WindowCreationTest.java 13 Aug 2003 21:03:57 -0000 1.9 @@ -18,11 +18,15 @@ DisplayMode[] modes = Display.getAvailableDisplayModes(); System.out.println("Found " + modes.length + " display modes"); + try { Window.create("WindowCreationTest", 50, 50, 320, 240, 16, 0, 0, 0); } catch (Exception e) { e.printStackTrace(); } + + System.out.println(Window.getHeight() + ", " + Window.getWidth() + ", " + Window.getTitle()); + System.out.println("Display created"); |
|
From: Brian M. <ma...@us...> - 2003-08-13 21:04:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv12250 Removed Files: ALTest.java Log Message: removed file - too many changes required for 0.7, semi b0rked anyway --- ALTest.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java |
|
From: Elias N. <eli...@us...> - 2003-08-13 20:08:29
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv5109/src/java/org/lwjgl/vector Modified Files: Matrix3f.java Log Message: Fixed a Matrix3f.invert() bug 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.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- Matrix3f.java 12 Aug 2003 10:46:53 -0000 1.15 +++ Matrix3f.java 13 Aug 2003 17:27:18 -0000 1.16 @@ -394,7 +394,7 @@ float determinant_inv = 1f/determinant; // get the conjugate matrix - float t00 = m11 * m22 - m12* m22; + float t00 = m11 * m22 - m12* m21; float t01 = - m10 * m22 + m12 *m20; float t02 = m10 * m21 - m11 * m20; float t10 = - m01 * m22 + m02 * m21; |
|
From: Elias N. <eli...@us...> - 2003-08-12 11:11:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv9221/src/java/org/lwjgl/vector Modified Files: Matrix2f.java Log Message: Matrix2f.invert() returns null on failure 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.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Matrix2f.java 30 Apr 2003 15:38:12 -0000 1.11 +++ Matrix2f.java 12 Aug 2003 10:38:11 -0000 1.12 @@ -291,7 +291,7 @@ /** * Invert this matrix - * @return this + * @return this if successful, null otherwise */ public Matrix invert() { @@ -300,18 +300,21 @@ 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; + float determinant = determinant(); + if (determinant != 0) { + float determinant_inv = 1f/determinant; + float t00 = m11*determinant_inv; + float t01 = -m01*determinant_inv; + float t11 = m00*determinant_inv; + float t10 = -m10*determinant_inv; - return this; + m00 = t00; + m01 = t01; + m10 = t10; + m11 = t11; + return this; + } else + return null; } /** |
|
From: Elias N. <eli...@us...> - 2003-08-12 10:54:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv8914/src/java/org/lwjgl/vector Modified Files: Matrix3f.java Log Message: Matrix3f.invert() returns null on failure 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.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Matrix3f.java 30 Apr 2003 15:38:12 -0000 1.13 +++ Matrix3f.java 12 Aug 2003 10:36:00 -0000 1.14 @@ -364,13 +364,11 @@ /** * Invert this matrix - * @return this + * @return this if successful, null otherwise */ public Matrix invert() { - float determinant = m00 * (m11 * m22 - m12 * m21) - + m01 * (m12 * m20 - m10 * m22) - + m02 * (m10 * m21 - m11 * m20); + float determinant = determinant(); if (determinant != 0) { @@ -382,6 +380,7 @@ m10 m11 m12 m20 m21 m22 */ + float determinant_inv = 1f/determinant; // get the conjugate matrix float t00 = m11 * m22 - m12* m22; @@ -395,19 +394,18 @@ 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; + m00 = t00*determinant_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + return this; + } else + return null; } /** |
|
From: Elias N. <eli...@us...> - 2003-08-12 10:46:57
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv10591/src/java/org/lwjgl/vector Modified Files: Matrix2f.java Matrix3f.java Matrix4f.java Log Message: 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.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Matrix2f.java 12 Aug 2003 10:38:11 -0000 1.12 +++ Matrix2f.java 12 Aug 2003 10:46:53 -0000 1.13 @@ -294,27 +294,37 @@ * @return this if successful, null otherwise */ public Matrix invert() - { + { - /* - inv(A) = 1/det(A) * adj(A); - */ - - float determinant = determinant(); - if (determinant != 0) { - float determinant_inv = 1f/determinant; - float t00 = m11*determinant_inv; - float t01 = -m01*determinant_inv; - float t11 = m00*determinant_inv; - float t10 = -m10*determinant_inv; - - m00 = t00; - m01 = t01; - m10 = t10; - m11 = t11; - return this; - } else - return null; + /* + *inv(A) = 1/det(A) * adj(A); + */ + + float determinant = determinant(); + if (determinant != 0) { + float determinant_inv = 1f/determinant; + float t00 = m11*determinant_inv; + float t01 = -m01*determinant_inv; + float t11 = m00*determinant_inv; + float t10 = -m10*determinant_inv; + + m00 = t00; + m01 = t01; + m10 = t10; + m11 = t11; + return this; + } else + return null; + } + + /** + * Returns a string representation of this matrix + */ + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append(m00).append(' ').append(m10).append(' ').append('\n'); + buf.append(m01).append(' ').append(m11).append(' ').append('\n'); + return buf.toString(); } /** 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.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Matrix3f.java 12 Aug 2003 10:36:00 -0000 1.14 +++ Matrix3f.java 12 Aug 2003 10:46:53 -0000 1.15 @@ -363,49 +363,60 @@ } /** + * Returns a string representation of this matrix + */ + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append('\n'); + buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append('\n'); + buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append('\n'); + return buf.toString(); + } + + /** * Invert this matrix * @return this if successful, null otherwise */ public Matrix invert() - { + { float determinant = determinant(); - - 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 - */ - float determinant_inv = 1f/determinant; - - // 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_inv; - m11 = t11*determinant_inv; - m22 = t22*determinant_inv; - m01 = t10*determinant_inv; - m10 = t01*determinant_inv; - m20 = t02*determinant_inv; - m02 = t20*determinant_inv; - m12 = t21*determinant_inv; - m21 = t12*determinant_inv; - return this; - } else - return null; + + 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 + */ + float determinant_inv = 1f/determinant; + + // 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_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + return this; + } else + return null; } /** 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.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- Matrix4f.java 12 Aug 2003 09:59:00 -0000 1.18 +++ Matrix4f.java 12 Aug 2003 10:46:53 -0000 1.19 @@ -526,15 +526,15 @@ m21 = m01 * f20 + m11 * f21 + m21 * f22; m22 = m02 * f20 + m12 * f21 + m22 * f22; m23 = m03 * f20 + m13 * f21 + m23 * f22; - m00 = t00; - m01 = t01; - m02 = t02; - m03 = t03; - m10 = t10; - m11 = t11; - m12 = t12; - m13 = t13; - return this; + m00 = t00; + m01 = t01; + m02 = t02; + m03 = t03; + m10 = t10; + m11 = t11; + m12 = t12; + m13 = t13; + return this; } /** @@ -584,7 +584,7 @@ dest.m21 = m01 * f8 + m11 * f9 + m21 * f10; dest.m22 = m02 * f8 + m12 * f9 + m22 * f10; dest.m23 = m03 * f8 + m13 * f9 + m23 * f10; - return dest; + return dest; } /** @@ -687,19 +687,19 @@ return f; } - /** - * Calculate the determinant of a 3x3 matrix - * @return result - */ + /** + * 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); - } + 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 @@ -707,59 +707,59 @@ */ public Matrix invert() { - float determinant = determinant(); - - if (determinant != 0) - { - /* - m00 m01 m02 m03 - m10 m11 m12 m13 - m20 m21 m22 m23 - m30 m31 m32 m33 - */ - float determinant_inv = 1f/determinant; - - // 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_inv; - m11 = t11*determinant_inv; - m22 = t22*determinant_inv; - m33 = t33*determinant_inv; - m01 = t10*determinant_inv; - m10 = t01*determinant_inv; - m20 = t02*determinant_inv; - m02 = t20*determinant_inv; - m12 = t21*determinant_inv; - m21 = t12*determinant_inv; - m03 = t30*determinant_inv; - m30 = t03*determinant_inv; - m13 = t31*determinant_inv; - m31 = t13*determinant_inv; - m32 = t23*determinant_inv; - m23 = t32*determinant_inv; - return this; - } else - return null; + float determinant = determinant(); + + if (determinant != 0) + { + /* + * m00 m01 m02 m03 + * m10 m11 m12 m13 + * m20 m21 m22 m23 + * m30 m31 m32 m33 + */ + float determinant_inv = 1f/determinant; + + // 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_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m33 = t33*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + m03 = t30*determinant_inv; + m30 = t03*determinant_inv; + m13 = t31*determinant_inv; + m31 = t13*determinant_inv; + m32 = t23*determinant_inv; + m23 = t32*determinant_inv; + return this; + } else + return null; } /** |
|
From: Elias N. <eli...@us...> - 2003-08-12 10:15:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv4606/src/java/org/lwjgl/vector Modified Files: Matrix4f.java Log Message: Matrix4f.invert() returns null on failure 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.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Matrix4f.java 12 Aug 2003 09:33:02 -0000 1.17 +++ Matrix4f.java 12 Aug 2003 09:59:00 -0000 1.18 @@ -703,7 +703,7 @@ /** * Invert this matrix - * @return this + * @return this if successful, null otherwise */ public Matrix invert() { @@ -757,8 +757,9 @@ m31 = t13*determinant_inv; m32 = t23*determinant_inv; m23 = t32*determinant_inv; - } - return this; + return this; + } else + return null; } /** |
|
From: Elias N. <eli...@us...> - 2003-08-12 09:33:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv1111/src/java/org/lwjgl/vector Modified Files: Matrix4f.java Log Message: Optimized Matrix4f.invert() 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.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Matrix4f.java 28 Jul 2003 08:20:08 -0000 1.16 +++ Matrix4f.java 12 Aug 2003 09:33:02 -0000 1.17 @@ -717,6 +717,7 @@ m20 m21 m22 m23 m30 m31 m32 m33 */ + float determinant_inv = 1f/determinant; // first row float t00 = determinant3x3( m11, m12, m13, m21, m22, m23, m31, m32, m33 ); @@ -740,22 +741,22 @@ 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; + m00 = t00*determinant_inv; + m11 = t11*determinant_inv; + m22 = t22*determinant_inv; + m33 = t33*determinant_inv; + m01 = t10*determinant_inv; + m10 = t01*determinant_inv; + m20 = t02*determinant_inv; + m02 = t20*determinant_inv; + m12 = t21*determinant_inv; + m21 = t12*determinant_inv; + m03 = t30*determinant_inv; + m30 = t03*determinant_inv; + m13 = t31*determinant_inv; + m31 = t13*determinant_inv; + m32 = t23*determinant_inv; + m23 = t32*determinant_inv; } return this; } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-11 21:23:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv15739/src/native/common Modified Files: org_lwjgl_openal_CoreAL.cpp Log Message: Glitch fixin' Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_CoreAL.cpp 11 Aug 2003 19:58:12 -0000 1.6 +++ org_lwjgl_openal_CoreAL.cpp 11 Aug 2003 20:11:45 -0000 1.7 @@ -276,7 +276,7 @@ * C Specification: * ALvoid alGenSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenSources (JNIEnv *env, jclass clazz, jint n, jobject sources, int offset) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenSources (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { alGenSources(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -287,7 +287,7 @@ * C Specification: * ALvoid alDeleteSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteSources (JNIEnv *env, jclass clazz, jint n, jobject sources, int offset) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteSources (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { alDeleteSources(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -503,7 +503,7 @@ * C Specification: * ALvoid alBufferData(ALuint buffer,ALenum format,ALvoid *data,ALsizei size,ALsizei freq); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alBufferData (JNIEnv *env, jclass clazz, jint buffer, jint format, jobject data, int offset, jint size, jint freq) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalBufferData (JNIEnv *env, jclass clazz, jint buffer, jint format, jobject data, jint offset, jint size, jint freq) { alBufferData(buffer, format, (void*) (offset + (ALubyte *)env->GetDirectBufferAddress(data)), size, freq); CHECK_AL_ERROR } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-11 20:26:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv13701/src/java/org/lwjgl/openal Modified Files: CoreAL.java Log Message: New buffer code Index: CoreAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CoreAL.java 11 Aug 2003 19:57:52 -0000 1.19 +++ CoreAL.java 11 Aug 2003 19:59:37 -0000 1.20 @@ -594,7 +594,7 @@ * * @param buffers Buffer to delete from */ - public static void alDeleteBuffers(int n, IntBuffer buffers) { + public static void alDeleteBuffers(IntBuffer buffers) { nalDeleteBuffers(buffers.remaining(), buffers, buffers.position()); } private static native void nalDeleteBuffers(int n, IntBuffer buffers, int offset); |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-11 20:03:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv13366/src/java/org/lwjgl/openal Modified Files: ALCcontext.java ALC.java CoreAL.java BaseAL.java Log Message: New buffer code Index: ALCcontext.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ALCcontext.java 3 Aug 2003 17:32:48 -0000 1.5 +++ ALCcontext.java 11 Aug 2003 19:57:52 -0000 1.6 @@ -31,7 +31,7 @@ */ package org.lwjgl.openal; -import java.nio.Buffer; +import java.nio.*; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -57,16 +57,16 @@ this.context = context; } - static Buffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) { - ByteBuffer attribList = ByteBuffer.allocateDirect(7*4).order(ByteOrder.nativeOrder()); + static IntBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) { + IntBuffer attribList = ByteBuffer.allocateDirect(7*4).order(ByteOrder.nativeOrder()).asIntBuffer(); - attribList.putInt(ALC.ALC_FREQUENCY); - attribList.putInt(contextFrequency); - attribList.putInt(ALC.ALC_REFRESH); - attribList.putInt(contextRefresh); - attribList.putInt(ALC.ALC_SYNC); - attribList.putInt(contextSynchronized); - attribList.putInt(0); //terminating int + attribList.put(ALC.ALC_FREQUENCY); + attribList.put(contextFrequency); + attribList.put(ALC.ALC_REFRESH); + attribList.put(contextRefresh); + attribList.put(ALC.ALC_SYNC); + attribList.put(contextSynchronized); + attribList.put(0); //terminating int return attribList; } Index: ALC.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ALC.java 3 Aug 2003 17:32:48 -0000 1.9 +++ ALC.java 11 Aug 2003 19:57:52 -0000 1.10 @@ -32,6 +32,7 @@ package org.lwjgl.openal; import java.nio.Buffer; +import java.nio.IntBuffer; /** * $Id$ @@ -65,7 +66,7 @@ public class ALC { /** Has the ALC object been created? */ protected static boolean created; - + /** Bad value */ public static final int ALC_INVALID = -1; @@ -78,39 +79,39 @@ /** Errors: No Error */ public static final int ALC_NO_ERROR = ALC_FALSE; - /** Major version query. */ + /** Major version query. */ public static final int ALC_MAJOR_VERSION = 0x1000; - - /** Minor version query. */ + + /** Minor version query. */ public static final int ALC_MINOR_VERSION = 0x1001; - - /** - * The size required for the zero-terminated attributes list, for the current context. - **/ + + /** + * The size required for the zero-terminated attributes list, for the current context. + **/ public static final int ALC_ATTRIBUTES_SIZE = 0x1002; - - /** - * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, - * and provides the attribute list for the current context of the specified device. - */ + + /** + * Expects a destination of ALC_CURRENT_ATTRIBUTES_SIZE, + * and provides the attribute list for the current context of the specified device. + */ public static final int ALC_ALL_ATTRIBUTES = 0x1003; - /** The specifier string for the default device */ + /** The specifier string for the default device */ public static final int ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004; - - /** The specifier string for the device */ + + /** The specifier string for the device */ public static final int ALC_DEVICE_SPECIFIER = 0x1005; - - /** The extensions string for diagnostics and printing */ + + /** The extensions string for diagnostics and printing */ public static final int ALC_EXTENSIONS = 0x1006; - /** Frequency for mixing output buffer, in units of Hz. */ + /** Frequency for mixing output buffer, in units of Hz. */ public static final int ALC_FREQUENCY = 0x1007; - - /** Refresh intervalls, in units of Hz. */ + + /** Refresh intervalls, in units of Hz. */ public static final int ALC_REFRESH = 0x1008; - - /** Flag, indicating a synchronous context. */ + + /** Flag, indicating a synchronous context. */ public static final int ALC_SYNC = 0x1009; /** The device argument does not name a valid device */ @@ -143,8 +144,8 @@ } /** Creates a new instance of ALC */ - protected ALC() { - } + protected ALC() { + } /** * Override to provide any initialization code after creation. @@ -164,7 +165,7 @@ * * @throws Exception if a failiure occured in the ALC creation process */ - protected static void create() throws OpenALException { + protected static void create() throws OpenALException { if (created) { return; } @@ -173,7 +174,7 @@ throw new OpenALException("ALC instance could not be created."); } init(); - created = true; + created = true; } /** @@ -186,7 +187,7 @@ /** * Calls whatever destruction rutines that are needed */ - protected static void destroy() { + protected static void destroy() { if (!created) { return; } @@ -199,61 +200,60 @@ */ protected static native void nDestroy(); - /** - * The application can obtain certain strings from ALC. - * - * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device - * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device - * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing. - * - * In addition, printable error message strings are provided for all valid error tokens, - * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>, - * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>. - * - * @param pname Property to get - * @return String property from device - */ + /** + * The application can obtain certain strings from ALC. + * + * <code>ALC_DEFAULT_DEVICE_SPECIFIER</code> - The specifer string for the default device + * <code>ALC_DEVICE_SPECIFIER</code> - The specifer string for the device + * <code>ALC_EXTENSIONS</code> - The extensions string for diagnostics and printing. + * + * In addition, printable error message strings are provided for all valid error tokens, + * including <code>ALC_NO_ERROR</code>,<code>ALC_INVALID_DEVICE</code>, <code>ALC_INVALID_CONTEXT</code>, + * <code>ALC_INVALID_ENUM</code>, <code>ALC_INVALID_VALUE</code>. + * + * @param pname Property to get + * @return String property from device + */ public static String alcGetString(int pname) { - return nGetString(AL.device.device, pname); + return nGetString(AL.device.device, pname); } - - native static String nGetString(int device, int pname); + + native static String nGetString(int device, int pname); /** * The application can query ALC for information using an integer query function. - * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code> - * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to - * specify the size of the destination buffer provided. A <code>null</code> destination or a zero - * size parameter will cause ALC to ignore the query. - * - * <code>ALC_MAJOR_VERSION</code> - Major version query. - * <code>ALC_MINOR_VERSION</code> - Minor version query. - * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list, - * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context - * for the specified device) is legal. - * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>, - * and provides the attribute list for the current context of the specified device. - * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device) - * will return the default attributes defined by the specified device. + * For some tokens, <code>null</code> is a legal deviceHandle. In other cases, specifying a <code>null</code> + * device will generate an <code>ALC_INVALID_DEVICE</code> error. The application has to + * specify the size of the destination buffer provided. A <code>null</code> destination or a zero + * size parameter will cause ALC to ignore the query. + * + * <code>ALC_MAJOR_VERSION</code> - Major version query. + * <code>ALC_MINOR_VERSION</code> - Minor version query. + * <code>ALC_ATTRIBUTES_SIZE</code> - The size required for the zero-terminated attributes list, + * for the current context. <code>null</code> is an invalid device. <code>null</code> (no current context + * for the specified device) is legal. + * <code>ALC_ALL_ATTRIBUTES</code> - Expects a destination of <code>ALC_CURRENT_ATTRIBUTES_SIZE</code>, + * and provides the attribute list for the current context of the specified device. + * <code>null</code> is an invalid device. <code>null</code> (no current context for the specified device) + * will return the default attributes defined by the specified device. * * @param pname Property to get - * @param size Size of destination buffer provided * @param integerdata ByteBuffer to write integers to */ - public static void alcGetIntegerv(int pname, int size, Buffer integerdata) { - nGetIntegerv(AL.device.device, pname, size, integerdata); - } - - native static void nGetIntegerv(int device, int pname, int size, Buffer integerdata); + public static void alcGetInteger(int pname, IntBuffer integerdata) { + nGetIntegerv(AL.device.device, pname, integerdata.remaining(), integerdata, integerdata.position()); + } + + native static void nGetIntegerv(int device, int pname, int size, Buffer integerdata, int offset); /** * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to - * connect to a device (i.e. the server). - * - * If the function returns <code>null</code>, then no sound driver/device has been found. The - * argument is a null terminated string that requests a certain device or device - * configuration. If <code>null</code> is specified, the implementation will provide an - * implementation specific default. + * connect to a device (i.e. the server). + * + * If the function returns <code>null</code>, then no sound driver/device has been found. The + * argument is a null terminated string that requests a certain device or device + * configuration. If <code>null</code> is specified, the implementation will provide an + * implementation specific default. * * @param devicename name of device to open * @return opened device, or null @@ -262,10 +262,10 @@ /** * The <code>alcCloseDevice</code> function allows the application (i.e. the client program) to - * disconnect from a device (i.e. the server). - * - * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be - * generated. Once closed, a deviceHandle is invalid. + * disconnect from a device (i.e. the server). + * + * If deviceHandle is <code>null</code> or invalid, an <code>ALC_INVALID_DEVICE</code> error will be + * generated. Once closed, a deviceHandle is invalid. * * @param device address of native device to close */ @@ -273,57 +273,57 @@ /** * A context is created using <code>alcCreateContext</code>. The device parameter has to be a valid - * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs - * composed of valid ALC attribute tokens and requested values. - * - * Context creation will fail if the application requests attributes that, by themselves, - * can not be provided. Context creation will fail if the combination of specified - * attributes can not be provided. Context creation will fail if a specified attribute, or - * the combination of attributes, does not match the default values for unspecified - * attributes. + * device. The attribute list can be <code>null</code>, or a zero terminated list of integer pairs + * composed of valid ALC attribute tokens and requested values. + * + * Context creation will fail if the application requests attributes that, by themselves, + * can not be provided. Context creation will fail if the combination of specified + * attributes can not be provided. Context creation will fail if a specified attribute, or + * the combination of attributes, does not match the default values for unspecified + * attributes. * * @param device address of device to associate context to * @param attrList Buffer to read attributes from * @return New context, or null if creation failed */ - native static ALCcontext alcCreateContext(int device, Buffer attrList); + native static ALCcontext alcCreateContext(int device, IntBuffer attrList); /** * To make a Context current with respect to AL Operation (state changes by issueing - * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code> - * or a valid context pointer. The operation will apply to the device that the context - * was created for. - * - * For each OS process (usually this means for each application), only one context can - * be current at any given time. All AL commands apply to the current context. - * Commands that affect objects shared among contexts (e.g. buffers) have side effects - * on other contexts. + * commands), <code>alcMakeContextCurrent</code> is used. The context parameter can be <code>null</code> + * or a valid context pointer. The operation will apply to the device that the context + * was created for. + * + * For each OS process (usually this means for each application), only one context can + * be current at any given time. All AL commands apply to the current context. + * Commands that affect objects shared among contexts (e.g. buffers) have side effects + * on other contexts. * * @param context address of context to make current * @return true if successfull, false if not */ native static boolean alcMakeContextCurrent(int context); - /** - * The current context is the only context accessible to state changes by AL commands - * (aside from state changes affecting shared objects). However, multiple contexts can - * be processed at the same time. To indicate that a context should be processed (i.e. - * that internal execution state like offset increments are supposed to be performed), - * the application has to use <code>alcProcessContext</code>. - * - * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is - * already marked as processing. The default state of a context created by - * alcCreateContext is that it is not marked as processing. - */ - public static void alcProcessContext() { - nProcessContext(AL.context.context); - } - - native static void nProcessContext(int context); + /** + * The current context is the only context accessible to state changes by AL commands + * (aside from state changes affecting shared objects). However, multiple contexts can + * be processed at the same time. To indicate that a context should be processed (i.e. + * that internal execution state like offset increments are supposed to be performed), + * the application has to use <code>alcProcessContext</code>. + * + * Repeated calls to <code>alcProcessContext</code> are legal, and do not affect a context that is + * already marked as processing. The default state of a context created by + * alcCreateContext is that it is not marked as processing. + */ + public static void alcProcessContext() { + nProcessContext(AL.context.context); + } + + native static void nProcessContext(int context); /** * The application can query for, and obtain an handle to, the current context for the - * application. If there is no current context, <code>null</code> is returned. + * application. If there is no current context, <code>null</code> is returned. * * @return Current ALCcontext */ @@ -339,13 +339,13 @@ /** * The application can suspend any context from processing (including the current - * one). To indicate that a context should be suspended from processing (i.e. that - * internal execution state like offset increments is not supposed to be changed), the - * application has to use <code>alcSuspendContext</code>. - * - * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is - * already marked as suspended. The default state of a context created by - * <code>alcCreateContext</code> is that it is marked as suspended. + * one). To indicate that a context should be suspended from processing (i.e. that + * internal execution state like offset increments is not supposed to be changed), the + * application has to use <code>alcSuspendContext</code>. + * + * Repeated calls to <code>alcSuspendContext</code> are legal, and do not affect a context that is + * already marked as suspended. The default state of a context created by + * <code>alcCreateContext</code> is that it is marked as suspended. * * @param context address of context to suspend */ @@ -353,7 +353,7 @@ /** * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and - * <code>null</code>. Applications should not attempt to destroy a current context. + * <code>null</code>. Applications should not attempt to destroy a current context. * * @param context address of context to Destroy */ @@ -361,53 +361,53 @@ /** * ALC uses the same conventions and mechanisms as AL for error handling. In - * particular, ALC does not use conventions derived from X11 (GLX) or Windows - * (WGL). The <code>alcGetError</code> function can be used to query ALC errors. - * - * Error conditions are specific to the device. - * - * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server. - * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context. - * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context. - * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable. - * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable. + * particular, ALC does not use conventions derived from X11 (GLX) or Windows + * (WGL). The <code>alcGetError</code> function can be used to query ALC errors. + * + * Error conditions are specific to the device. + * + * ALC_NO_ERROR - The device handle or specifier does name an accessible driver/server. + * <code>ALC_INVALID_DEVICE</code> - The Context argument does not name a valid context. + * <code>ALC_INVALID_CONTEXT</code> - The Context argument does not name a valid context. + * <code>ALC_INVALID_ENUM</code> - A token used is not valid, or not applicable. + * <code>ALC_INVALID_VALUE</code> - An value (e.g. attribute) is not valid, or not applicable. * * @return Errorcode from ALC statemachine */ - public static int alcGetError() { - return nGetError(AL.device.device); - } - + public static int alcGetError() { + return nGetError(AL.device.device); + } + native static int nGetError(int device); /** - * Verify that a given extension is available for the current context and the device it - * is associated with. - * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string - * tokens. + * Verify that a given extension is available for the current context and the device it + * is associated with. + * A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string + * tokens. * * @param extName name of extension to find * @return true if extension is available, false if not */ - public static boolean alcIsExtensionPresent(String extName) { - return nIsExtensionPresent(AL.device.device, extName); - } - + public static boolean alcIsExtensionPresent(String extName) { + return nIsExtensionPresent(AL.device.device, extName); + } + native static boolean nIsExtensionPresent(int device, String extName); /** * Enumeration/token values are device independend, but tokens defined for - * extensions might not be present for a given device. But only the tokens defined - * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension. - * - * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error. + * extensions might not be present for a given device. But only the tokens defined + * by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension. + * + * Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error. * * @param enumName name of enum to find * @return value of enumeration */ - public static int alcGetEnumValue(String enumName) { - return nGetEnumValue(AL.device.device, enumName); - } - + public static int alcGetEnumValue(String enumName) { + return nGetEnumValue(AL.device.device, enumName); + } + native static int nGetEnumValue(int device, String enumName); } Index: CoreAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- CoreAL.java 3 Aug 2003 17:32:48 -0000 1.18 +++ CoreAL.java 11 Aug 2003 19:57:52 -0000 1.19 @@ -34,9 +34,6 @@ import java.nio.ByteBuffer; import java.nio.IntBuffer; import java.nio.FloatBuffer; -import java.nio.DoubleBuffer; - - /** * $Id$ * <br> @@ -136,36 +133,7 @@ */ public static native float alGetFloat(int pname); - /** - * Like OpenGL, AL uses a simplified interface for querying global state. - * - * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, - * AL_DISTANCE_MODEL. - * <p> - * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors - * in specifying pName. The amount of memory required in the destination - * depends on the actual state requested. - * </p> - * - * @return double state described by pname will be returned. - */ - public static native double alGetDouble(int pname); - - /** - * Like OpenGL, AL uses a simplified interface for querying global state. - * - * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, - * AL_DISTANCE_MODEL. - * <p> - * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors - * in specifying pName. The amount of memory required in the destination - * depends on the actual state requested. - * </p> - * - * @param pname state to be queried - * @param data Buffer to place the booleans in - */ - public static native void alGetBooleanv(int pname, ByteBuffer data); + private static native void nalGetBooleanv(int pname, ByteBuffer data, int offset); /** * Like OpenGL, AL uses a simplified interface for querying global state. @@ -181,7 +149,11 @@ * @param pname state to be queried * @param data Buffer to place the integers in */ - public static native void alGetIntegerv(int pname, IntBuffer data); + public static void alGetInteger(int pname, IntBuffer data) { + assert data.remaining() > 0; + nalGetIntegerv(pname, data, data.position()); + } + private static native void nalGetIntegerv(int pname, IntBuffer data, int offset); /** * Like OpenGL, AL uses a simplified interface for querying global state. @@ -197,23 +169,11 @@ * @param pname state to be queried * @param data Buffer to place the floats in */ - public static native void alGetFloatv(int pname, FloatBuffer data); - - /** - * Like OpenGL, AL uses a simplified interface for querying global state. - * - * Legal values are e.g. AL_DOPPLER_FACTOR, AL_DOPPLER_VELOCITY, - * AL_DISTANCE_MODEL. - * <p> - * <code>null</code> destinations are quietly ignored. AL_INVALID_ENUM is the response to errors - * in specifying pName. The amount of memory required in the destination - * depends on the actual state requested. - * </p> - * - * @param pname state to be queried - * @param data Buffer to place the floats in - */ - public static native void alGetDoublev(int pname, DoubleBuffer data); + public static void alGetFloat(int pname, FloatBuffer data) { + assert data.remaining() > 0; + nalGetFloatv(pname, data, data.position()); + } + private static native void nalGetFloatv(int pname, FloatBuffer data, int position); /** * The application can retrieve state information global to the current AL Context. @@ -367,30 +327,22 @@ /** - * Listener attributes are changed using the Listener group of commands. - * - * @param pname name of the attribute to be set - * @param floatdata Buffer to read floats from - */ - public static native void alListenerfv(int pname, FloatBuffer floatdata); - - /** * Listener state is maintained inside the AL implementation and can be queried in * full. * * @param pname name of the attribute to be retrieved - * @param integerdata Buffer to write integer to + * @return int */ - public static native void alGetListeneri(int pname, IntBuffer integerdata); + public static native int alGetListeneri(int pname); /** * Listener state is maintained inside the AL implementation and can be queried in * full. * * @param pname name of the attribute to be retrieved - * @param floatdata Buffer to write float to + * @return float */ - public static native void alGetListenerf(int pname, FloatBuffer floatdata); + public static native float alGetListenerf(int pname); /** * Listener state is maintained inside the AL implementation and can be queried in @@ -399,23 +351,30 @@ * @param pname name of the attribute to be retrieved * @param floatdata Buffer to write floats to */ - public static native void alGetListenerfv(int pname, FloatBuffer floatdata); + public static void alGetListener(int pname, FloatBuffer floatdata) { + nalGetListenerfv(pname, floatdata, floatdata.position()); + } + private static native void nalGetListenerfv(int pname, FloatBuffer floatdata, int offset); /** * The application requests a number of Sources using GenSources. * - * @param n number of sources to generate * @param sources array holding sources */ - public static native void alGenSources(int n, IntBuffer sources); + public static void alGenSources(IntBuffer sources) { + nalGenSources(sources.remaining(), sources, sources.position()); + } + private static native void nalGenSources(int n, IntBuffer sources, int offset); /** * The application requests deletion of a number of Sources by DeleteSources. * - * @param n Number of sources to delete * @param source Source array to delete from */ - public static native void alDeleteSources(int n, IntBuffer source); + public static void alDeleteSources(IntBuffer source) { + nalDeleteSources(source.remaining(), source, source.position()); + } + private static native void nalDeleteSources(int n, IntBuffer source, int offset); /** * The application can verify whether a source name is valid using the IsSource query. @@ -464,25 +423,15 @@ /** - * Specifies the position and other properties as taken into account during - * sound processing. - * - * @param source source whichs attribute is being set - * @param pname name of the attribute being set - * @param floatdata Buffer to read floats from - */ - public static native void alSourcefv(int source, int pname, FloatBuffer floatdata); - - /** * Source state is maintained inside the AL implementation, and the current attributes * can be queried. The performance of such queries is implementation dependent, no * performance guarantees are made. * * @param source source to get property from * @param pname name of property - * @param integerdata Buffer to write integer to + * @return int */ - public static native void alGetSourcei(int source, int pname, IntBuffer integerdata); + public static native int alGetSourcei(int source, int pname); /** * Source state is maintained inside the AL implementation, and the current attributes @@ -491,9 +440,9 @@ * * @param source source to get property from * @param pname name of property - * @param floatdata Buffer to write float to + * @return float */ - public static native void alGetSourcef(int source, int pname, FloatBuffer floatdata); + public static native float alGetSourcef(int source, int pname); /** * Source state is maintained inside the AL implementation, and the current attributes @@ -504,7 +453,11 @@ * @param pname property to get * @param floatdata Buffer to write floats to */ - public static native void alGetSourcefv(int source, int pname, FloatBuffer floatdata); + public static void alGetSource(int source, int pname, FloatBuffer floatdata) { + assert floatdata.remaining() > 0; + nalGetSourcefv(source, pname, floatdata, floatdata.position()); + } + private static native void nalGetSourcefv(int source, int pname, FloatBuffer floatdata, int position); /** * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus @@ -516,10 +469,12 @@ * Pause() operation. Play() applied to a AL_STOPPED Source will propagate it to * AL_INITIAL then to AL_PLAYING immediately. * - * @param n number of sources to play * @param sources array of sources to play */ - public static native void alSourcePlayv(int n, IntBuffer sources); + public static void alSourcePlay(int n, IntBuffer sources) { + nalSourcePlayv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourcePlayv(int n, IntBuffer sources, int offset); /** * Pause() applied to an AL_INITIAL Source is a legal NOP. Pause() applied to a @@ -527,10 +482,12 @@ * processing, its current state is preserved. Pause() applied to a AL_PAUSED Source is a * legal NOP. Pause() applied to a AL_STOPPED Source is a legal NOP. * - * @param n number of sources to pause * @param sources array of sources to pause */ - public static native void alSourcePausev(int n, IntBuffer sources); + public static void alSourcePause(IntBuffer sources) { + nalSourcePausev(sources.remaining(), sources, sources.position()); + } + private static native void nalSourcePausev(int n, IntBuffer sources, int offset); /** * Stop() applied to an AL_INITIAL Source is a legal NOP. Stop() applied to a AL_PLAYING @@ -539,10 +496,12 @@ * state to AL_STOPPED, with the same consequences as on a AL_PLAYING Source. Stop() * applied to a AL_STOPPED Source is a legal NOP. * - * @param n number of sources to stop * @param sources array of sources to stop */ - public static native void alSourceStopv(int n, IntBuffer sources); + public static void alSourceStop(IntBuffer sources) { + nalSourceStopv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourceStopv(int n, IntBuffer sources, int offset); /** * Rewind() applied to an AL_INITIAL Source is a legal NOP. Rewind() applied to a @@ -556,7 +515,10 @@ * @param n number of sources to rewind * @param sources array of sources to rewind */ - public static native void alSourceRewindv(int n, IntBuffer sources); + public static void alSourceRewind(IntBuffer sources) { + nalSourceRewindv(sources.remaining(), sources, sources.position()); + } + private static native void nalSourceRewindv(int n, IntBuffer sources, int offset); /** * Play() applied to an AL_INITIAL Source will promote the Source to AL_PLAYING, thus @@ -609,10 +571,12 @@ /** * The application requests a number of Buffers using GenBuffers. * - * @param n number of buffers to generate * @param buffers holding buffers */ - public static native void alGenBuffers(int n, IntBuffer buffers); + public static void alGenBuffers(IntBuffer buffers) { + nalGenBuffers(buffers.remaining(), buffers, buffers.position()); + } + private static native void nalGenBuffers(int n, IntBuffer buffers, int offset); /** * <p> @@ -628,10 +592,12 @@ * a legal NOP in both scalar and vector forms of the command. The same is true for * unused buffer names, e.g. such as not allocated yet, or as released already. * - * @param n Number of buffers to delete * @param buffers Buffer to delete from */ - public static native void alDeleteBuffers(int n, IntBuffer buffers); + public static void alDeleteBuffers(int n, IntBuffer buffers) { + nalDeleteBuffers(buffers.remaining(), buffers, buffers.position()); + } + private static native void nalDeleteBuffers(int n, IntBuffer buffers, int offset); /** * The application can verify whether a buffer Name is valid using the IsBuffer query. @@ -666,13 +632,22 @@ * @param buffer Buffer to fill * @param format format sound data is in * @param data location of data - * @param size size of data segment * @param freq frequency of data */ - public static native void alBufferData( + public static void alBufferData( int buffer, int format, - ByteBuffer data, + ByteBuffer data, + int size, + int freq) { + // TODO: add an assertion here? + nalBufferData(buffer, format, data, data.position(), data.remaining(), freq); + } + private static native void nalBufferData( + int buffer, + int format, + ByteBuffer data, + int offset, int size, int freq); @@ -683,9 +658,9 @@ * * @param buffer buffer to get property from * @param pname name of property to retrieve - * @param integerdata Buffer to write integer to + * @param int */ - public static native void alGetBufferi(int buffer, int pname, IntBuffer integerdata); + public static native int alGetBufferi(int buffer, int pname); /** * Buffer state is maintained inside the AL implementation and can be queried in full.<br> @@ -694,9 +669,9 @@ * * @param buffer buffer to get property from * @param pname name of property to retrieve - * @param floatdata Buffer to write float to + * @return float */ - public static native void alGetBufferf(int buffer, int pname, FloatBuffer floatdata); + public static native float alGetBufferf(int buffer, int pname); /** * <p> @@ -711,10 +686,12 @@ * </p> * * @param source source to queue buffers onto - * @param n number of buffers to be queued * @param buffers buffers to be queued */ - public static native void alSourceQueueBuffers(int source, int n, IntBuffer buffers); + public static void alSourceQueueBuffers(int source, IntBuffer buffers) { + nalSourceQueueBuffers(source, buffers.remaining(), buffers, buffers.position()); + } + private static native void nalSourceQueueBuffers(int source, int n, IntBuffer buffers, int offset); /** * <p> @@ -733,10 +710,12 @@ * </p> * * @param source source to unqueue buffers from - * @param n number of buffers to be unqueued * @param buffers buffers to be unqueued */ - public static native void alSourceUnqueueBuffers(int source, int n, IntBuffer buffers); + public static void alSourceUnqueueBuffers(int source, IntBuffer buffers) { + nalSourceUnqueueBuffers(source, buffers.remaining(), buffers, buffers.position()); + } + private static native void nalSourceUnqueueBuffers(int source, int n, IntBuffer buffers, int offset); /** * <p> Index: BaseAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- BaseAL.java 3 Aug 2003 17:32:48 -0000 1.18 +++ BaseAL.java 11 Aug 2003 19:57:52 -0000 1.19 @@ -95,7 +95,7 @@ String jwsLibname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) ? "openal" - : "OpenAL32"; + : "lwjglaudio"; String jwsPath = getPathFromJWS(jwsLibname); if (jwsPath != null) { |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-11 19:58:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv13486/src/native/common Modified Files: org_lwjgl_openal_CoreAL.h org_lwjgl_openal_ALC.h org_lwjgl_openal_CoreAL.cpp org_lwjgl_openal_ALC.cpp Log Message: New buffer code Index: org_lwjgl_openal_CoreAL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- org_lwjgl_openal_CoreAL.h 2 Jul 2003 22:42:41 -0000 1.10 +++ org_lwjgl_openal_CoreAL.h 11 Aug 2003 19:58:12 -0000 1.11 @@ -1,35 +1,3 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_CoreAL */ @@ -42,6 +10,8 @@ /* Inaccessible static: created */ /* Inaccessible static: class_000240 */ /* Inaccessible static: class_000241 */ +/* Inaccessible static: _00024assertionsDisabled */ +/* Inaccessible static: class_000240 */ /* * Class: org_lwjgl_openal_CoreAL * Method: alEnable @@ -100,43 +70,27 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: alGetDouble - * Signature: (I)D - */ -JNIEXPORT jdouble JNICALL Java_org_lwjgl_openal_CoreAL_alGetDouble - (JNIEnv *, jclass, jint); - -/* - * Class: org_lwjgl_openal_CoreAL - * Method: alGetBooleanv - * Signature: (ILjava/nio/Buffer;)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBooleanv - (JNIEnv *, jclass, jint, jobject); - -/* - * Class: org_lwjgl_openal_CoreAL - * Method: alGetIntegerv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGetBooleanv + * Signature: (ILjava/nio/ByteBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetIntegerv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetBooleanv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alGetFloatv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGetIntegerv + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetFloatv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetIntegerv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alGetDoublev - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGetFloatv + * Signature: (ILjava/nio/FloatBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetDoublev - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetFloatv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -188,7 +142,7 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: listener3f + * Method: alListener3f * Signature: (IFFF)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alListener3f @@ -196,51 +150,43 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: alListenerfv - * Signature: (ILjava/nio/Buffer;)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alListenerfv - (JNIEnv *, jclass, jint, jobject); - -/* - * Class: org_lwjgl_openal_CoreAL * Method: alGetListeneri - * Signature: (ILjava/nio/Buffer;)V + * Signature: (I)I */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListeneri - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetListeneri + (JNIEnv *, jclass, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: alGetListenerf - * Signature: (ILjava/nio/Buffer;)V + * Signature: (I)F */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerf - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerf + (JNIEnv *, jclass, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alGetListenerfv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGetListenerfv + * Signature: (ILjava/nio/FloatBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerfv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetListenerfv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alGenSources - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGenSources + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGenSources - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenSources + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alDeleteSources - * Signature: (ILjava/nio/Buffer;)V + * Method: nalDeleteSources + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alDeleteSources - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteSources + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -265,78 +211,70 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcef (JNIEnv *, jclass, jint, jint, jfloat); - + /* * Class: org_lwjgl_openal_CoreAL - * Method: source3f + * Method: alSource3f * Signature: (IIFFF)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSource3f - (JNIEnv *, jclass, jint, jint, jfloat, jfloat, jfloat); - -/* - * Class: org_lwjgl_openal_CoreAL - * Method: alSourcefv - * Signature: (IILjava/nio/Buffer;)V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcefv - (JNIEnv *, jclass, jint, jint, jobject); + (JNIEnv *, jclass, jint, jint, jfloat, jfloat, jfloat); /* * Class: org_lwjgl_openal_CoreAL * Method: alGetSourcei - * Signature: (IILjava/nio/Buffer;)V + * Signature: (II)I */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcei - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcei + (JNIEnv *, jclass, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: alGetSourcef - * Signature: (IILjava/nio/Buffer;)V + * Signature: (II)F */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcef - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcef + (JNIEnv *, jclass, jint, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alGetSourcefv - * Signature: (IILjava/nio/Buffer;)V + * Method: nalGetSourcefv + * Signature: (IILjava/nio/FloatBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcefv - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetSourcefv + (JNIEnv *, jclass, jint, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourcePlayv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalSourcePlayv + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcePlayv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourcePlayv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourcePausev - * Signature: (ILjava/nio/Buffer;)V + * Method: nalSourcePausev + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcePausev - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourcePausev + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourceStopv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalSourceStopv + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceStopv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceStopv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourceRewindv - * Signature: (ILjava/nio/Buffer;)V + * Method: nalSourceRewindv + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceRewindv - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceRewindv + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -372,19 +310,19 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: alGenBuffers - * Signature: (ILjava/nio/Buffer;)V + * Method: nalGenBuffers + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGenBuffers - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenBuffers + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alDeleteBuffers - * Signature: (ILjava/nio/Buffer;)V + * Method: nalDeleteBuffers + * Signature: (ILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alDeleteBuffers - (JNIEnv *, jclass, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteBuffers + (JNIEnv *, jclass, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -396,43 +334,43 @@ /* * Class: org_lwjgl_openal_CoreAL - * Method: alBufferData - * Signature: (IILjava/nio/Buffer;II)V + * Method: nalBufferData + * Signature: (IILjava/nio/ByteBuffer;III)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alBufferData - (JNIEnv *, jclass, jint, jint, jobject, jint, jint); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalBufferData + (JNIEnv *, jclass, jint, jint, jobject, jint, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: alGetBufferi - * Signature: (IILjava/nio/Buffer;)V + * Signature: (II)I */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferi - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferi + (JNIEnv *, jclass, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: alGetBufferf - * Signature: (IILjava/nio/Buffer;)V + * Signature: (II)F */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferf - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferf + (JNIEnv *, jclass, jint, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourceQueueBuffers - * Signature: (IILjava/nio/Buffer;)V + * Method: nalSourceQueueBuffers + * Signature: (IILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceQueueBuffers - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceQueueBuffers + (JNIEnv *, jclass, jint, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL - * Method: alSourceUnqueueBuffers - * Signature: (IILjava/nio/Buffer;)V + * Method: nalSourceUnqueueBuffers + * Signature: (IILjava/nio/IntBuffer;I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceUnqueueBuffers - (JNIEnv *, jclass, jint, jint, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceUnqueueBuffers + (JNIEnv *, jclass, jint, jint, jobject, jint); /* * Class: org_lwjgl_openal_CoreAL Index: org_lwjgl_openal_ALC.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALC.h 2 Jul 2003 22:42:41 -0000 1.5 +++ org_lwjgl_openal_ALC.h 11 Aug 2003 19:58:12 -0000 1.6 @@ -1,35 +1,3 @@ -/* - * Copyright (c) 2002 Lightweight Java Game Library Project - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * * Neither the name of 'Lightweight Java Game Library' nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_ALC */ @@ -105,10 +73,10 @@ /* * Class: org_lwjgl_openal_ALC * Method: nGetIntegerv - * Signature: (IIILjava/nio/Buffer;)V + * Signature: (IIILjava/nio/Buffer;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv - (JNIEnv *, jclass, jint, jint, jint, jobject); + (JNIEnv *, jclass, jint, jint, jint, jobject, jint); /* * Class: org_lwjgl_openal_ALC @@ -129,7 +97,7 @@ /* * Class: org_lwjgl_openal_ALC * Method: alcCreateContext - * Signature: (ILjava/nio/Buffer;)Lorg/lwjgl/openal/ALCcontext; + * Signature: (ILjava/nio/IntBuffer;)Lorg/lwjgl/openal/ALCcontext; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_alcCreateContext (JNIEnv *, jclass, jint, jobject); Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_CoreAL.cpp 2 Jul 2003 22:42:41 -0000 1.5 +++ org_lwjgl_openal_CoreAL.cpp 11 Aug 2003 19:58:12 -0000 1.6 @@ -132,60 +132,14 @@ return result; } -/** - * This function returns a double precision floating point OpenAL state. - * - * C Specification: - * Aldouble alGetDouble(ALenum pname); - */ -JNIEXPORT jdouble JNICALL Java_org_lwjgl_openal_CoreAL_alGetDouble (JNIEnv *env, jclass clazz, jint pname) { - jdouble result = (jdouble) alGetDouble((ALenum) pname); - - CHECK_AL_ERROR - return result; -} - -/** - * This function retrieves a boolean OpenAL state. - * - * C Specification: - * ALvoid alGetBooleanv(ALenum pname,ALboolean *data); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBooleanv (JNIEnv *env, jclass clazz, jint pname, jobject data) { - alGetBooleanv((ALenum) pname, (ALboolean*) env->GetDirectBufferAddress(data)); - CHECK_AL_ERROR -} - -/** - * This function retrieves an integer OpenAL state. - * - * C Specification: - * ALvoid alGetIntegerv(ALenum pname,ALint *data); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetIntegerv (JNIEnv *env, jclass clazz, jint pname, jobject data) { - alGetIntegerv((ALenum) pname, (ALint*) env->GetDirectBufferAddress(data)); - CHECK_AL_ERROR -} - /** * This function retrieves a floating point OpenAL state. * * C Specification: * ALvoid alGetFloatv(ALenum pname,ALfloat *data); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetFloatv (JNIEnv *env, jclass clazz, jint pname, jobject data) { - alGetFloatv((ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(data)); - CHECK_AL_ERROR -} - -/** - * This function retrieves a double precision floating point OpenAL state. - * - * C Specification: - * ALvoid alGetDoublev(ALenum pname,ALdouble *data); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetDoublev (JNIEnv *env, jclass clazz, jint pname, jobject data) { - alGetDoublev((ALenum) pname, (ALdouble*) env->GetDirectBufferAddress(data)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetFloatv (JNIEnv *env, jclass clazz, jint pname, jobject data, int offset) { + alGetFloatv((ALenum) pname, offset + (ALfloat*) env->GetDirectBufferAddress(data)); CHECK_AL_ERROR } @@ -210,7 +164,8 @@ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetError (JNIEnv *env, jclass clazz) { jint result = (jint) alGetError(); - CHECK_AL_ERROR + // Don't think we should be checking for errors here..? +// CHECK_AL_ERROR return result; } @@ -277,16 +232,6 @@ CHECK_AL_ERROR } -/** - * This function sets a floating point-vector property of the listener. - * - * C Specification: - * ALvoid alListenerfv(ALenum pname,ALfloat *values); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alListenerfv (JNIEnv *env, jclass clazz, jint pname, jobject values) { - alListenerfv((ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(values)); - CHECK_AL_ERROR -} /** * This function retrieves an integer property of the listener. @@ -294,9 +239,11 @@ * C Specification: * ALvoid alGetListeneri(ALenum pname,ALint *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListeneri (JNIEnv *env, jclass clazz, jint pname, jobject value) { - alGetListeneri((ALenum) pname, (ALint*) env->GetDirectBufferAddress(value)); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetListeneri (JNIEnv *env, jclass clazz, jint pname) { + ALint value = 0; + alGetListeneri((ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -305,9 +252,11 @@ * C Specification: * ALvoid alGetListenerf(ALenum pname,ALfloat *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerf (JNIEnv *env, jclass clazz, jint pname, jobject value) { - alGetListenerf((ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(value)); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerf (JNIEnv *env, jclass clazz, jint pname) { + ALfloat value = 0.0f; + alGetListenerf((ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -316,8 +265,8 @@ * C Specification: * ALvoid alGetListenerfv(ALenum pname,ALfloat *values); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetListenerfv (JNIEnv *env, jclass clazz, jint pname, jobject values) { - alGetListenerfv((ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(values)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetListenerfv (JNIEnv *env, jclass clazz, jint pname, jobject values, jint offset) { + alGetListenerfv((ALenum) pname, offset + (ALfloat*) env->GetDirectBufferAddress(values)); CHECK_AL_ERROR } @@ -327,8 +276,8 @@ * C Specification: * ALvoid alGenSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGenSources (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alGenSources(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenSources (JNIEnv *env, jclass clazz, jint n, jobject sources, int offset) { + alGenSources(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -338,8 +287,8 @@ * C Specification: * ALvoid alDeleteSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alDeleteSources (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alDeleteSources(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteSources (JNIEnv *env, jclass clazz, jint n, jobject sources, int offset) { + alDeleteSources(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -388,25 +337,17 @@ CHECK_AL_ERROR } -/** - * This function sets a floating point-vector property of a source. - * - * C Specification: - * ALvoid alSourcefv(ALuint source,ALenum pname,ALfloat *values); - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcefv (JNIEnv *env, jclass clazz, jint source, jint pname, jobject values) { - alSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(values)); - CHECK_AL_ERROR -} /** * This function retrieves an integer property of a source. * C Specification: * ALvoid alGetSourcei(ALuint source,ALenum pname,ALint *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcei (JNIEnv *env, jclass clazz, jint source, jint pname, jobject value) { - alGetSourcei((ALuint) source, (ALenum) pname, (ALint*) env->GetDirectBufferAddress(value)); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcei (JNIEnv *env, jclass clazz, jint source, jint pname) { + ALint value = 0; + alGetSourcei((ALuint) source, (ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -415,9 +356,11 @@ * C Specification: * ALvoid alGetSourcef(ALuint source,ALenum pname,ALfloat *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcef (JNIEnv *env, jclass clazz, jint source, jint pname, jobject value) { - alGetSourcef((ALuint) source, (ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(value)); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcef (JNIEnv *env, jclass clazz, jint source, jint pname) { + ALfloat value = 0.0f; + alGetSourcef((ALuint) source, (ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -426,8 +369,8 @@ * C Specification: * ALvoid alGetSourcefv(ALuint source,ALenum pname,ALfloat *values); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetSourcefv (JNIEnv *env, jclass clazz, jint source, jint pname, jobject values) { - alGetSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(values)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGetSourcefv (JNIEnv *env, jclass clazz, jint source, jint pname, jobject values, jint offset) { + alGetSourcefv((ALuint) source, (ALenum) pname, offset + (ALfloat*) env->GetDirectBufferAddress(values)); CHECK_AL_ERROR } @@ -437,8 +380,8 @@ * C Specification: * ALvoid alSourcePlayv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcePlayv (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alSourcePlayv(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourcePlayv (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { + alSourcePlayv(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -448,8 +391,8 @@ * C Specification: * ALvoid alSourcePausev(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourcePausev (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alSourcePausev(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourcePausev (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { + alSourcePausev(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -459,8 +402,8 @@ * C Specification: * ALvoid alSourceStopv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceStopv (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alSourceStopv(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceStopv (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { + alSourceStopv(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -470,8 +413,8 @@ * C Specification: * ALvoid alSourceRewindv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceRewindv (JNIEnv *env, jclass clazz, jint n, jobject sources) { - alSourceRewindv(n, (ALuint*) env->GetDirectBufferAddress(sources)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceRewindv (JNIEnv *env, jclass clazz, jint n, jobject sources, jint offset) { + alSourceRewindv(n, offset + (ALuint*) env->GetDirectBufferAddress(sources)); CHECK_AL_ERROR } @@ -525,8 +468,8 @@ * C Specification: * ALvoid alGenBuffers(ALsizei n,ALuint *buffers); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGenBuffers (JNIEnv *env, jclass clazz, jint n, jobject buffers) { - alGenBuffers(n, (ALuint*) env->GetDirectBufferAddress(buffers)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalGenBuffers (JNIEnv *env, jclass clazz, jint n, jobject buffers, jint offset) { + alGenBuffers(n, offset + (ALuint*) env->GetDirectBufferAddress(buffers)); CHECK_AL_ERROR } @@ -536,8 +479,8 @@ * C Specification: * ALvoid alDeleteBuffers(ALsizei n,ALuint *buffers); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alDeleteBuffers (JNIEnv *env, jclass clazz, jint n, jobject buffers) { - alDeleteBuffers(n, (ALuint*) env->GetDirectBufferAddress(buffers)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalDeleteBuffers (JNIEnv *env, jclass clazz, jint n, jobject buffers, jint offset) { + alDeleteBuffers(n, offset + (ALuint*) env->GetDirectBufferAddress(buffers)); CHECK_AL_ERROR } @@ -560,8 +503,8 @@ * C Specification: * ALvoid alBufferData(ALuint buffer,ALenum format,ALvoid *data,ALsizei size,ALsizei freq); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alBufferData (JNIEnv *env, jclass clazz, jint buffer, jint format, jobject data, jint size, jint freq) { - alBufferData(buffer, format, (void**) env->GetDirectBufferAddress(data), size, freq); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alBufferData (JNIEnv *env, jclass clazz, jint buffer, jint format, jobject data, int offset, jint size, jint freq) { + alBufferData(buffer, format, (void*) (offset + (ALubyte *)env->GetDirectBufferAddress(data)), size, freq); CHECK_AL_ERROR } @@ -571,9 +514,11 @@ * C Specification: * ALvoid alGetBufferi(ALuint buffer,ALenum pname,ALint *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferi (JNIEnv *env, jclass clazz, jint buffer, jint pname, jobject value) { - alGetBufferi((ALuint) buffer, (ALenum) pname, (ALint*) env->GetDirectBufferAddress(value)); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferi (JNIEnv *env, jclass clazz, jint buffer, jint pname) { + ALint value = 0; + alGetBufferi((ALuint) buffer, (ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -582,9 +527,11 @@ * C Specification: * ALvoid alGetBufferf(ALuint buffer,ALenum pname,ALfloat *value); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferf (JNIEnv *env, jclass clazz, jint buffer, jint pname, jobject value) { - alGetBufferf((ALuint) buffer, (ALenum) pname, (ALfloat*) env->GetDirectBufferAddress(value)); +JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_alGetBufferf (JNIEnv *env, jclass clazz, jint buffer, jint pname) { + ALfloat value = 0.0f; + alGetBufferf((ALuint) buffer, (ALenum) pname, &value); CHECK_AL_ERROR + return value; } /** @@ -593,8 +540,8 @@ * C Specification: * ALvoid alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceQueueBuffers (JNIEnv *env, jclass clazz, jint source, jint n, jobject buffers) { - alSourceQueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) env->GetDirectBufferAddress(buffers)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceQueueBuffers (JNIEnv *env, jclass clazz, jint source, jint n, jobject buffers, jint offset) { + alSourceQueueBuffers((ALuint) source, (ALsizei) n, offset + (ALuint*) env->GetDirectBufferAddress(buffers)); CHECK_AL_ERROR } @@ -604,8 +551,8 @@ * C Specification: * ALvoid alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_alSourceUnqueueBuffers (JNIEnv *env, jclass clazz, jint source, jint n, jobject buffers) { - alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) env->GetDirectBufferAddress(buffers)); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_nalSourceUnqueueBuffers (JNIEnv *env, jclass clazz, jint source, jint n, jobject buffers, jint offset) { + alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, offset + (ALuint*) env->GetDirectBufferAddress(buffers)); CHECK_AL_ERROR } Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- org_lwjgl_openal_ALC.cpp 5 Jul 2003 21:56:11 -0000 1.9 +++ org_lwjgl_openal_ALC.cpp 11 Aug 2003 19:58:12 -0000 1.10 @@ -92,10 +92,10 @@ * C Specification: * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest) { +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv (JNIEnv *env, jclass clazz, jint deviceaddress, jint token, jint size, jobject dest, int offset) { ALint* address = NULL; if (dest != NULL) { - address = (ALint*) env->GetDirectBufferAddress(dest); + address = offset + (ALint*) env->GetDirectBufferAddress(dest); } alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, address); CHECK_ALC_ERROR |
|
From: Elias N. <eli...@us...> - 2003-08-11 17:42:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv10665/linux Modified Files: org_lwjgl_Sys.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_Sys.cpp 11 Aug 2003 16:53:16 -0000 1.15 +++ org_lwjgl_Sys.cpp 11 Aug 2003 17:33:41 -0000 1.16 @@ -44,9 +44,9 @@ #include <sys/resource.h> #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 +static long int hires_timer_freq; // Hires timer frequency +static long int hires_timer_start; // Hires timer start +static long int hires_timer; // Hires timer current time /* * Class: org_lwjgl_Sys @@ -59,7 +59,7 @@ return hires_timer_freq; } -long queryTime(void) { +static long queryTime(void) { struct timeval tv; if (gettimeofday(&tv, NULL) == -1) { #ifdef _DEBUG |
|
From: Elias N. <eli...@us...> - 2003-08-11 16:55:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv2822/linux Modified Files: org_lwjgl_Sys.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_Sys.cpp 4 Aug 2003 23:00:49 -0000 1.14 +++ org_lwjgl_Sys.cpp 11 Aug 2003 16:53:16 -0000 1.15 @@ -49,7 +49,6 @@ long int hires_timer; // Hires timer current time /* -/* * Class: org_lwjgl_Sys * Method: getTimerResolution * Signature: ()J |
|
From: Elias N. <eli...@us...> - 2003-08-11 16:45:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv32506/src/native/linux Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Flipped cursor coordinates to match OpenGL Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- org_lwjgl_input_Mouse.cpp 5 Aug 2003 14:21:59 -0000 1.30 +++ org_lwjgl_input_Mouse.cpp 11 Aug 2003 16:35:45 -0000 1.31 @@ -79,6 +79,21 @@ static Cursor blank_cursor; static Cursor current_cursor; +static int cap(int val, int min, int max) { + if (val < min) + return min; + else if (val > max) + return max; + else + return val; +} + +static void setCursorPos(int x, int y) { + y = getWindowHeight() - 1 - y; + current_x = cap(x, 0, getWindowWidth() - 1); + current_y = cap(y, 0, getWindowHeight() - 1); +} + /* * Class: org_lwjgl_input_Mouse * Method: initIDs @@ -200,7 +215,7 @@ if (cursor_handle != 0) { Cursor cursor = (Cursor)cursor_handle; if (!native_cursor) { - current_x = current_y = 0; + setCursorPos(0, 0); XWarpPointer(getCurrentDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); native_cursor = true; } @@ -256,7 +271,8 @@ int i; env->SetStaticIntField(clazz, fid_button_count, NUM_BUTTONS); env->SetStaticBooleanField(clazz, fid_has_wheel, JNI_TRUE); - current_x = current_y = current_z = last_x = last_y = last_z; + setCursorPos(0, 0); + current_z = last_x = last_y = last_z = 0; for (i = 0; i < NUM_BUTTONS; i++) buttons[i] = JNI_FALSE; if (!blankCursor()) { @@ -334,10 +350,8 @@ } void handlePointerMotion(XMotionEvent *event) { - if (pointer_grabbed || native_cursor) { - current_x = event->x; - current_y = event->y; - } + if (pointer_grabbed || native_cursor) + setCursorPos(event->x, event->y); } static void warpPointer(void) { @@ -347,8 +361,9 @@ // Reset pointer to middle of screen if inside a certain inner border if (current_x < POINTER_WARP_BORDER || current_y < POINTER_WARP_BORDER || current_x > getWindowWidth() - POINTER_WARP_BORDER || current_y > getWindowHeight() - POINTER_WARP_BORDER) { - current_x = last_x = getWindowWidth()/2; - current_y = last_y = getWindowHeight()/2; + setCursorPos(getWindowWidth()>>1, getWindowHeight()>>1); + last_x = current_x; + last_y = current_y; XWarpPointer(getCurrentDisplay(), None, getCurrentWindow(), 0, 0, 0, 0, current_x, current_y); XEvent event; // Try to catch the warp pointer event |
|
From: Elias N. <eli...@us...> - 2003-08-11 16:45:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv32506/src/native/win32 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: Flipped cursor coordinates to match OpenGL Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- org_lwjgl_input_Mouse.cpp 24 Jul 2003 09:09:24 -0000 1.25 +++ org_lwjgl_input_Mouse.cpp 11 Aug 2003 16:35:45 -0000 1.26 @@ -185,9 +185,9 @@ RECT clientRect; GetWindowRect(hwnd, &windowRect); getScreenClientRect(&clientRect, &windowRect); - SetCursorPos(clientRect.left, clientRect.top); - cursorPos.x = clientRect.left; - cursorPos.y = clientRect.top; + cursorPos.x = clientRect.left; + cursorPos.y = clientRect.bottom - 1; + SetCursorPos(cursorPos.x, cursorPos.y); ShowCursor(TRUE); usingNativeCursor = true; } @@ -350,6 +350,15 @@ return; } mCreate_success = true; +} + +static int cap(int val, int min, int max) { + if (val < min) + return min; + else if (val > max) + return max; + else + return val; } static void getGDICursorDelta(int* return_dx, int* return_dy) { @@ -364,15 +373,14 @@ cursorPos.x += newWindowRect.left - windowRect.left; cursorPos.y += newWindowRect.top - windowRect.top; windowRect = newWindowRect; - getScreenClientRect(&clientRect, &windowRect); - // Clip the position to the client rect - if (newCursorPos.x < clientRect.right && newCursorPos.x >= clientRect.left && - newCursorPos.y < clientRect.bottom && newCursorPos.y >= clientRect.top) { - dx = newCursorPos.x - cursorPos.x; - dy = newCursorPos.y - cursorPos.y; - cursorPos.x += dx; - cursorPos.y += dy; - } + getScreenClientRect(&clientRect, &windowRect); + // Clip the position to the client rect + newCursorPos.x = cap(newCursorPos.x, clientRect.left, clientRect.right - 1); + newCursorPos.y = cap(newCursorPos.y, clientRect.top, clientRect.bottom - 1); + dx = newCursorPos.x - cursorPos.x; + dy = newCursorPos.y - cursorPos.y; + cursorPos.x += dx; + cursorPos.y += dy; *return_dx = dx; *return_dy = dy; } @@ -414,7 +422,8 @@ } else { dx = diMouseState.lX; dy = diMouseState.lY; - } + } + dy = -dy; mEnvironment->SetStaticIntField(clsMouse, fidMDX, (jint)dx); mEnvironment->SetStaticIntField(clsMouse, fidMDY, (jint)dy); |
|
From: Elias N. <eli...@us...> - 2003-08-10 19:18:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv24955/src/java/org/lwjgl/input Modified Files: Cursor.java Log Message: Flip cursor images in a copy buffer, not the user buffer Index: Cursor.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Cursor.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Cursor.java 5 Aug 2003 20:46:03 -0000 1.8 +++ Cursor.java 10 Aug 2003 19:18:02 -0000 1.9 @@ -35,6 +35,8 @@ import org.lwjgl.Sys; import java.nio.IntBuffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; /** * $Id$ @@ -78,27 +80,28 @@ assert delays == null || numImages <= delays.remaining(): "delays != null && numImages > delays.remaining()"; assert xHotspot <= width && xHotspot >= 0: "xHotspot > width || xHotspot < 0"; assert yHotspot <= height && yHotspot >= 0: "yHotspot > height || yHotspot < 0"; - flipImages(width, height, numImages, images); - nativeHandle = nCreateCursor(width, height, xHotspot, height - yHotspot, numImages, images, images.position(), delays, delays != null ? delays.position() : 0); + IntBuffer images_copy = ByteBuffer.allocateDirect(images.remaining()*4).order(ByteOrder.nativeOrder()).asIntBuffer(); + flipImages(width, height, numImages, images, images_copy); + nativeHandle = nCreateCursor(width, height, xHotspot, height - yHotspot, numImages, images_copy, 0, delays, delays != null ? delays.position() : 0); } - private static void flipImages(int width, int height, int numImages, IntBuffer images) { + private static void flipImages(int width, int height, int numImages, IntBuffer images, IntBuffer images_copy) { for (int i = 0; i < numImages; i++) { - int start_index = i*width*height + images.position(); - flipImage(width, height, start_index, images); + int start_index = i*width*height; + flipImage(width, height, start_index, images, images_copy); } } - private static void flipImage(int width, int height, int start_index, IntBuffer images) { + private static void flipImage(int width, int height, int start_index, IntBuffer images, IntBuffer images_copy) { for (int y = 0; y < height>>1; y++) { int index_y_1 = y*width + start_index; int index_y_2 = (height - y - 1)*width + start_index; for (int x = 0; x < width; x++) { int index1 = index_y_1 + x; int index2 = index_y_2 + x; - int temp_pixel = images.get(index1); - images.put(index1, images.get(index2)); - images.put(index2, temp_pixel); + int temp_pixel = images.get(index1 + images.position()); + images_copy.put(index1, images.get(index2 + images.position())); + images_copy.put(index2, temp_pixel); } } } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-07 21:53:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1:/tmp/cvs-serv15136/src/java/org/lwjgl Modified Files: Sys.java Log Message: 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.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- Sys.java 6 Aug 2003 19:25:43 -0000 1.27 +++ Sys.java 7 Aug 2003 21:53:06 -0000 1.28 @@ -191,4 +191,9 @@ */ public static native void alert(String title, String message); + /* + * Cas: this is just a debugging aid. The native code is also commented out. + * + public static native int getDirectBufferAddress(Buffer buf); + */ } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-07 21:51:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv14683/src/native/win32 Modified Files: org_lwjgl_Sys.cpp org_lwjgl_Display.cpp Log Message: Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Sys.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_Sys.cpp 4 Aug 2003 23:00:49 -0000 1.14 +++ org_lwjgl_Sys.cpp 7 Aug 2003 21:51:51 -0000 1.15 @@ -141,3 +141,15 @@ env->ReleaseStringUTFChars(message, eMessageText); env->ReleaseStringUTFChars(title, cTitleBarText); } + +// Cas: I've left this here as sometimes it's handy to just pop it back in to debug stuff +/* + * 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(buf); +} + */ Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- org_lwjgl_Display.cpp 24 Jun 2003 12:24:55 -0000 1.41 +++ org_lwjgl_Display.cpp 7 Aug 2003 21:51:51 -0000 1.42 @@ -273,11 +273,15 @@ // Return device gamma to normal HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, originalGamma)) { -#ifdef _DEBUG - printf("Could not reset device gamma\n"); -#endif - } + try { + if (!SetDeviceGammaRamp(screenDC, originalGamma)) { + #ifdef _DEBUG + printf("Could not reset device gamma\n"); + #endif + } + } catch (...) { + printf("Exception occurred in SetDeviceGammaRamp\n"); + } ReleaseDC(NULL, screenDC); if (modeSet) { @@ -296,11 +300,15 @@ void tempResetDisplayMode() { // Return device gamma to normal HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, originalGamma)) { -#ifdef _DEBUG - printf("Could not reset device gamma\n"); -#endif - } + try { + if (!SetDeviceGammaRamp(screenDC, originalGamma)) { + #ifdef _DEBUG + printf("Could not reset device gamma\n"); + #endif + } + } catch (...) { + printf("Exception occurred in SetDeviceGammaRamp\n"); + } ReleaseDC(NULL, screenDC); if (modeSet) { @@ -319,11 +327,15 @@ void tempRestoreDisplayMode() { // Restore gamma HDC screenDC = GetDC(NULL); - if (!SetDeviceGammaRamp(screenDC, currentGamma)) { -#ifdef _DEBUG - printf("Could not restore device gamma\n"); -#endif - } + try { + if (!SetDeviceGammaRamp(screenDC, currentGamma)) { + #ifdef _DEBUG + printf("Could not restore device gamma\n"); + #endif + } + } catch (...) { + printf("Exception occurred in SetDeviceGammaRamp\n"); + } ReleaseDC(NULL, screenDC); if (!modeSet) { @@ -374,13 +386,18 @@ } jboolean ret; HDC screenDC = GetDC(NULL); - if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { -#ifdef _DEBUG - printf("Failed to set device gamma\n"); -#endif + try { + if (SetDeviceGammaRamp(screenDC, currentGamma) == FALSE) { + #ifdef _DEBUG + printf("Failed to set device gamma\n"); + #endif + ret = JNI_FALSE; + } else { + ret = JNI_TRUE; + } + } catch (...) { + printf("Exception occurred in SetDeviceGammaRamp\n"); ret = JNI_FALSE; - } else { - ret = JNI_TRUE; } ReleaseDC(NULL, screenDC); @@ -419,10 +436,14 @@ env->DeleteLocalRef(newMode); // Get the default gamma ramp - if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) { -#ifdef _DEBUG - printf("Failed to get initial device gamma\n"); -#endif + try { + if (GetDeviceGammaRamp(screenDC, originalGamma) == FALSE) { + #ifdef _DEBUG + printf("Failed to get initial device gamma\n"); + #endif + } + } catch (...) { + printf("Exception occurred in GetDeviceGammaRamp\n"); } ReleaseDC(NULL, screenDC); } |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-08-07 21:51:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv14599/src/native/common Modified Files: org_lwjgl_Sys.h Log Message: Index: org_lwjgl_Sys.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_Sys.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- org_lwjgl_Sys.h 4 Aug 2003 23:00:49 -0000 1.11 +++ org_lwjgl_Sys.h 7 Aug 2003 21:51:24 -0000 1.12 @@ -19,7 +19,7 @@ /* Inaccessible static: LIBRARY_NAME */ /* Inaccessible static: DEBUG */ /* Inaccessible static: _debug */ -/* Inaccessible static: class_00024org_00024lwjgl_00024Sys */ +/* Inaccessible static: class_000240 */ /* * Class: org_lwjgl_Sys * Method: getTimerResolution @@ -59,6 +59,14 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_Sys_alert (JNIEnv *, jclass, jstring, jstring); + +/* + * Class: org_lwjgl_Sys + * Method: getDirectBufferAddress + * Signature: (Ljava/nio/Buffer;)I +JNIEXPORT jint JNICALL Java_org_lwjgl_Sys_getDirectBufferAddress + (JNIEnv *, jclass, jobject); + */ #ifdef __cplusplus } |
|
From: Elias N. <eli...@us...> - 2003-08-07 12:08:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv28643/src/java/org/lwjgl/opengl Modified Files: StateStack.java VBOTracker.java Log Message: Made VBOTracker and StateStack package private Index: StateStack.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/StateStack.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/StateStack.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- StateStack.java 4 Aug 2003 23:00:47 -0000 1.1 +++ StateStack.java 7 Aug 2003 12:08:39 -0000 1.2 @@ -32,7 +32,7 @@ package org.lwjgl.opengl; -public class StateStack { +class StateStack { /** Only int state is tracked */ private final int[] state_stack; private int stack_pos; Index: VBOTracker.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/VBOTracker.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/VBOTracker.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- VBOTracker.java 4 Aug 2003 23:00:47 -0000 1.1 +++ VBOTracker.java 7 Aug 2003 12:08:40 -0000 1.2 @@ -32,7 +32,7 @@ package org.lwjgl.opengl; -public class VBOTracker { +class VBOTracker { private static VBOTracker default_tracker = new VBOTracker(); private static VBOTracker current_tracker = default_tracker; |
|
From: Brian M. <ma...@us...> - 2003-08-06 20:28:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv6176 Modified Files: Window.java Log Message: add: IsFullScreen fix: better error message on assertion failure Index: Window.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Window.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Window.java 4 Aug 2003 23:00:47 -0000 1.2 +++ Window.java 6 Aug 2003 19:46:34 -0000 1.3 @@ -99,6 +99,7 @@ * @return the width of the window */ public static int getWidth() { + assert isCreated() : "Cannot get width on uncreated window"; return width; } @@ -106,6 +107,7 @@ * @return the height of the window */ public static int getHeight() { + assert isCreated() : "Cannot get height on uncreated window"; return height; } @@ -113,15 +115,24 @@ * @return the title of the window */ public static String getTitle() { + assert isCreated() : "Cannot get title on uncreated window"; return title; } + + /** + * @return whether this window is in fullscreen mode + */ + public static boolean IsFullscreen() { + assert isCreated() : "Cannot determine state of uncreated window"; + return fullscreen; + } /** * Set the title of the window. This may be ignored by the underlying OS. * @param newTitle The new window title */ public static void setTitle(String newTitle) { - assert isCreated(); + assert isCreated() : "Cannot set title of uncreated window"; title = newTitle; nSetTitle(title); } @@ -136,7 +147,7 @@ * @return true if the user or operating system has asked the window to close */ public static boolean isCloseRequested() { - assert isCreated(); + assert isCreated() : "Cannot determine state of uncreated window"; return nIsCloseRequested(); } @@ -146,7 +157,7 @@ * @return true if the window is minimized or otherwise not visible */ public static boolean isMinimized() { - assert isCreated(); + assert isCreated() : "Cannot determine state of uncreated window"; return nIsMinimized(); } @@ -156,7 +167,7 @@ * @return true if window is focused */ public static boolean isFocused() { - assert isCreated(); + assert isCreated() : "Cannot determine state of uncreated window"; return nIsFocused(); } @@ -190,7 +201,7 @@ * and needs to repaint itself */ public static boolean isDirty() { - assert isCreated(); + assert isCreated() : "Cannot determine state of uncreated window"; return nIsDirty(); } @@ -200,7 +211,7 @@ * Paint the window. This clears the dirty flag and swaps the buffers. */ public static void paint() { - assert isCreated(); + assert isCreated() : "Cannot paint uncreated window"; swapBuffers(); } |