You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian M. <ma...@us...> - 2002-09-03 19:58:53
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory usw-pr-cvs1:/tmp/cvs-serv31730 Added Files: README Log Message: initial import of README --- NEW FILE: README --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/README This is the official readme file for lwjgl, and is pretty much empty right now :/ Unless otherwise stated, all files distributed or in CVS are covered by the license as stated in the LICENSE file. If you have not received this file, please download it from the cvs server. Project Webpage: http://sourceforge.net/projects/java-game-lib |
From: Brian M. <ma...@us...> - 2002-09-03 19:46:47
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory usw-pr-cvs1:/tmp/cvs-serv26864 Added Files: openal_c-to-java.txt Log Message: initial import of basic OpenAL conversion from c/c++ to Java --- NEW FILE: openal_c-to-java.txt --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/openal_c-to-java.txt Author: Brian Matzon <br...@ma...> When converting C/C++ OpenAL code to Java the following conversion rules, typically apply: When using an array of some data type in C/C++ you will typically convert that to the corresponding ByteBuffer type. ie: ALfloat floatv[3]; becomes FloatBuffer floatv = createFloatBuffer(3); In this example, createFloatBuffer is this utility method: public FloatBuffer createFloatBuffer(int size) { //allocate bytebuffer, using 4 bytes per float ByteBuffer temp = ByteBuffer.allocateDirect(4*size); temp.order(ByteOrder.nativeOrder()); return temp.asFloatBuffer(); } Using the above FloatBuffer, you would typically use it like this: (examples taken from altest.c/ALTest.java): example 1: alGetListenerfv(AL_POSITION, floatv); becomes al.getListenerfv(AL.POSITION, Sys.getDirectBufferAddress(floatv)); example 2: if (floatv[0] != 100.0)) { becomes: if (floatv.get(0) != 100.0f) { example 3: alGetListener3f(AL_POSITION, &floatv[0], &floatv[1], &floatv[2]); becomes al.getListener3f(AL.POSITION, Sys.getDirectBufferAddress(floatv), Sys.getDirectBufferAddress(floatv) + 4, Sys.getDirectBufferAddress(floatv) + 8); the last case is a bit special, since we start of by getting the base address of the buffer, and then add the datatype size to the base address to get the address of that specific index. This is just how it has to be in Java. |
From: Brian M. <ma...@us...> - 2002-09-03 19:25:03
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv16741 Modified Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp Added Files: org_lwjgl_openal_BaseAL.cpp Log Message: mod: adopted create/destroy architecture --- NEW FILE: org_lwjgl_openal_BaseAL.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_BaseAL.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_BaseAL.h" /* * Class: org_lwjgl_openal_BaseAL * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseAL_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_BaseAL * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseAL_nDestroy(JNIEnv *env, jobject obj) { } Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_ALC.cpp 27 Aug 2002 17:45:40 -0000 1.7 +++ org_lwjgl_openal_ALC.cpp 3 Sep 2002 19:24:57 -0000 1.8 @@ -44,6 +44,23 @@ /* OpenAL includes */ #include <alc.h> +/* + * Class: org_lwjgl_openal_ALC + * Method: nCreate + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nCreate (JNIEnv *env, jobject obj) { + return true; +} + +/* + * Class: org_lwjgl_openal_ALC + * Method: nDestroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nDestroy (JNIEnv *env, jobject obj) { +} + /** * This function returns strings related to the context. * Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_ALUT.cpp 28 Aug 2002 23:41:05 -0000 1.7 +++ org_lwjgl_openal_ALUT.cpp 3 Sep 2002 19:24:57 -0000 1.8 @@ -47,6 +47,23 @@ #include <stdlib.h> +/* + * Class: org_lwjgl_openal_ALUT + * Method: nCreate + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALUT_nCreate (JNIEnv *env, jobject obj) { + return true; +} + +/* + * Class: org_lwjgl_openal_ALUT + * Method: nDestroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_nDestroy (JNIEnv *env, jobject obj) { +} + /** * This function initializes OpenAL. * |
From: Brian M. <ma...@us...> - 2002-09-03 19:24:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv16310 Modified Files: org_lwjgl_openal_ALC.h org_lwjgl_openal_ALUT.h Added Files: org_lwjgl_openal_BaseAL.h Log Message: mod: adopted create/destroy architecture --- NEW FILE: org_lwjgl_openal_BaseAL.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseAL.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_BaseAL */ #ifndef _Included_org_lwjgl_openal_BaseAL #define _Included_org_lwjgl_openal_BaseAL #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: created */ /* * Class: org_lwjgl_openal_BaseAL * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseAL_nCreate (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_BaseAL * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseAL_nDestroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_ALC.h 20 Aug 2002 14:45:29 -0000 1.1 +++ org_lwjgl_openal_ALC.h 3 Sep 2002 19:24:10 -0000 1.2 @@ -9,6 +9,22 @@ #endif /* * Class: org_lwjgl_openal_ALC + * Method: nCreate + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nCreate + (JNIEnv *, jobject); + +/* + * Class: org_lwjgl_openal_ALC + * Method: nDestroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nDestroy + (JNIEnv *, jobject); + +/* + * Class: org_lwjgl_openal_ALC * Method: getString * Signature: (Lorg/lwjgl/openal/ALCdevice;I)Ljava/lang/String; */ Index: org_lwjgl_openal_ALUT.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALUT.h 28 Aug 2002 22:45:46 -0000 1.5 +++ org_lwjgl_openal_ALUT.h 3 Sep 2002 19:24:10 -0000 1.6 @@ -41,6 +41,21 @@ #endif /* * Class: org_lwjgl_openal_ALUT + * Method: nCreate + * Signature: ()Z + */ +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALUT_nCreate + (JNIEnv *, jobject); + +/* + * Class: org_lwjgl_openal_ALUT + * Method: nDestroy + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_nDestroy + (JNIEnv *, jobject); +/* + * Class: org_lwjgl_openal_ALUT * Method: init * Signature: ([Ljava/lang/String;)V */ |
From: Brian M. <ma...@us...> - 2002-09-03 18:54:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv5649/org/lwjgl/openal/test Modified Files: BasicTest.java Log Message: mod: updated to create/destroy architecture Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/BasicTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- BasicTest.java 29 Aug 2002 12:44:32 -0000 1.2 +++ BasicTest.java 3 Sep 2002 18:54:40 -0000 1.3 @@ -71,8 +71,28 @@ */ public BasicTest() { al = new AL(); + try { + al.create(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + alc = new ALC(); + try { + alc.create(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + alut = new ALUT(); + try { + alut.create(); + } catch (Exception e) { + e.printStackTrace(); + return; + } } /** |
From: Brian M. <ma...@us...> - 2002-09-03 18:54:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv5649/org/lwjgl/openal Modified Files: ALC.java ALUT.java BaseAL.java Log Message: mod: updated to create/destroy architecture 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.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ALC.java 26 Aug 2002 15:30:19 -0000 1.3 +++ ALC.java 3 Sep 2002 18:54:40 -0000 1.4 @@ -41,6 +41,8 @@ * @version $Revision$ */ public class ALC { + /** Has the ALC object been created? */ + protected static boolean created; /** Bad value */ public static final int INVALID = -1; @@ -92,18 +94,66 @@ */ public static final int OUT_OF_MEMORY = 0xA005; - static { - try { - System.loadLibrary(org.lwjgl.Sys.getLibraryName()); - } catch (UnsatisfiedLinkError ule) { - System.out.println("Failed to load OpenAL library: " + org.lwjgl.Sys.getLibraryName()); - ule.printStackTrace(); - } - } + static { + initialize(); + } /** Creates a new instance of ALC */ public ALC() { } + + /** + * Override to provide any initialization code after creation. + */ + protected void init() { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the ALC instance + * + * @throws Exception if a failiure occured in the ALC creation process + */ + public void create() throws Exception { + if (created) { + return; + } + + if (!nCreate()) { + throw new Exception("ALC instance could not be created."); + } + created = true; + init(); + } + + /** + * Native method to create ALC instance + * + * @return true if the ALC creation process succeeded + */ + protected native boolean nCreate(); + + /** + * Calls whatever destruction rutines that are needed + */ + public void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the ALC + */ + protected native void nDestroy(); /** * Returns strings related to the context. Index: ALUT.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALUT.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ALUT.java 29 Aug 2002 01:11:03 -0000 1.6 +++ ALUT.java 3 Sep 2002 18:54:40 -0000 1.7 @@ -42,18 +42,69 @@ */ public class ALUT { - static { - try { - System.loadLibrary(org.lwjgl.Sys.getLibraryName()); - } catch (UnsatisfiedLinkError ule) { - System.out.println("Failed to load OpenAL library: " + org.lwjgl.Sys.getLibraryName()); - ule.printStackTrace(); - } - } + /** Has the ALUT object been created? */ + protected static boolean created; + + static { + initialize(); + } /** Creates a new instance of ALUT */ public ALUT() { } + + /** + * Override to provide any initialization code after creation. + */ + protected void init() { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the ALUT instance + * + * @throws Exception if a failiure occured in the ALUT creation process + */ + public void create() throws Exception { + if (created) { + return; + } + + if (!nCreate()) { + throw new Exception("ALUT instance could not be created."); + } + created = true; + init(); + } + + /** + * Native method to create ALUT instance + * + * @return true if the ALUT creation process succeeded + */ + protected native boolean nCreate(); + + /** + * Calls whatever destruction rutines that are needed + */ + public void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the ALUT + */ + protected native void nDestroy(); /** * Initializes the OpenAL engine 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.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- BaseAL.java 19 Aug 2002 14:02:55 -0000 1.3 +++ BaseAL.java 3 Sep 2002 18:54:40 -0000 1.4 @@ -44,12 +44,63 @@ * @version $Revision$ */ public abstract class BaseAL { - static { - try { - System.loadLibrary(org.lwjgl.Sys.getLibraryName()); - } catch (UnsatisfiedLinkError ule) { - System.out.println("Failed to load OpenAL library: " + org.lwjgl.Sys.getLibraryName()); - ule.printStackTrace(); + /** Has the ALC object been created? */ + protected static boolean created; + + static { + initialize(); + } + + /** + * Override to provide any initialization code after creation. + */ + protected void init() { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the AL instance + * + * @throws Exception if a failiure occured in the AL creation process + */ + public void create() throws Exception { + if (created) { + return; } - } + + if (!nCreate()) { + throw new Exception("AL instance could not be created."); + } + created = true; + init(); + } + + /** + * Native method to create AL instance + * + * @return true if the AL creation process succeeded + */ + protected native boolean nCreate(); + + /** + * Calls whatever destruction rutines that are needed + */ + public void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the AL + */ + protected native void nDestroy(); } |
From: Brian M. <ma...@us...> - 2002-09-03 18:08:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv23173/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: fix: better keyboard handling Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- ALTest.java 3 Sep 2002 16:07:43 -0000 1.10 +++ ALTest.java 3 Sep 2002 18:08:52 -0000 1.11 @@ -552,7 +552,7 @@ try { ch = System.in.read(); - System.in.read(); + eatInput(); } catch (IOException ioe) { } @@ -999,31 +999,34 @@ if ((ch == 'S') || (ch == 's')) { return 0; } - if (ch == 0) { + if (ch == 10) { return 1; } } } protected int CRToContinue() { - int ch = 0; - int lastchar = 0; - - do { - lastchar = ch; - try { - ch = System.in.read(); - System.in.read(); - } catch (IOException ioe) { + int current = -1; + try { + //read one, and eat the rest + current = System.in.read(); + eatInput(); + } catch (Exception e) { + } + return (current == 13) ? 10 : current; + } + + protected void eatInput() { + try { + while(System.in.available() > 0) { + int eaten = System.in.read(); } - } while (ch != 10); - - return lastchar; + } catch (Exception e) { + } } protected void CRForNextTest() { System.out.print("\nPress Return to continue on to the next test.\n"); - CRToContinue(); } |
From: Brian M. <ma...@us...> - 2002-09-03 16:07:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv8303/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: add: rest of semiautomatic tests added Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ALTest.java 3 Sep 2002 11:17:42 -0000 1.9 +++ ALTest.java 3 Sep 2002 16:07:43 -0000 1.10 @@ -970,20 +970,20 @@ protected void semiAutoTests() { sA_StringQueries(); // String Queries Test sA_SourceGain(); // Source Gain Test - //SA_ListenerGain(); // Listener Gain Test - //SA_Position(); // Position Test - //SA_SourceRelative(); // Source Relative Test - //SA_ListenerOrientation(); // Listener Orientation Test - //SA_SourceCone(); // Source Cone Test - //SA_MinMaxGain(); // MIN/MAX Gain Test - //SA_ReferenceDistance(); // Reference Distance Test - //SA_RolloffFactor(); // Rolloff Factor Test - //SA_DistanceModel(); // Distance Model Test + sA_ListenerGain(); // Listener Gain Test + sA_Position(); // Position Test + sA_SourceRelative(); // Source Relative Test + sA_ListenerOrientation(); // Listener Orientation Test + sA_SourceCone(); // Source Cone Test + sA_MinMaxGain(); // MIN/MAX Gain Test + sA_ReferenceDistance(); // Reference Distance Test + sA_RolloffFactor(); // Rolloff Factor Test + sA_DistanceModel(); // Distance Model Test sA_Doppler(); // Doppler Test - //SA_Frequency(); // Frequency Test - //SA_Stereo(); // Stereo Test - //SA_Streaming(); // Streaming Test - //SA_QueuingUnderrunPerformance(); // test underrun performance + sA_Frequency(); // Frequency Test + sA_Stereo(); // Stereo Test + sA_Streaming(); // Streaming Test + sA_QueuingUnderrunPerformance(); // test underrun performance System.out.print("\nDone with this series of tests. Going back to the main menu..."); delay_ms(1000); @@ -1097,8 +1097,526 @@ al.sourcei(testSources.get(0), AL.BUFFER, 0); al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); } - } + } + + protected void sA_ListenerGain() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Listener Gain Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The following sound effect will be played at full listener gain (Press Return):\n"); + CRToContinue(); + al.listenerf(AL.GAIN,1.0f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at half listener gain (Press Return):\n"); + CRToContinue(); + al.listenerf(AL.GAIN,0.5f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at quarter listener gain (Press Return):\n"); + CRToContinue(); + al.listenerf(AL.GAIN,0.25f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at 1/20th listener gain (Press Return):\n"); + CRToContinue(); + al.listenerf(AL.GAIN,0.05f); + al.sourcePlay(testSources.get(0)); + CRForNextTest(); + al.listenerf(AL.GAIN,1.0f); + FloatBuffer f = createFloatBuffer(1); + al.getListenerf(AL.GAIN, Sys.getDirectBufferAddress(f)); + if (f.get(0) != 1.0) { System.out.print("ERROR: alGetListenerf failed.\n"); } + al.sourceStop(testSources.get(0)); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_Position() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + int i; + FloatBuffer tempFVect = createFloatBuffer(6); + + System.out.print("Position Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("Trying Left-to-Right sweep by moving listener(Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.listener3f(AL.POSITION, 100.0f, 0.0f, 0.0f); + al.getListener3f(AL.POSITION, Sys.getDirectBufferAddress(tempFVect), Sys.getDirectBufferAddress(tempFVect) + 4, Sys.getDirectBufferAddress(tempFVect) + 8); + if ((tempFVect.get(0) != 100.0f) || (tempFVect.get(1) != 0.0f) || (tempFVect.get(2) != 0.0f)) { + System.out.print("ERROR: alGetListener3f(AL_POSITION, ...).\n"); + } + al.getListenerfv(AL.POSITION, Sys.getDirectBufferAddress(tempFVect)); + if ((tempFVect.get(0) != 100.0f) || (tempFVect.get(1) != 0.0) || (tempFVect.get(2) != 0.0f)) { + System.out.print("ERROR: alGetListenerfv(AL_POSITION, ...).\n"); + } + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.listener3f(AL.POSITION, (float) -i, 0.0f, 0.0f); + delay_ms(100); + + al.getListenerfv(AL.POSITION, Sys.getDirectBufferAddress(tempFVect)); + System.out.print("Position: " + tempFVect.get(0) + ", " + tempFVect.get(1) + ", " + tempFVect.get(2) + "\n"); + } + al.listener3f(AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + System.out.print("Trying Left-to-Right sweep by moving source (Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.source3f(testSources.get(0), AL.POSITION, -100.0f, 0.0f, 0.0f); + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + System.out.print("Trying Back-to-Front sweep (Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -100.0f); + al.getSource3f(testSources.get(0), AL.POSITION, Sys.getDirectBufferAddress(tempFVect), Sys.getDirectBufferAddress(tempFVect) + 4, Sys.getDirectBufferAddress(tempFVect) + 8); + if ((tempFVect.get(0) != 0.0f) || (tempFVect.get(1) != 0.0f) || (tempFVect.get(2) != -100.0f)) { + System.out.print("ERROR: alGetSource3f(..., AL_POSITION, ...).\n"); + } + al.getSourcefv(testSources.get(0), AL.POSITION, Sys.getDirectBufferAddress(tempFVect)); + if ((tempFVect.get(0) != 0.0f) || (tempFVect.get(1) != 0.0f) || (tempFVect.get(2) != -100.0f)) { + System.out.print("ERROR: alGetSourcefv(..., AL_POSITION, ...).\n"); + } + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, (float) -i); + delay_ms(100); + } + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_SourceRelative() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + int i; + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Source Relative Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("Placing Listener at (100, 0, 0) and sweeping source from (0, 0, 0) to (100, 0, 0). The sound should pan from left to center (Press Return):\n"); + CRToContinue(); + al.listener3f(AL.POSITION, 100.0f, 0.0f, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.source3f(testSources.get(0), AL.POSITION, -10.0f, 0.0f, 0.0f); + al.sourcePlay(testSources.get(0)); + for (i = 00; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + + System.out.print("Turning on source relative mode, placing Listener at (100, 0, 0), and sweeping source from (0, 0, 0) to (100, 0, 0). The sound should pan from center to right (Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.SOURCE_RELATIVE, AL.TRUE); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.source3f(testSources.get(0), AL.POSITION, -100.0f, 0.0f, 0.0f); + al.sourcePlay(testSources.get(0)); + for (i = 0; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + + al.listener3f(AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourcei(testSources.get(0), AL.SOURCE_RELATIVE, AL.FALSE); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_ListenerOrientation() { + IntBuffer testSources = createIntBuffer(2); + + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Listener Orientation Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The listener will be placed at (1, 0, 0) and will face the -X direction. The sound should be centered. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.listenerf(AL.GAIN,1.0f); + FloatBuffer f = createFloatBuffer(1); + al.getSourcef(testSources.get(0), AL.GAIN, Sys.getDirectBufferAddress(f)); + if (f.get(0) != 1.0f) { System.out.print("ERROR: alGetSourcef(..., AL_GAIN, ...).\n"); } + al.listener3f(AL.POSITION, 1.0f, 0.0f, 0.0f); + listenerOri.put(0, listenerOri.get(0)-1.0f); + listenerOri.put(1, 0.0f); + listenerOri.put(2, 0.0f); + listenerOri.put(3, 0.0f); + listenerOri.put(4, 1.0f); + listenerOri.put(5, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + al.sourceStop(testSources.get(0)); + + System.out.print("The listener will now be oriented down the -Z axis. The sound should be to the left. (Press Return):\n"); + CRToContinue(); + listenerOri.put(0, 0.0f); + listenerOri.put(1, 0.0f); + listenerOri.put(2, listenerOri.get(2)-1.0f); + listenerOri.put(3, 0.0f); + listenerOri.put(4, 1.0f); + listenerOri.put(5, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + al.sourceStop(testSources.get(0)); + + System.out.print("The listener will now be turned upside-down (the 'up' direction will be (0, -1, 0)). The sound should be to the right. (Press Return):\n"); + CRToContinue(); + listenerOri.put(0, 0.0f); + listenerOri.put(1, 0.0f); + listenerOri.put(2, listenerOri.get(2)-1.0f); + listenerOri.put(3, 0.0f); + listenerOri.put(4, listenerOri.get(4)-1.0f); + listenerOri.put(5, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + al.sourceStop(testSources.get(0)); + + System.out.print("The listener will now be oriented down the +Z axis (and the 'up' direction is now (0, 1, 0) again). The sound should be to the right. (Press Return):\n"); + CRToContinue(); + listenerOri.put(0, 0.0f); + listenerOri.put(1, 0.0f); + listenerOri.put(2, 1.0f); + listenerOri.put(3, 0.0f); + listenerOri.put(4, 1.0f); + listenerOri.put(5, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + al.sourceStop(testSources.get(0)); + + CRForNextTest(); + al.listenerf(AL.GAIN,1.0f); + al.listener3f(AL.POSITION, 0.0f, 0.0f, 0.0f); + listenerOri.put(0, 0.0f); + listenerOri.put(1, 0.0f); + listenerOri.put(2, listenerOri.get(2)-1.0f); + listenerOri.put(3, 0.0f); + listenerOri.put(4, 1.0f); + listenerOri.put(5, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_SourceCone() { + + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {0.0f,0.0f,1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri2 = createFloatBuffer(6); + sourceOri2.put(new float[] {1.0f,0.0f,1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri3 = createFloatBuffer(6); + sourceOri3.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Source Cone Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The listener will be at (0,0,0). The source will be at (0,0,-1). The source will be directly facing the listener and should be loud. (Press Return):\n"); + CRToContinue(); + al.listener3f(AL.POSITION, 0.0f, 0.0f, 0.0f); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcef(testSources.get(0), AL.CONE_INNER_ANGLE, 10.0f); + al.sourcef(testSources.get(0), AL.CONE_OUTER_ANGLE, 270.0f); + al.sourcef(testSources.get(0), AL.CONE_OUTER_GAIN, (float)0.01); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -1.0f); + al.sourcefv(testSources.get(0), AL.DIRECTION, Sys.getDirectBufferAddress(sourceOri)); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will now point between the inner and outer cones, and should be at medium volume. (Press Return):\n"); + CRToContinue(); + al.sourcefv(testSources.get(0), AL.DIRECTION, Sys.getDirectBufferAddress(sourceOri2)); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will now point behind the outer cone and will be at low volume. (Press Return):\n"); + CRToContinue(); + al.sourcefv(testSources.get(0), AL.DIRECTION, Sys.getDirectBufferAddress(sourceOri3)); + al.sourcePlay(testSources.get(0)); + + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + protected void sA_MinMaxGain() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("MIN/MAX Gain Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The source will be played at GAIN 1.0 with MAX gain set to 1.0. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.GAIN, 1.0f); + al.sourcef(testSources.get(0), AL.MAX_GAIN, 1.0f); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played at GAIN 0.1 with MIN gain set to 0.6. This should be at medium volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.GAIN, (float) 0.1); + al.sourcef(testSources.get(0), AL.MIN_GAIN, (float) 0.6); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played at GAIN 1.0 with MAX gain set to 0.1. This should be low volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.GAIN, 1.0f); + al.sourcef(testSources.get(0), AL.MAX_GAIN, (float) 0.1); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played at GAIN 0.1 with MIN gain set to 0.0. This should be low volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.GAIN, (float) 0.1); + al.sourcef(testSources.get(0), AL.MIN_GAIN, 0.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played at GAIN 1.0 with MAX gain set to 0.0. This should be zero volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.GAIN, (float) 1.0); + al.sourcef(testSources.get(0), AL.MAX_GAIN, 0.0f); + al.sourcePlay(testSources.get(0)); + + CRForNextTest(); + al.sourcef(testSources.get(0), AL.GAIN, 1.0f); + al.sourcef(testSources.get(0), AL.MAX_GAIN, 1.0f); + al.sourcef(testSources.get(0), AL.MIN_GAIN, 0.0f); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_ReferenceDistance() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Reference Distance Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The source will be placed at (0, 0, -10), and the reference distance set at 1.0. This should be low volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -10.0f); + al.sourcef(testSources.get(0), AL.REFERENCE_DISTANCE, 1.0f); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played with the reference distance set to 3.0. This should be medium volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.REFERENCE_DISTANCE, 3.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played with the reference distance set to 10.0. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.REFERENCE_DISTANCE, 10.0f); + al.sourcePlay(testSources.get(0)); + + CRForNextTest(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourcef(testSources.get(0), AL.REFERENCE_DISTANCE, 1.0f); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_RolloffFactor() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Rolloff Factor Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The source will be played with the rolloff factor set to 0.0. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -10.0f); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + al.sourcef(testSources.get(0), AL.ROLLOFF_FACTOR, 0.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -10), and the rolloff factor set at 1.0. This should be medium volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.ROLLOFF_FACTOR, 1.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played with the rolloff factor set to 3.0. This should be low volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.ROLLOFF_FACTOR, 3.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be played with the rolloff factor set to 10.0. This should be very low volume. (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0), AL.ROLLOFF_FACTOR, 10.0f); + al.sourcePlay(testSources.get(0)); + + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_DistanceModel() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Distance Model Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The source will be placed at (0, 0, -10). This should be low volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -10.0f); + al.distanceModel(AL.INVERSE_DISTANCE); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -1). This should be high volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -1.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -10) and the distance model will be set to AL_NONE. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -10.0f); + al.distanceModel(AL.NONE); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -100) and the distance model will remain AL_NONE. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -100.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -100) and the distance model will be AL_INVERSE_DISTANCE_CLAMPED. AL_MAX_DISTANCE will be set to 100.0. This should be low volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -100.0f); + al.distanceModel(AL.INVERSE_DISTANCE_CLAMPED); + al.sourcef(testSources.get(0), AL.MAX_DISTANCE, 100.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -100) and the distance model will be AL_INVERSE_DISTANCE_CLAMPED. AL_MAX_DISTANCE will be set to 20.0. This should be louder. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -100.0f); + al.sourcef(testSources.get(0), AL.MAX_DISTANCE, 20.0f); + al.sourcePlay(testSources.get(0)); + + System.out.print("The source will be placed at (0, 0, -100) and the distance model will be AL_INVERSE_DISTANCE_CLAMPED. AL_MAX_DISTANCE will be set to 5.0. This should be high volume. (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, -100.0f); + al.sourcef(testSources.get(0), AL.MAX_DISTANCE, 5.0f); + al.sourcePlay(testSources.get(0)); + + CRForNextTest(); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.distanceModel(AL.INVERSE_DISTANCE); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + protected void sA_Doppler() { IntBuffer testSources = createIntBuffer(2); int i; @@ -1162,7 +1680,139 @@ } } + protected void sA_Frequency() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + int i; + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Frequency Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("A source will be played eight times -- going from one-half to double it's native frequency (Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + for (i = 0; i < 8; i++) { + al.sourcef(testSources.get(0), AL.PITCH, (float) (0.5 + (float) i * 0.2)); + al.sourcePlay(testSources.get(0)); + delay_ms(2000); + } + al.sourceStop(testSources.get(0)); + al.sourcef(testSources.get(0), AL.PITCH, 1.0f); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + protected void sA_Stereo() { + IntBuffer testSources = createIntBuffer(2); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + int error; + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Stereo Test:"); + if (ContinueOrSkip() == 1) { + // clear error state + al.getError(); + + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("A stereo buffer will play twice in succession (Press Return):\n"); + CRToContinue(); + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("Init error : ", error); + al.sourceQueueBuffers(testSources.get(0), 1, Sys.getDirectBufferAddress(buffers) + 4*6); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourceQueueBuffers 1 (stereo) : ", error); + al.sourceQueueBuffers(testSources.get(0), 1, Sys.getDirectBufferAddress(buffers) + 4*6); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourceQueueBuffers 1 (stereo) : ", error); + al.sourcePlay(testSources.get(0)); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_Streaming() { + System.out.print("Streaming Test:"); + if (ContinueOrSkip() == 1) { + System.out.print("A stereo audio file will now be streamed from a file (Press Return):\n"); + CRToContinue(); + //I_StreamingTest(); + CRForNextTest(); + } + } + + protected void sA_QueuingUnderrunPerformance() { + IntBuffer testSources = createIntBuffer(2); + IntBuffer bufferName = createIntBuffer(1); + int error; + IntBuffer tempInt = createIntBuffer(1); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Queuing Underrun Performance Test:"); + if (ContinueOrSkip() == 1) { + System.out.print("A stereo buffer will play once, there will be a brief pause, and then the buffer will play again (Press Return):\n"); + CRToContinue(); + al.getError(); + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.sourcei(testSources.get(0), AL.LOOPING, AL.FALSE); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("Init error : ", error); + al.sourceQueueBuffers(testSources.get(0), 1, Sys.getDirectBufferAddress(buffers) + 4*6); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourceQueueBuffers 1 (stereo) : ", error); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + al.getSourcei(testSources.get(0), AL.SOURCE_STATE, Sys.getDirectBufferAddress(tempInt)); + if (tempInt.get(0) != AL.STOPPED) + System.out.print("Wrong underrun state -- should be AL_STOPPED. "); + al.getSourcei(testSources.get(0), AL.BUFFERS_PROCESSED, Sys.getDirectBufferAddress(tempInt)); + if (tempInt.get(0) != 1) { + System.out.print("Wrong underrun state -- should have one buffer processed. "); + } else { + al.sourceUnqueueBuffers(testSources.get(0), tempInt.get(0), Sys.getDirectBufferAddress(bufferName)); + } + al.sourceQueueBuffers(testSources.get(0), 1, Sys.getDirectBufferAddress(buffers) + 4*6); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourceQueueBuffers 1 (stereo) : ", error); + al.sourcePlay(testSources.get(0)); + delay_ms(3000); + System.out.print("The stereo buffer will now play twice with no pause (Press Return):\n"); + CRToContinue(); + al.sourceQueueBuffers(testSources.get(0), 1, Sys.getDirectBufferAddress(buffers) + 4*6); + al.sourcePlay(testSources.get(0)); + delay_ms(4000); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + protected void i_PositionTest() { int error; |
From: Brian M. <ma...@us...> - 2002-09-03 11:17:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv548/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: mod: refactored some EAX constants to Buffer or Listerner Properties class Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- ALTest.java 2 Sep 2002 22:06:13 -0000 1.8 +++ ALTest.java 3 Sep 2002 11:17:42 -0000 1.9 @@ -39,6 +39,7 @@ import org.lwjgl.openal.ALUTLoadWAVData; import org.lwjgl.openal.eax.EAX; import org.lwjgl.openal.eax.EAXBufferProperties; +import org.lwjgl.openal.eax.EAXListenerProperties; import org.lwjgl.Sys; import java.nio.ByteBuffer; @@ -551,6 +552,7 @@ try { ch = System.in.read(); + System.in.read(); } catch (IOException ioe) { } @@ -966,10 +968,201 @@ } protected void semiAutoTests() { - System.out.println("semiAutoTests"); - delay_ms(3000); + sA_StringQueries(); // String Queries Test + sA_SourceGain(); // Source Gain Test + //SA_ListenerGain(); // Listener Gain Test + //SA_Position(); // Position Test + //SA_SourceRelative(); // Source Relative Test + //SA_ListenerOrientation(); // Listener Orientation Test + //SA_SourceCone(); // Source Cone Test + //SA_MinMaxGain(); // MIN/MAX Gain Test + //SA_ReferenceDistance(); // Reference Distance Test + //SA_RolloffFactor(); // Rolloff Factor Test + //SA_DistanceModel(); // Distance Model Test + sA_Doppler(); // Doppler Test + //SA_Frequency(); // Frequency Test + //SA_Stereo(); // Stereo Test + //SA_Streaming(); // Streaming Test + //SA_QueuingUnderrunPerformance(); // test underrun performance + + System.out.print("\nDone with this series of tests. Going back to the main menu..."); + delay_ms(1000); + } + + protected int ContinueOrSkip() { + int ch = -1; + + System.out.print("\nPress Return to run this test, or 'S' to skip:\n"); + + while (true) { + ch = CRToContinue(); + if ((ch == 'S') || (ch == 's')) { + return 0; + } + if (ch == 0) { + return 1; + } + } + } + + protected int CRToContinue() { + int ch = 0; + int lastchar = 0; + + do { + lastchar = ch; + try { + ch = System.in.read(); + System.in.read(); + } catch (IOException ioe) { + } + } while (ch != 10); + + return lastchar; } + protected void CRForNextTest() { + System.out.print("\nPress Return to continue on to the next test.\n"); + + CRToContinue(); + } + + protected void sA_StringQueries() { + System.out.print("String Queries Test:"); + if (ContinueOrSkip() == 1) { + System.out.print("Check that the following values are reasonable:\n"); + + String tempString; + + ALCcontext pContext; + ALCdevice pDevice; + pContext = alc.getCurrentContext(); + pDevice = alc.getContextsDevice(pContext); + tempString = alc.getString(pDevice, ALC.DEVICE_SPECIFIER); + System.out.print("OpenAL Context Device Specifier is '" + tempString + "'\n"); + tempString = al.getString(AL.RENDERER); + System.out.print("OpenAL Renderer is '" + tempString + "'\n"); + tempString = al.getString(AL.VERSION); + System.out.print("OpenAL Version is '" + tempString + "'\n"); + tempString = al.getString(AL.VENDOR); + System.out.print("OpenAL Vendor is '" + tempString + "'\n"); + tempString = al.getString(AL.EXTENSIONS); + System.out.print("OpenAL Extensions supported are :\n" + tempString + "\n"); + System.out.print("\nError Codes are :-\n"); + System.out.print("AL_NO_ERROR : '" + al.getString(AL.NO_ERROR) + "'\n"); + + System.out.print("AL_INVALID_ENUM : '" + al.getString(AL.INVALID_ENUM) + "'\n"); + System.out.print("AL_INVALID_VALUE : '" + al.getString(AL.INVALID_VALUE) + "'\n"); + + System.out.print("AL_INVALID_OPERATION : '" + al.getString(AL.INVALID_OPERATION) + "'\n"); + System.out.print("AL_OUT_OF_MEMORY : '" + al.getString(AL.OUT_OF_MEMORY) + "'\n"); + CRForNextTest(); + } + } + + protected void sA_SourceGain() { + IntBuffer testSources = createIntBuffer(1); + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[]{0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[]{1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Source Gain Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("The following sound effect will be played at full source gain (Press Return):\n"); + CRToContinue(); + al.sourcef(Sys.getDirectBufferAddress(testSources),AL.GAIN,1.0f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at half source gain (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0),AL.GAIN,0.5f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at quarter source gain (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0),AL.GAIN,0.25f); + al.sourcePlay(testSources.get(0)); + System.out.print("The following sound effect will be played at 1/20th source gain (Press Return):\n"); + CRToContinue(); + al.sourcef(testSources.get(0),AL.GAIN,0.05f); + al.sourcePlay(testSources.get(0)); + CRForNextTest(); + al.sourcef(testSources.get(0),AL.GAIN,1.0f); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void sA_Doppler() { + IntBuffer testSources = createIntBuffer(2); + int i; + FloatBuffer listenerOri = createFloatBuffer(6); + listenerOri.put(new float[] {0.0f,0.0f,-1.0f, 0.0f,1.0f,0.0f}); + + FloatBuffer sourceOri = createFloatBuffer(6); + sourceOri.put(new float[] {1.0f,0.0f,0.0f, 0.0f,1.0f,0.0f}); + + System.out.print("Doppler Test:"); + if (ContinueOrSkip() == 1) { + // load up sources + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.get(0), AL.BUFFER, buffers.get(1)); + + System.out.print("Trying Left-to-Right sweep with doppler shift (Press Return):\n"); + CRToContinue(); + al.listenerfv(AL.ORIENTATION, Sys.getDirectBufferAddress(listenerOri)); + al.sourcei(testSources.get(0), AL.LOOPING, AL.TRUE); + al.source3f(testSources.get(0), AL.POSITION, -100.0f, 0.0f, 0.0f); + al.source3f(testSources.get(0), AL.VELOCITY, 10.0f, 0.0f, 0.0f); + al.sourcefv(testSources.get(0), AL.ORIENTATION, Sys.getDirectBufferAddress(sourceOri)); + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + al.sourceStop(testSources.get(0)); + System.out.print("Trying Left-to-Right sweep with DopplerFactor set to 4.0 -- should be more extreme (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, -100.0f, 0.0f, 0.0f); + al.source3f(testSources.get(0), AL.VELOCITY, 10.0f, 0.0f, 0.0f); + al.dopplerFactor(4.0f); + if (al.getFloat(AL.DOPPLER_FACTOR) != 4.0f) { System.out.print(" alGetFloat(AL_DOPPLER_FACTOR) error.\n"); } + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + al.sourceStop(testSources.get(0)); + al.dopplerFactor(1.0f); + System.out.print("Trying Left-to-Right sweep with DopplerVelocity set to 86 -- should remain extreme (Press Return):\n"); + CRToContinue(); + al.source3f(testSources.get(0), AL.POSITION, -100.0f, 0.0f, 0.0f); + al.source3f(testSources.get(0), AL.VELOCITY, 10.0f, 0.0f, 0.0f); + al.dopplerVelocity(86); + if (al.getFloat(AL.DOPPLER_VELOCITY) != 86) { System.out.print(" alGetFloat(AL_DOPPLER_VELOCITY) error.\n"); } + al.sourcePlay(testSources.get(0)); + for (i = -100; i < 100; i++) { + al.source3f(testSources.get(0), AL.POSITION, (float) i, 0.0f, 0.0f); + delay_ms(100); + } + al.dopplerVelocity(343); + al.source3f(testSources.get(0), AL.POSITION, 0.0f, 0.0f, 0.0f); + al.sourceStop(testSources.get(0)); + CRForNextTest(); + + // dispose of sources + al.sourcei(testSources.get(0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + } + } + + protected void i_PositionTest() { int error; @@ -1388,7 +1581,7 @@ break; case '5': Env.put(0, EAX.ENVIRONMENT_HANGAR); - eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ENVIRONMENT | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, + eax.eaxSet(EAX.LISTENER_GUID, EAXListenerProperties.ENVIRONMENT | EAXListenerProperties.DEFERRED, 0, Sys.getDirectBufferAddress(Env), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXLISTENER_ENVIRONMENT | EAXLISTENER_DEFERRED : \n", error); @@ -1396,19 +1589,19 @@ case '6': Room.put(-10000); - eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ROOM | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, 0, + eax.eaxSet(EAX.LISTENER_GUID, EAXListenerProperties.ROOM | EAXListenerProperties.DEFERRED, 0, Sys.getDirectBufferAddress(Room), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXLISTENER_ROOM | EAXLISTENER_DEFERRED : \n", error); break; case '7': - eax.eaxGet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_ALLPARAMETERS, source.get(0), + eax.eaxGet(EAX.BUFFER_GUID, EAXBufferProperties.ALLPARAMETERS, source.get(0), eaxBufferProp0.getAddress(), eaxBufferProp0.getSize()); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxGet EAXBUFFER_ALLPARAMETERS : \n", error); eaxBufferProp0.setOcclusion(-5000); - eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_ALLPARAMETERS | EAX.DSPROPERTY_EAXBUFFER_DEFERRED, source.get(0), + eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.ALLPARAMETERS | EAXBufferProperties.DEFERRED, source.get(0), eaxBufferProp0.getAddress(), eaxBufferProp0.getSize()); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXBUFFER_ALLPARAMETERS | EAXBUFFER_DEFERRED : \n", error); @@ -1416,7 +1609,7 @@ case '8': Occlusion.put(0, 0); - eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OCCLUSION | EAX.DSPROPERTY_EAXBUFFER_DEFERRED, source.get(0), + eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.OCCLUSION | EAXBufferProperties.DEFERRED, source.get(0), Sys.getDirectBufferAddress(Occlusion), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXBUFFER_OCCLUSION | EAXBUFFER_DEFERRED : \n", error); @@ -1424,7 +1617,7 @@ case '9': Obstruction.put(0, -5000); - eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OBSTRUCTION, source.get(1), + eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.OBSTRUCTION, source.get(1), Sys.getDirectBufferAddress(Obstruction), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXBUFFER_OBSTRUCTION : \n", error); @@ -1432,7 +1625,7 @@ case '0': Obstruction.put(0, 0); - eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OBSTRUCTION, source.get(1), + eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.OBSTRUCTION, source.get(1), Sys.getDirectBufferAddress(Obstruction), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXBUFFER_OBSTRUCTION : \n", error); @@ -1440,13 +1633,13 @@ case 'C': // Commit settings on source 0 - eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS, + eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.COMMITDEFERREDSETTINGS, source.get(0), 0, 0); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXBUFFER_COMMITDEFERREDSETTINGS : \n", error); // Commit Listener settings - eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS, + eax.eaxSet(EAX.LISTENER_GUID, EAXListenerProperties.COMMITDEFERREDSETTINGS, 0, 0, 0); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXLISTENER_COMMITDEFERREDSETTINGSENVIRONMENT : \n", error); @@ -1456,7 +1649,7 @@ // reset EAX level Room.put(0, -10000); - eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ROOM, 0, Sys.getDirectBufferAddress(Room), 4); + eax.eaxSet(EAX.LISTENER_GUID, EAXListenerProperties.ROOM, 0, Sys.getDirectBufferAddress(Room), 4); if ((error = al.getError()) != AL.NO_ERROR) displayALError("eaxSet EAXLISTENER_ROOM : \n", error); |
From: Brian M. <ma...@us...> - 2002-09-03 11:17:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory usw-pr-cvs1:/tmp/cvs-serv548/org/lwjgl/openal/eax Modified Files: BaseEAXConstants.java EAXBufferProperties.java EAXListenerProperties.java Log Message: mod: refactored some EAX constants to Buffer or Listerner Properties class Index: BaseEAXConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- BaseEAXConstants.java 2 Sep 2002 22:06:12 -0000 1.2 +++ BaseEAXConstants.java 3 Sep 2002 11:17:42 -0000 1.3 @@ -40,33 +40,6 @@ * @version $Revision$ */ public interface BaseEAXConstants { - public static final int DSPROPERTY_EAXLISTENER_NONE = 0; - public static final int DSPROPERTY_EAXLISTENER_ALLPARAMETERS = 1; - public static final int DSPROPERTY_EAXLISTENER_ROOM = 2; - public static final int DSPROPERTY_EAXLISTENER_ROOMHF = 3; - public static final int DSPROPERTY_EAXLISTENER_ROOMROLLOFFFACTOR = 4; - public static final int DSPROPERTY_EAXLISTENER_DECAYTIME = 5; - public static final int DSPROPERTY_EAXLISTENER_DECAYHFRATIO = 6; - public static final int DSPROPERTY_EAXLISTENER_REFLECTIONS = 7; - public static final int DSPROPERTY_EAXLISTENER_REFLECTIONSDELAY = 8; - public static final int DSPROPERTY_EAXLISTENER_REVERB = 9; - public static final int DSPROPERTY_EAXLISTENER_REVERBDELAY = 10; - public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENT = 11; - public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENTSIZE = 12; - public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENTDIFFUSION = 13; - public static final int DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF = 14; - public static final int DSPROPERTY_EAXLISTENER_FLAGS = 15; - - /** changes take effect immediately */ - public static final int DSPROPERTY_EAXLISTENER_IMMEDIATE = 0x00000000; - - /** changes take effect later */ - public static final int DSPROPERTY_EAXLISTENER_DEFERRED = 0x80000000; - - public static final int DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS = - (DSPROPERTY_EAXLISTENER_NONE | - DSPROPERTY_EAXLISTENER_IMMEDIATE); - public static final int ENVIRONMENT_GENERIC = 0; public static final int ENVIRONMENT_PADDEDCELL = 1; public static final int ENVIRONMENT_ROOM = 2; @@ -94,181 +67,6 @@ public static final int ENVIRONMENT_DIZZY = 24; public static final int ENVIRONMENT_PSYCHOTIC = 25; public static final int ENVIRONMENT_COUNT = 26; - - /** reverberation decay time */ - public static final int EAXLISTENERFLAGS_DECAYTIMESCALE = 0x00000001; - - /** reflection level */ - public static final int EAXLISTENERFLAGS_REFLECTIONSSCALE = 0x00000002; - - /** initial reflection delay time */ - public static final int EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE = 0x00000004; - - /** reflections level */ - public static final int EAXLISTENERFLAGS_REVERBSCALE = 0x00000008; - - /** late reverberation delay time */ - public static final int EAXLISTENERFLAGS_REVERBDELAYSCALE = 0x00000010; - - /** This flag limits high-frequency decay time according to air absorption. */ - public static final int EAXLISTENERFLAGS_DECAYHFLIMIT = 0x00000020; - - /** reserved future use */ - public static final int EAXLISTENERFLAGS_RESERVED = 0xFFFFFFC0; - - // property ranges and defaults: - public static final int EAXLISTENER_MINROOM = -10000; - public static final int EAXLISTENER_MAXROOM = 0; - public static final int EAXLISTENER_DEFAULTROOM = -1000; - - public static final int EAXLISTENER_MINROOMHF = -10000; - public static final int EAXLISTENER_MAXROOMHF = 0; - public static final int EAXLISTENER_DEFAULTROOMHF = -100; - - public static final float EAXLISTENER_MINROOMROLLOFFFACTOR = 0.0f; - public static final float EAXLISTENER_MAXROOMROLLOFFFACTOR = 10.0f; - public static final float EAXLISTENER_DEFAULTROOMROLLOFFFACTOR = 0.0f; - - public static final float EAXLISTENER_MINDECAYTIME = 0.1f; - public static final float EAXLISTENER_MAXDECAYTIME = 20.0f; - public static final float EAXLISTENER_DEFAULTDECAYTIME = 1.49f; - - public static final float EAXLISTENER_MINDECAYHFRATIO = 0.1f; - public static final float EAXLISTENER_MAXDECAYHFRATIO = 2.0f; - public static final float EAXLISTENER_DEFAULTDECAYHFRATIO = 0.83f; - - public static final int EAXLISTENER_MINREFLECTIONS = -10000; - public static final int EAXLISTENER_MAXREFLECTIONS = 1000; - public static final int EAXLISTENER_DEFAULTREFLECTIONS = -2602; - - public static final float EAXLISTENER_MINREFLECTIONSDELAY = 0.0f; - public static final float EAXLISTENER_MAXREFLECTIONSDELAY = 0.3f; - public static final float EAXLISTENER_DEFAULTREFLECTIONSDELAY = 0.007f; - - public static final int EAXLISTENER_MINREVERB = -10000; - public static final int EAXLISTENER_MAXREVERB = 2000; - public static final int EAXLISTENER_DEFAULTREVERB = 200; - - public static final float EAXLISTENER_MINREVERBDELAY = 0.0f; - public static final float EAXLISTENER_MAXREVERBDELAY = 0.1f; - public static final float EAXLISTENER_DEFAULTREVERBDELAY = 0.011f; - - public static final int EAXLISTENER_MINENVIRONMENT = 0; - public static final int EAXLISTENER_MAXENVIRONMENT = (ENVIRONMENT_COUNT-1); - public static final int EAXLISTENER_DEFAULTENVIRONMENT = ENVIRONMENT_GENERIC; - - public static final float EAXLISTENER_MINENVIRONMENTSIZE = 1.0f; - public static final float EAXLISTENER_MAXENVIRONMENTSIZE = 100.0f; - public static final float EAXLISTENER_DEFAULTENVIRONMENTSIZE = 7.5f; - - public static final float EAXLISTENER_MINENVIRONMENTDIFFUSION = 0.0f; - public static final float EAXLISTENER_MAXENVIRONMENTDIFFUSION = 1.0f; - public static final float EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION = 1.0f; - - public static final float EAXLISTENER_MINAIRABSORPTIONHF = -100.0f; - public static final float EAXLISTENER_MAXAIRABSORPTIONHF = 0.0f; - public static final float EAXLISTENER_DEFAULTAIRABSORPTIONHF = -5.0f; - - public static final int EAXLISTENER_DEFAULTFLAGS = - (EAXLISTENERFLAGS_DECAYTIMESCALE | - EAXLISTENERFLAGS_REFLECTIONSSCALE | - EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE | - EAXLISTENERFLAGS_REVERBSCALE | - EAXLISTENERFLAGS_REVERBDELAYSCALE | - EAXLISTENERFLAGS_DECAYHFLIMIT); - - //------------------------------------ - public static final int DSPROPERTY_EAXBUFFER_NONE = 0; - public static final int DSPROPERTY_EAXBUFFER_ALLPARAMETERS = 1; - public static final int DSPROPERTY_EAXBUFFER_DIRECT = 2; - public static final int DSPROPERTY_EAXBUFFER_DIRECTHF = 3; - public static final int DSPROPERTY_EAXBUFFER_ROOM = 4; - public static final int DSPROPERTY_EAXBUFFER_ROOMHF = 5; - public static final int DSPROPERTY_EAXBUFFER_ROOMROLLOFFFACTOR = 6; - public static final int DSPROPERTY_EAXBUFFER_OBSTRUCTION = 7; - public static final int DSPROPERTY_EAXBUFFER_OBSTRUCTIONLFRATIO = 8; - public static final int DSPROPERTY_EAXBUFFER_OCCLUSION = 9; - public static final int DSPROPERTY_EAXBUFFER_OCCLUSIONLFRATIO = 10; - public static final int DSPROPERTY_EAXBUFFER_OCCLUSIONROOMRATIO = 11; - public static final int DSPROPERTY_EAXBUFFER_OUTSIDEVOLUMEHF = 12; - public static final int DSPROPERTY_EAXBUFFER_AIRABSORPTIONFACTOR = 13; - public static final int DSPROPERTY_EAXBUFFER_FLAGS = 14; - - /** changes take effect immediately */ - public static final int DSPROPERTY_EAXBUFFER_IMMEDIATE = 0x00000000; - - /** changes take effect later */ - public static final int DSPROPERTY_EAXBUFFER_DEFERRED = 0x80000000; - public static final int DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS = - (DSPROPERTY_EAXBUFFER_NONE | - DSPROPERTY_EAXBUFFER_IMMEDIATE); - - /** affects DSPROPERTY_EAXBUFFER_DIRECTHF */ - public static final int EAXBUFFERFLAGS_DIRECTHFAUTO = 0x00000001; - - /** affects DSPROPERTY_EAXBUFFER_ROOM */ - public static final int EAXBUFFERFLAGS_ROOMAUTO = 0x00000002; - - /** affects DSPROPERTY_EAXBUFFER_ROOMHF */ - public static final int EAXBUFFERFLAGS_ROOMHFAUTO = 0x00000004; - - /** reserved future use */ - public static final int EAXBUFFERFLAGS_RESERVED = 0xFFFFFFF8; - - // property ranges and defaults: - - public static final int EAXBUFFER_MINDIRECT = -10000; - public static final int EAXBUFFER_MAXDIRECT = 1000; - public static final int EAXBUFFER_DEFAULTDIRECT = 0; - - public static final int EAXBUFFER_MINDIRECTHF = -10000; - public static final int EAXBUFFER_MAXDIRECTHF = 0; - public static final int EAXBUFFER_DEFAULTDIRECTHF = 0; - - public static final int EAXBUFFER_MINROOM = -10000; - public static final int EAXBUFFER_MAXROOM = 1000; - public static final int EAXBUFFER_DEFAULTROOM = 0; - - public static final int EAXBUFFER_MINROOMHF = -10000; - public static final int EAXBUFFER_MAXROOMHF = 0; - public static final int EAXBUFFER_DEFAULTROOMHF = 0; - - public static final float EAXBUFFER_MINROOMROLLOFFFACTOR = 0.0f; - public static final float EAXBUFFER_MAXROOMROLLOFFFACTOR = 10.f; - public static final float EAXBUFFER_DEFAULTROOMROLLOFFFACTOR = 0.0f; - - public static final int EAXBUFFER_MINOBSTRUCTION = -10000; - public static final int EAXBUFFER_MAXOBSTRUCTION = 0; - public static final int EAXBUFFER_DEFAULTOBSTRUCTION = 0; - - public static final float EAXBUFFER_MINOBSTRUCTIONLFRATIO = 0.0f; - public static final float EAXBUFFER_MAXOBSTRUCTIONLFRATIO = 1.0f; - public static final float EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO = 0.0f; - - public static final int EAXBUFFER_MINOCCLUSION = -10000; - public static final int EAXBUFFER_MAXOCCLUSION = 0; - public static final int EAXBUFFER_DEFAULTOCCLUSION = 0; - - public static final float EAXBUFFER_MINOCCLUSIONLFRATIO = 0.0f; - public static final float EAXBUFFER_MAXOCCLUSIONLFRATIO = 1.0f; - public static final float EAXBUFFER_DEFAULTOCCLUSIONLFRATIO = 0.25f; - - public static final float EAXBUFFER_MINOCCLUSIONROOMRATIO = 0.0f; - public static final float EAXBUFFER_MAXOCCLUSIONROOMRATIO = 10.0f; - public static final float EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO = 0.5f; - - public static final int EAXBUFFER_MINOUTSIDEVOLUMEHF = -10000; - public static final int EAXBUFFER_MAXOUTSIDEVOLUMEHF = 0; - public static final int EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF = 0; - - public static final float EAXBUFFER_MINAIRABSORPTIONFACTOR = 0.0f; - public static final float EAXBUFFER_MAXAIRABSORPTIONFACTOR = 10.0f; - public static final float EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR = 1.0f; - - public static final int EAXBUFFER_DEFAULTFLAGS = - (EAXBUFFERFLAGS_DIRECTHFAUTO | - EAXBUFFERFLAGS_ROOMAUTO | - EAXBUFFERFLAGS_ROOMHFAUTO); // Single window material preset public static final int MATERIAL_SINGLEWINDOW = -2800; Index: EAXBufferProperties.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EAXBufferProperties.java 2 Sep 2002 22:06:13 -0000 1.1 +++ EAXBufferProperties.java 3 Sep 2002 11:17:42 -0000 1.2 @@ -92,6 +92,95 @@ /** modifies the behavior of properties offset */ protected static int flags_offset; + public static final int NONE = 0; + public static final int ALLPARAMETERS = 1; + public static final int DIRECT = 2; + public static final int DIRECTHF = 3; + public static final int ROOM = 4; + public static final int ROOMHF = 5; + public static final int ROOMROLLOFFFACTOR = 6; + public static final int OBSTRUCTION = 7; + public static final int OBSTRUCTIONLFRATIO = 8; + public static final int OCCLUSION = 9; + public static final int OCCLUSIONLFRATIO = 10; + public static final int OCCLUSIONROOMRATIO = 11; + public static final int OUTSIDEVOLUMEHF = 12; + public static final int AIRABSORPTIONFACTOR = 13; + public static final int FLAGS = 14; + + /** changes take effect immediately */ + public static final int IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int DEFERRED = 0x80000000; + public static final int COMMITDEFERREDSETTINGS = (NONE | IMMEDIATE); + + /** affects DSPROPERTY_EAXBUFFER_DIRECTHF */ + public static final int FLAGS_DIRECTHFAUTO = 0x00000001; + + /** affects DSPROPERTY_EAXBUFFER_ROOM */ + public static final int FLAGS_ROOMAUTO = 0x00000002; + + /** affects DSPROPERTY_EAXBUFFER_ROOMHF */ + public static final int FLAGS_ROOMHFAUTO = 0x00000004; + + /** reserved future use */ + public static final int FLAGS_RESERVED = 0xFFFFFFF8; + + // property ranges and defaults: + + public static final int MINDIRECT = -10000; + public static final int MAXDIRECT = 1000; + public static final int DEFAULTDIRECT = 0; + + public static final int MINDIRECTHF = -10000; + public static final int MAXDIRECTHF = 0; + public static final int DEFAULTDIRECTHF = 0; + + public static final int MINROOM = -10000; + public static final int MAXROOM = 1000; + public static final int DEFAULTROOM = 0; + + public static final int MINROOMHF = -10000; + public static final int MAXROOMHF = 0; + public static final int DEFAULTROOMHF = 0; + + public static final float MINROOMROLLOFFFACTOR = 0.0f; + public static final float MAXROOMROLLOFFFACTOR = 10.f; + public static final float DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final int MINOBSTRUCTION = -10000; + public static final int MAXOBSTRUCTION = 0; + public static final int DEFAULTOBSTRUCTION = 0; + + public static final float MINOBSTRUCTIONLFRATIO = 0.0f; + public static final float MAXOBSTRUCTIONLFRATIO = 1.0f; + public static final float DEFAULTOBSTRUCTIONLFRATIO = 0.0f; + + public static final int MINOCCLUSION = -10000; + public static final int MAXOCCLUSION = 0; + public static final int DEFAULTOCCLUSION = 0; + + public static final float MINOCCLUSIONLFRATIO = 0.0f; + public static final float MAXOCCLUSIONLFRATIO = 1.0f; + public static final float DEFAULTOCCLUSIONLFRATIO = 0.25f; + + public static final float MINOCCLUSIONROOMRATIO = 0.0f; + public static final float MAXOCCLUSIONROOMRATIO = 10.0f; + public static final float DEFAULTOCCLUSIONROOMRATIO = 0.5f; + + public static final int MINOUTSIDEVOLUMEHF = -10000; + public static final int MAXOUTSIDEVOLUMEHF = 0; + public static final int DEFAULTOUTSIDEVOLUMEHF = 0; + + public static final float MINAIRABSORPTIONFACTOR = 0.0f; + public static final float MAXAIRABSORPTIONFACTOR = 10.0f; + public static final float DEFAULTAIRABSORPTIONFACTOR = 1.0f; + + public static final int DEFAULTFLAGS = (FLAGS_DIRECTHFAUTO | + FLAGS_ROOMAUTO | + FLAGS_ROOMHFAUTO); + static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXBUFFERPROPERTIES_SIZE = sizeOfEaxBufferProperties(); Index: EAXListenerProperties.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EAXListenerProperties.java 2 Sep 2002 22:06:13 -0000 1.1 +++ EAXListenerProperties.java 3 Sep 2002 11:17:42 -0000 1.2 @@ -94,6 +94,112 @@ /** modifies the behavior of properties offset */ protected static int flags_offset; + public static final int NONE = 0; + public static final int ALLPARAMETERS = 1; + public static final int ROOM = 2; + public static final int ROOMHF = 3; + public static final int ROOMROLLOFFFACTOR = 4; + public static final int DECAYTIME = 5; + public static final int DECAYHFRATIO = 6; + public static final int REFLECTIONS = 7; + public static final int REFLECTIONSDELAY = 8; + public static final int REVERB = 9; + public static final int REVERBDELAY = 10; + public static final int ENVIRONMENT = 11; + public static final int ENVIRONMENTSIZE = 12; + public static final int ENVIRONMENTDIFFUSION = 13; + public static final int AIRABSORPTIONHF = 14; + public static final int FLAGS = 15; + + /** changes take effect immediately */ + public static final int IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int DEFERRED = 0x80000000; + + public static final int COMMITDEFERREDSETTINGS = (NONE | IMMEDIATE); + + /** reverberation decay time */ + public static final int FLAGS_DECAYTIMESCALE = 0x00000001; + + /** reflection level */ + public static final int FLAGS_REFLECTIONSSCALE = 0x00000002; + + /** initial reflection delay time */ + public static final int FLAGS_REFLECTIONSDELAYSCALE = 0x00000004; + + /** reflections level */ + public static final int FLAGS_REVERBSCALE = 0x00000008; + + /** late reverberation delay time */ + public static final int FLAGS_REVERBDELAYSCALE = 0x00000010; + + /** This flag limits high-frequency decay time according to air absorption. */ + public static final int FLAGS_DECAYHFLIMIT = 0x00000020; + + /** reserved future use */ + public static final int FLAGS_RESERVED = 0xFFFFFFC0; + + // property ranges and defaults: + public static final int MINROOM = -10000; + public static final int MAXROOM = 0; + public static final int DEFAULTROOM = -1000; + + public static final int MINROOMHF = -10000; + public static final int MAXROOMHF = 0; + public static final int DEFAULTROOMHF = -100; + + public static final float MINROOMROLLOFFFACTOR = 0.0f; + public static final float MAXROOMROLLOFFFACTOR = 10.0f; + public static final float DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final float MINDECAYTIME = 0.1f; + public static final float MAXDECAYTIME = 20.0f; + public static final float DEFAULTDECAYTIME = 1.49f; + + public static final float MINDECAYHFRATIO = 0.1f; + public static final float MAXDECAYHFRATIO = 2.0f; + public static final float DEFAULTDECAYHFRATIO = 0.83f; + + public static final int MINREFLECTIONS = -10000; + public static final int MAXREFLECTIONS = 1000; + public static final int DEFAULTREFLECTIONS = -2602; + + public static final float MINREFLECTIONSDELAY = 0.0f; + public static final float MAXREFLECTIONSDELAY = 0.3f; + public static final float DEFAULTREFLECTIONSDELAY = 0.007f; + + public static final int MINREVERB = -10000; + public static final int MAXREVERB = 2000; + public static final int DEFAULTREVERB = 200; + + public static final float MINREVERBDELAY = 0.0f; + public static final float MAXREVERBDELAY = 0.1f; + public static final float DEFAULTREVERBDELAY = 0.011f; + + public static final int MINENVIRONMENT = 0; + public static final int MAXENVIRONMENT = (EAX.ENVIRONMENT_COUNT-1); + public static final int DEFAULTENVIRONMENT = EAX.ENVIRONMENT_GENERIC; + + public static final float MINENVIRONMENTSIZE = 1.0f; + public static final float MAXENVIRONMENTSIZE = 100.0f; + public static final float DEFAULTENVIRONMENTSIZE = 7.5f; + + public static final float MINENVIRONMENTDIFFUSION = 0.0f; + public static final float MAXENVIRONMENTDIFFUSION = 1.0f; + public static final float DEFAULTENVIRONMENTDIFFUSION = 1.0f; + + public static final float MINAIRABSORPTIONHF = -100.0f; + public static final float MAXAIRABSORPTIONHF = 0.0f; + public static final float DEFAULTAIRABSORPTIONHF = -5.0f; + + public static final int DEFAULTFLAGS = (FLAGS_DECAYTIMESCALE | + FLAGS_REFLECTIONSSCALE | + FLAGS_REFLECTIONSDELAYSCALE | + FLAGS_REVERBSCALE | + FLAGS_REVERBDELAYSCALE | + FLAGS_DECAYHFLIMIT); + static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXLISTENERPROPERTIES_SIZE = sizeOfEaxListenerProperties(); |
From: Gregory P. <gre...@us...> - 2002-09-03 05:53:08
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory usw-pr-cvs1:/tmp/cvs-serv30536 Modified Files: org_lwjgl_Display.cpp Log Message: Updated with GL setup functions Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_Display.cpp 3 Sep 2002 04:57:24 -0000 1.1 +++ org_lwjgl_Display.cpp 3 Sep 2002 05:53:05 -0000 1.2 @@ -29,13 +29,12 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - +#include <Carbon/Carbon.h> +#include <AGL/agl.h> +#include <OpenGL/gl.h> #include "org_lwjgl_Display.h" -// Initialise static variables -bool oneShotInitialised = false; - AGLContext ctx; Rect rect; @@ -79,6 +78,15 @@ } ShowWindow( win ); + + /* Setup the OpenGL context */ + GLint attrib[] = { AGL_RGBA, AGL_NONE }; + + ctx = setupAGL( attrib, (AGLDrawable) win); + if(ctx == NULL) + { + return JNI_FALSE; + } jfieldID fid_handle = env->GetStaticFieldID(clazz, "handle", "I"); @@ -107,4 +115,57 @@ printf("Destroyed display\n"); #endif } -@ + + +/* +** OpenGL Setup +*/ +static AGLContext setupAGL( GLint* attrib, AGLDrawable win) +{ + AGLPixelFormat fmt; + AGLContext ctx; + GLboolean ok; + + /* Choose an rgb pixel format */ + fmt = aglChoosePixelFormat(NULL, 0, attrib); + if(fmt == NULL) + { + return NULL; + } + + /* Create an AGL context */ + ctx = aglCreateContext(fmt, NULL); + if(ctx == NULL) + { + return NULL; + } + + /* Attach the window to the context */ + ok = aglSetDrawable(ctx, GetWindowPort(win) ); + if(!ok) + { + return NULL; + } + + /* Make the context the current context */ + ok = aglSetCurrentContext(ctx); + if(!ok) + { + return NULL; + } + + /* Pixel format is no longer needed */ + aglDestroyPixelFormat(fmt); + + return ctx; +} + +/* +** OpenGL Cleanup +*/ +static void cleanupAGL(AGLContext ctx) +{ + aglSetCurrentContext(NULL); + aglSetDrawable(ctx, NULL); + aglDestroyContext(ctx); +} |
From: Gregory P. <gre...@us...> - 2002-09-03 04:57:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory usw-pr-cvs1:/tmp/cvs-serv17409 Added Files: org_lwjgl_Display.cpp Log Message: Initial revision of the Mac version of the display class. Just testing CVS script. --- NEW FILE: org_lwjgl_Display.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/macosx/org_lwjgl_Display.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_Display.h" // Initialise static variables bool oneShotInitialised = false; AGLContext ctx; Rect rect; WindotPtr win; /* * Class: org_lwjgl_Display * Method: getAvailableDisplayModes * Signature: ()[Lorg/lwjgl/DisplayMode; */ JNIEXPORT jobjectArray JNICALL Java_org_lwjgl_Display_getAvailableDisplayModes (JNIEnv * env, jclass clazz) { return NULL; } /* * Class: org_lwjgl_Display * Method: nCreate * Signature: (IIIIZ)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_Display_nCreate (JNIEnv * env, jclass clazz, jint width, jint height, jint bpp, jint freq, jboolean debug) { #ifdef _DEBUG printf("Creating display: size %dx%d %dhz %dbpp...\n", width, height, freq, bpp); #endif InitCursor(); SetRect( &rect, 0, 0, width, height ); win = NewCWindow( NULL, &rect, "Lightweight Java Gaming Library", true, kWindowShadowDialogProc, (WindowPtr) -1L, true, 0L ); SetPortWindowPort( win ); if ( win==null ) { printf("Failed to create a window\n"); return 1; } ShowWindow( win ); jfieldID fid_handle = env->GetStaticFieldID(clazz, "handle", "I"); env->SetStaticIntField(clazz, fid_handle, (jint) win); return JNI_TRUE; } /* * Class: org_lwjgl_Display * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_Display_nDestroy (JNIEnv * env, jclass clazz) { // cleanup the AGL context // cleanupAGL( ctx ); // cleanup the window // DisposeWindow( win ); #ifdef _DEBUG printf("Destroyed display\n"); #endif } @ |
From: Gregory P. <gre...@us...> - 2002-09-03 04:56:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/macosx In directory usw-pr-cvs1:/tmp/cvs-serv17253/macosx Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/native/macosx added to the repository |
From: Brian M. <ma...@us...> - 2002-09-02 22:08:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv27336 Added Files: org_lwjgl_openal_eax_EAXBufferProperties.cpp org_lwjgl_openal_eax_EAXListenerProperties.cpp Log Message: add: finished EAX support --- NEW FILE: org_lwjgl_openal_eax_EAXBufferProperties.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_EAXBufferProperties.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXBufferProperties.h" #include <eax.h> #include <stddef.h> /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: sizeOfEaxBufferProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_sizeOfEaxBufferProperties(JNIEnv *env, jobject obj) { return sizeof(EAXBUFFERPROPERTIES); } /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_assignOffsets(JNIEnv *env, jobject obj) { jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXBufferProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "direct_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirect)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "directHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirectHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstruction_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lObstruction)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstructionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flObstructionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusion_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOcclusion)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionRoomRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionRoomRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "outsideVolumeHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOutsideVolumeHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "airAbsorptionFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flAirAbsorptionFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "flags_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, dwFlags)); } --- NEW FILE: org_lwjgl_openal_eax_EAXListenerProperties.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_EAXListenerProperties.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXListenerProperties.h" #include <eax.h> #include <stddef.h> /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: sizeOfEaxListenerProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_sizeOfEaxListenerProperties(JNIEnv *env, jobject obj) { return sizeof(EAXLISTENERPROPERTIES); } /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_assignOffsets (JNIEnv *env, jobject obj) { jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXListenerProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayTime_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayTime)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayHFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayHFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflections_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReflections)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflectionsDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReflectionsDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverb_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReverb)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverbDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReverbDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environment_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, dwEnvironment)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environmentSize_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flEnvironmentSize)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environmentDiffusion_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flEnvironmentDiffusion)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "airAbsorptionHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flAirAbsorptionHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "flags_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, dwFlags)); } |
From: Brian M. <ma...@us...> - 2002-09-02 22:08:04
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv27201 Added Files: org_lwjgl_openal_eax_EAXBufferProperties.h org_lwjgl_openal_eax_EAXListenerProperties.h Log Message: add: finished EAX support --- NEW FILE: org_lwjgl_openal_eax_EAXBufferProperties.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXBufferProperties.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_eax_EAXBufferProperties */ #ifndef _Included_org_lwjgl_openal_eax_EAXBufferProperties #define _Included_org_lwjgl_openal_eax_EAXBufferProperties #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: EAXBUFFERPROPERTIES_SIZE */ /* Inaccessible static: direct_offset */ /* Inaccessible static: directHF_offset */ /* Inaccessible static: room_offset */ /* Inaccessible static: roomHF_offset */ /* Inaccessible static: roomRolloffFactor_offset */ /* Inaccessible static: obstruction_offset */ /* Inaccessible static: obstructionLFRatio_offset */ /* Inaccessible static: occlusion_offset */ /* Inaccessible static: occlusionLFRatio_offset */ /* Inaccessible static: occlusionRoomRatio_offset */ /* Inaccessible static: outsideVolumeHF_offset */ /* Inaccessible static: airAbsorptionFactor_offset */ /* Inaccessible static: flags_offset */ /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: sizeOfEaxBufferProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_sizeOfEaxBufferProperties (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_assignOffsets (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif --- NEW FILE: org_lwjgl_openal_eax_EAXListenerProperties.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXListenerProperties.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_eax_EAXListenerProperties */ #ifndef _Included_org_lwjgl_openal_eax_EAXListenerProperties #define _Included_org_lwjgl_openal_eax_EAXListenerProperties #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: EAXLISTENERPROPERTIES_SIZE */ /* Inaccessible static: room_offset */ /* Inaccessible static: roomHF_offset */ /* Inaccessible static: roomRolloffFactor_offset */ /* Inaccessible static: decayTime_offset */ /* Inaccessible static: decayHFRatio_offset */ /* Inaccessible static: reflections_offset */ /* Inaccessible static: reflectionsDelay_offset */ /* Inaccessible static: reverb_offset */ /* Inaccessible static: reverbDelay_offset */ /* Inaccessible static: environment_offset */ /* Inaccessible static: environmentSize_offset */ /* Inaccessible static: environmentDiffusion_offset */ /* Inaccessible static: airAbsorptionHF_offset */ /* Inaccessible static: flags_offset */ /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: sizeOfEaxListenerProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_sizeOfEaxListenerProperties (JNIEnv *, jclass); /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_assignOffsets (JNIEnv *, jclass); #ifdef __cplusplus } #endif #endif |
From: Brian M. <ma...@us...> - 2002-09-02 22:06:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv26754/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: add: EAX support done - needs some cleaning, and possibly refactoring of constants... Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- ALTest.java 29 Aug 2002 12:44:32 -0000 1.7 +++ ALTest.java 2 Sep 2002 22:06:13 -0000 1.8 @@ -37,6 +37,8 @@ import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.ALUT; import org.lwjgl.openal.ALUTLoadWAVData; +import org.lwjgl.openal.eax.EAX; +import org.lwjgl.openal.eax.EAXBufferProperties; import org.lwjgl.Sys; import java.nio.ByteBuffer; @@ -213,6 +215,9 @@ AL.INVERSE_DISTANCE_CLAMPED }; + /** Whether or not EAX is supported */ + protected boolean eaxAvailable = false; + /** * Creates an instance of ALTest */ @@ -523,6 +528,9 @@ System.exit(-1); } + //do EAX check (can only be performed after device / context creation + eaxAvailable = al.isExtensionPresent("EAX"); + do { System.out.print("\n\n\nAutomated Test Series:\n\n"); System.out.print("A) Run Fully Automated Tests\n"); @@ -530,7 +538,7 @@ System.out.print("\nInteractive Tests:\n\n"); System.out.print("1 Position Test\n"); System.out.print("2 Looping Test\n"); - System.out.print("*3 EAX 2.0 Test\n"); + System.out.print("3 EAX 2.0 Test\n"); System.out.print("4 Queue Test\n"); System.out.print("5 Buffer Test\n"); System.out.print("6 Frequency Test\n"); @@ -560,7 +568,11 @@ i_LoopingTest(); break; case '3': - i_EAXTest(); + if(eaxAvailable) { + i_EAXTest(); + } else { + System.out.println("EAX not supported"); + } break; case '4': i_QueueTest(); @@ -1255,8 +1267,207 @@ } protected void i_EAXTest() { - System.out.println("i_EAXTest"); - delay_ms(3000); + + int error; + int ch = -1; + IntBuffer source = createIntBuffer(2); + + IntBuffer Env = createIntBuffer(1); + IntBuffer Room = createIntBuffer(1); + IntBuffer Occlusion = createIntBuffer(1); + IntBuffer Obstruction = createIntBuffer(1); + EAXBufferProperties eaxBufferProp0 = new EAXBufferProperties(); + + FloatBuffer source0Pos = createFloatBuffer(3); + source0Pos.put(new float[] {-2.0f, 0.0f, 2.0f}); + FloatBuffer source0Vel = createFloatBuffer(3); + source0Vel.put(new float[] {0.0f, 0.0f, 0.0f}); + + FloatBuffer source1Pos = createFloatBuffer(3); + source1Pos.put(new float[] {2.0f, 0.0f, -2.0f}); + FloatBuffer source1Vel = createFloatBuffer(3); + source1Vel.put(new float[] {0.0f, 0.0f, 0.0f}); + + EAX eax = new EAX(); + try { + eax.create(); + } catch (Exception e) { + e.printStackTrace(); + return; + } + + // Clear Error Code + al.getError(); + + al.genSources(2, Sys.getDirectBufferAddress(source)); + if ((error = al.getError()) != AL.NO_ERROR) { + displayALError("alGenSources 2 : ", error); + return; + } + + al.sourcef(source.get(0),AL.PITCH,1.0f); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcef 0 AL_PITCH : \n", error); + + al.sourcef(source.get(0),AL.GAIN,1.0f); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcef 0 AL_GAIN : \n", error); + + al.sourcefv(source.get(0),AL.POSITION,Sys.getDirectBufferAddress(source0Pos)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcefv 0 AL_POSITION : \n", error); + + al.sourcefv(source.get(0),AL.VELOCITY,Sys.getDirectBufferAddress(source0Vel)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcefv 0 AL_VELOCITY : \n", error); + + al.sourcei(source.get(0),AL.BUFFER, buffers.get(0)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcei 0 AL_BUFFER buffer 0 : \n", error); + + al.sourcei(source.get(0),AL.LOOPING,AL.TRUE); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcei 0 AL_LOOPING true: \n", error); + + + al.sourcef(source.get(1),AL.PITCH,1.0f); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcef 1 AL_PITCH : \n", error); + + al.sourcef(source.get(1),AL.GAIN,1.0f); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcef 1 AL_GAIN : \n", error); + + al.sourcefv(source.get(1),AL.POSITION,Sys.getDirectBufferAddress(source1Pos)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcefv 1 AL_POSITION : \n", error); + + al.sourcefv(source.get(1),AL.VELOCITY,Sys.getDirectBufferAddress(source1Vel)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcefv 1 AL_VELOCITY : \n", error); + + al.sourcei(source.get(1),AL.BUFFER, buffers.get(1)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcei 1 AL_BUFFER buffer 1 : \n", error); + + al.sourcei(source.get(1),AL.LOOPING,AL.FALSE); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourcei 1 AL_LOOPING false: \n", error); + + System.out.print("EAX Test\n\n"); + System.out.print("Press '1' to play source 0 (looping)\n"); + System.out.print("Press '2' to play source 1 once (single shot)\n"); + System.out.print("Press '3' to stop source 0\n"); + System.out.print("Press '4' to stop source 1\n"); + System.out.print("Press '5' to add Hangar reverb (DEFERRED)\n"); + System.out.print("Press '6' to remove reverb (DEFERRED)\n"); + System.out.print("Press '7' to occlude source 0 (DEFERRED)\n"); + System.out.print("Press '8' to remove occlusion from source 0 (DEFERRED)\n"); + System.out.print("Press '9' to obstruct source 1 (IMMEDIATE)\n"); + System.out.print("Press '0' to remove obstruction from source 1 (IMMEDIATE)\n"); + System.out.print("Press 'c' to COMMIT EAX settings\n"); + System.out.print("Press 'q' to quit\n\n"); + + do { + try { + ch = System.in.read(); + } catch (IOException ioe) { + } + switch (ch) { + case '1': + al.sourcePlay(source.get(0)); + break; + case '2': + al.sourcePlay(source.get(1)); + break; + case '3': + al.sourceStop(source.get(0)); + break; + case '4': + al.sourceStop(source.get(1)); + break; + case '5': + Env.put(0, EAX.ENVIRONMENT_HANGAR); + eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ENVIRONMENT | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, + 0, Sys.getDirectBufferAddress(Env), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXLISTENER_ENVIRONMENT | EAXLISTENER_DEFERRED : \n", error); + break; + + case '6': + Room.put(-10000); + eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ROOM | EAX.DSPROPERTY_EAXLISTENER_DEFERRED, 0, + Sys.getDirectBufferAddress(Room), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXLISTENER_ROOM | EAXLISTENER_DEFERRED : \n", error); + break; + + case '7': + eax.eaxGet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_ALLPARAMETERS, source.get(0), + eaxBufferProp0.getAddress(), eaxBufferProp0.getSize()); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxGet EAXBUFFER_ALLPARAMETERS : \n", error); + eaxBufferProp0.setOcclusion(-5000); + eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_ALLPARAMETERS | EAX.DSPROPERTY_EAXBUFFER_DEFERRED, source.get(0), + eaxBufferProp0.getAddress(), eaxBufferProp0.getSize()); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXBUFFER_ALLPARAMETERS | EAXBUFFER_DEFERRED : \n", error); + break; + + case '8': + Occlusion.put(0, 0); + eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OCCLUSION | EAX.DSPROPERTY_EAXBUFFER_DEFERRED, source.get(0), + Sys.getDirectBufferAddress(Occlusion), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXBUFFER_OCCLUSION | EAXBUFFER_DEFERRED : \n", error); + break; + + case '9': + Obstruction.put(0, -5000); + eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OBSTRUCTION, source.get(1), + Sys.getDirectBufferAddress(Obstruction), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXBUFFER_OBSTRUCTION : \n", error); + break; + + case '0': + Obstruction.put(0, 0); + eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_OBSTRUCTION, source.get(1), + Sys.getDirectBufferAddress(Obstruction), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXBUFFER_OBSTRUCTION : \n", error); + break; + + case 'C': + // Commit settings on source 0 + eax.eaxSet(EAX.BUFFER_GUID, EAX.DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS, + source.get(0), 0, 0); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXBUFFER_COMMITDEFERREDSETTINGS : \n", error); + + // Commit Listener settings + eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS, + 0, 0, 0); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXLISTENER_COMMITDEFERREDSETTINGSENVIRONMENT : \n", error); + break; + } + } while (ch != 'Q'); + + // reset EAX level + Room.put(0, -10000); + eax.eaxSet(EAX.LISTENER_GUID, EAX.DSPROPERTY_EAXLISTENER_ROOM, 0, Sys.getDirectBufferAddress(Room), 4); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("eaxSet EAXLISTENER_ROOM : \n", error); + + // Release resources + al.sourceStopv(2, Sys.getDirectBufferAddress(source)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alSourceStopv 2 : ", error); + + al.deleteSources(2, Sys.getDirectBufferAddress(source)); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("alDeleteSources 2 : ", error); } protected void i_QueueTest() { |
From: Brian M. <ma...@us...> - 2002-09-02 22:06:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory usw-pr-cvs1:/tmp/cvs-serv26754/org/lwjgl/openal/eax Modified Files: BaseEAXConstants.java Added Files: EAXBufferProperties.java EAXListenerProperties.java Log Message: add: EAX support done - needs some cleaning, and possibly refactoring of constants... --- NEW FILE: EAXBufferProperties.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXBufferProperties.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; import org.lwjgl.Sys; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.lang.reflect.*; /** * $Id: EAXBufferProperties.java,v 1.1 2002/09/02 22:06:13 matzon Exp $ * * This class encapsultaes the EAXBUFFERPROPERTIES struct * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAXBufferProperties { /** ByteBuffer representing EAXBUFFERPROPERTIES */ protected ByteBuffer eaxBufferProperties; /** size needed by ByteBuffer to contain EAXBUFFERPROPERTIES */ protected static int EAXBUFFERPROPERTIES_SIZE; /** direct path level offset */ protected static int direct_offset; /** direct path level at high frequencies offset */ protected static int directHF_offset; /** room effect level offset */ protected static int room_offset; /** room effect level at high frequencies offset */ protected static int roomHF_offset; /** like DS3D flRolloffFactor but for room effect offset */ protected static int roomRolloffFactor_offset; /** main obstruction control (attenuation at high frequencies) offset */ protected static int obstruction_offset; /** obstruction low-frequency level re. main control offset */ protected static int obstructionLFRatio_offset; /** main occlusion control (attenuation at high frequencies) offset */ protected static int occlusion_offset; /** occlusion low-frequency level re. main control offset */ protected static int occlusionLFRatio_offset; /** occlusion room effect level re. main control offset */ protected static int occlusionRoomRatio_offset; /** outside sound cone level at high frequencies offset */ protected static int outsideVolumeHF_offset; /** multiplies DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF offset */ protected static int airAbsorptionFactor_offset; /** modifies the behavior of properties offset */ protected static int flags_offset; static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXBUFFERPROPERTIES_SIZE = sizeOfEaxBufferProperties(); assignOffsets(); } /** * Creates a new instance of EAXBufferProperties * * @param eaxBufferProperties address of EAXBUFFERPROPERTIES */ public EAXBufferProperties() { eaxBufferProperties = ByteBuffer.allocateDirect(EAXBUFFERPROPERTIES_SIZE); eaxBufferProperties.order(ByteOrder.nativeOrder()); } /** * Retireves the direct path level * * @return direct path level */ public long getDirect() { return eaxBufferProperties.getLong(direct_offset); } /** * Sets the direct path level * * @param direct direct path level to set to */ public void setDirect(long direct) { eaxBufferProperties.putLong(direct_offset, direct); } /** * Retireves the direct path level at high frequencies * * @return direct path level at high frequencies */ public long getDirectHF() { return eaxBufferProperties.getLong(directHF_offset); } /** * Sets the direct path level at high frequencies * * @param direct direct path level at high frequencies to set to */ public void setDirectHF(long directHF) { eaxBufferProperties.putLong(directHF_offset, directHF); } /** * Retireves the room effect level * * @return room effect level */ public long getRoom() { return eaxBufferProperties.getLong(room_offset); } /** * Sets the room effect level * * @param room room effect level to set to */ public void setRoom(long room) { eaxBufferProperties.putLong(room_offset, room); } /** * Retireves the room effect level at high frequencies * * @return room effect level at high frequencies */ public long getRoomHF() { return eaxBufferProperties.getLong(roomHF_offset); } /** * Sets the room effect level at high frequencies * * @param room room effect level at high frequencies to set to */ public void setRoomHF(long roomHF) { eaxBufferProperties.putLong(roomHF_offset, roomHF); } /** * Retireves the DS3D flRolloffFactor for room effect * * @return DS3D flRolloffFactor for room effect */ public float getRoomRolloffFactor() { return eaxBufferProperties.getFloat(roomRolloffFactor_offset); } /** * Sets the DS3D flRolloffFactor for room effect * * @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to */ public void setRoomRolloffFactor(float roomRolloffFactor) { eaxBufferProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); } /** * Retireves the main obstruction control (attenuation at high frequencies) * * @return main obstruction control (attenuation at high frequencies) */ public long getObstruction() { return eaxBufferProperties.getLong(obstruction_offset); } /** * Sets the main obstruction control (attenuation at high frequencies) * * @param obstruction main obstruction control (attenuation at high frequencies) to set to */ public void setObstruction(long obstruction) { eaxBufferProperties.putLong(obstruction_offset, obstruction); } /** * Retireves the obstruction low-frequency level re. main control * * @return obstruction low-frequency level re. main control */ public float getObstructionLFRatio() { return eaxBufferProperties.getFloat(obstructionLFRatio_offset); } /** * Sets the obstruction low-frequency level re. main control * * @param obstructionLFRatio obstruction low-frequency level re. main control to set to */ public void setObstructionLFRatio(float obstructionLFRatio) { eaxBufferProperties.putFloat(obstructionLFRatio_offset, obstructionLFRatio); } /** * Retireves the main occlusion control (attenuation at high frequencies) * * @return main occlusion control (attenuation at high frequencies) */ public long getOcclusion() { return eaxBufferProperties.getLong(occlusion_offset); } /** * Sets the main occlusion control (attenuation at high frequencies) * * @param occlusion main occlusion control (attenuation at high frequencies) to set to */ public void setOcclusion(long occlusion) { eaxBufferProperties.putLong(occlusion_offset, occlusion); } /** * Retireves the occlusion low-frequency level re. main control * * @return occlusion low-frequency level re. main control */ public float getOcclusionLFRatio() { return eaxBufferProperties.getFloat(occlusionLFRatio_offset); } /** * Sets the occlusion low-frequency level re. main control * * @param occlusionLFRatio occlusion low-frequency level re. main control to set to */ public void setOcclusionLFRatio(float occlusionLFRatio) { eaxBufferProperties.putFloat(occlusionLFRatio_offset, occlusionLFRatio); } /** * Retireves the occlusion room effect level re. main control * * @return occlusion room effect level re. main control */ public float getOcclusionRoomRatio() { return eaxBufferProperties.getFloat(occlusionRoomRatio_offset); } /** * Sets the OcclusionRoomRatio * * @param occlusionRoomRatio OcclusionRoomRatio to set to */ public void setOcclusionRoomRatio(float occlusionRoomRatio) { eaxBufferProperties.putFloat(occlusionRoomRatio_offset, occlusionRoomRatio); } /** * Retireves the OutsideVolumeHF * * @return OutsideVolumeHF */ public long getOutsideVolumeHF() { return eaxBufferProperties.getLong(outsideVolumeHF_offset); } /** * Sets the OutsideVolumeHF * * @param outsideVolumeHF OutsideVolumeHF to set to */ public void setOutsideVolumeHF(long outsideVolumeHF) { eaxBufferProperties.putLong(outsideVolumeHF_offset, outsideVolumeHF); } /** * Retireves the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF * * @return multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF */ public float getAirAbsorptionFactor() { return eaxBufferProperties.getFloat(airAbsorptionFactor_offset); } /** * Sets the multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF * * @param airAbsorptionFactor multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF to set to */ public void setAirAbsorptionFactor(float airAbsorptionFactor) { eaxBufferProperties.putFloat(airAbsorptionFactor_offset, airAbsorptionFactor); } /** * Retireves the modifier for behavior of properties * * @return modifier for behavior of properties */ public long getFlags() { return eaxBufferProperties.getLong(flags_offset); } /** * Sets the modifier for behavior of properties * * @param flags modifier for behavior of properties to set to */ public void setFlags(long flags) { eaxBufferProperties.putLong(flags_offset, flags); } /** * Retrieves the address of this EAXBufferProperties */ public int getAddress() { return Sys.getDirectBufferAddress(eaxBufferProperties); } /** * Retrieves the size of the containing ByteBuffer */ public int getSize() { return EAXBUFFERPROPERTIES_SIZE; } /** * Retrieves the size of the EAXBUFFERPROPERTIES */ protected static native int sizeOfEaxBufferProperties(); /** * Sets the offsets to the fields */ protected static native void assignOffsets(); } --- NEW FILE: EAXListenerProperties.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAXListenerProperties.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; import org.lwjgl.Sys; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * $Id: EAXListenerProperties.java,v 1.1 2002/09/02 22:06:13 matzon Exp $ * * This class encapsultaes the EAXLISTENERPROPERTIES struct * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAXListenerProperties { /** ByteBuffer representing EAXLISTENERPROPERTIES */ protected ByteBuffer eaxListenerProperties; /** size needed by ByteBuffer to contain EAXLISTENERPROPERTIES */ protected static int EAXLISTENERPROPERTIES_SIZE; /** room effect level offset */ protected static int room_offset; /** room effect level at high frequencies offset */ protected static int roomHF_offset; /**like DS3D flRolloffFactor but for room effect offset */ protected static int roomRolloffFactor_offset; /** reverberation decay time at low frequencies offset */ protected static int decayTime_offset; /** high-frequency to low-frequency decay time ratio offset */ protected static int decayHFRatio_offset; /** early reflections level relative to room effect offset */ protected static int reflections_offset; /** initial reflection delay time offset */ protected static int reflectionsDelay_offset; /** late reverberation level relative to room effect offset */ protected static int reverb_offset; /** late reverberation delay time relative to initial reflection offset */ protected static int reverbDelay_offset; /** sets all listener properties offset */ protected static int environment_offset; /** environment size in meters offset */ protected static int environmentSize_offset; /** environment diffusion offset */ protected static int environmentDiffusion_offset; /** change in level per meter at 5 kHz offset */ protected static int airAbsorptionHF_offset; /** modifies the behavior of properties offset */ protected static int flags_offset; static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXLISTENERPROPERTIES_SIZE = sizeOfEaxListenerProperties(); assignOffsets(); } /** * Creates a new instance of EAXBufferProperties */ public EAXListenerProperties() { eaxListenerProperties = ByteBuffer.allocateDirect(EAXLISTENERPROPERTIES_SIZE); eaxListenerProperties.order(ByteOrder.nativeOrder()); } /** * Retireves the room effect level * * @return room effect level */ public long getRoom() { return eaxListenerProperties.getLong(room_offset); } /** * Sets the room effect level * * @param room room effect level to set to */ public void setRoom(long room) { eaxListenerProperties.putLong(room_offset, room); } /** * Retireves the room effect level at high frequencies * * @return room effect level at high frequencies */ public long getRoomHF() { return eaxListenerProperties.getLong(roomHF_offset); } /** * Sets the room effect level at high frequencies * * @param room room effect level at high frequencies to set to */ public void setRoomHF(long roomHF) { eaxListenerProperties.putLong(roomHF_offset, roomHF); } /** * Retireves the DS3D flRolloffFactor for room effect * * @return DS3D flRolloffFactor for room effect */ public float getRoomRolloffFactor() { return eaxListenerProperties.getFloat(roomRolloffFactor_offset); } /** * Sets the DS3D flRolloffFactor for room effect * * @param roomRolloffFactor DS3D flRolloffFactor for room effect to set to */ public void setRoomRolloffFactor(float roomRolloffFactor) { eaxListenerProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); } /** * Retireves the reverberation decay time at low frequencies * * @return reverberation decay time at low frequencies */ public float getDecayTime() { return eaxListenerProperties.getFloat(decayTime_offset); } /** * Sets the reverberation decay time at low frequencies * * @param decayTime reverberation decay time at low frequencies to set to */ public void setDecayTime(float decayTime) { eaxListenerProperties.putFloat(decayTime_offset, decayTime); } /** * Retireves the high-frequency to low-frequency decay time ratio * * @return high-frequency to low-frequency decay time ratio */ public float getDecayTimeHFRatio() { return eaxListenerProperties.getFloat(decayHFRatio_offset); } /** * Sets the high-frequency to low-frequency decay time ratio * * @param decayTimeHFRatio high-frequency to low-frequency decay time ratio to set to */ public void setDecayTimeHFRatio(float decayTimeHFRatio) { eaxListenerProperties.putFloat(decayHFRatio_offset, decayTimeHFRatio); } /** * Retireves the early reflections level relative to room effect * * @return early reflections level relative to room effect */ public long getReflections() { return eaxListenerProperties.getLong(reflections_offset); } /** * Sets the early reflections level relative to room effect * * @param reflections early reflections level relative to room effect to set to */ public void setReflections(long reflections) { eaxListenerProperties.putLong(reflections_offset, reflections); } /** * Retireves the initial reflection delay time * * @return initial reflection delay time */ public float getReflectionsDelay() { return eaxListenerProperties.getFloat(reflectionsDelay_offset); } /** * Sets the initial reflection delay time * * @param reflectionsDelay initial reflection delay time to set to */ public void setReflectionsDelay(float reflectionsDelay) { eaxListenerProperties.putFloat(reflectionsDelay_offset, reflectionsDelay); } /** * Retireves the late reverberation level relative to room effect * * @return late reverberation level relative to room effect */ public long getReverb() { return eaxListenerProperties.getLong(reverb_offset); } /** * Sets the late reverberation level relative to room effect * * @param reverb late reverberation level relative to room effect to set to */ public void setReverb(long reverb) { eaxListenerProperties.putLong(reverb_offset, reverb); } /** * Retireves the late reverberation delay time relative to initial reflection * * @return late reverberation delay time relative to initial reflection */ public float getReverbDelay() { return eaxListenerProperties.getFloat(reverbDelay_offset); } /** * Sets the late reverberation delay time relative to initial reflection * * @param reverbDelay late reverberation delay time relative to initial reflection */ public void setReverbDelay(float reverbDelay) { eaxListenerProperties.putFloat(reverbDelay_offset, reverbDelay); } /** * Retireves the listener properties * * @return listener properties */ public long getEnvironment() { return eaxListenerProperties.getLong(environment_offset); } /** * Sets the listener properties * * @param environment listener properties to set to */ public void setEnvironment(long environment) { eaxListenerProperties.putLong(environment_offset, environment); } /** * Retireves the environment size in meters * * @return environment size in meters */ public float getEnvironmentSize() { return eaxListenerProperties.getFloat(environmentSize_offset); } /** * Sets the environment size in meters * * @param environmentSize environment size in meters to set to */ public void setEnvironmentSize(float environmentSize) { eaxListenerProperties.putFloat(environmentSize_offset, environmentSize); } /** * Retireves the environment diffusion * * @return environment diffusion */ public float getEnvironmentDiffusion() { return eaxListenerProperties.getFloat(environmentDiffusion_offset); } /** * Sets the environment diffusion * * @param environmentDiffusion environment diffusion to set to */ public void setEnvironmentDiffusion(float environmentDiffusion) { eaxListenerProperties.putFloat(environmentDiffusion_offset, environmentDiffusion); } /** * Retireves the change in level per meter at 5 kHz * * @return change in level per meter at 5 kHz */ public float getAirAbsorptionHF() { return eaxListenerProperties.getFloat(airAbsorptionHF_offset); } /** * Sets the change in level per meter at 5 kHz * * @param airAbsorptionHF change in level per meter at 5 kHz to set to */ public void setAirAbsorptionFactor(float airAbsorptionHF) { eaxListenerProperties.putFloat(airAbsorptionHF_offset, airAbsorptionHF); } /** * Retireves the modifier for behavior of properties * * @return modifier for behavior of properties */ public long getFlags() { return eaxListenerProperties.getLong(flags_offset); } /** * Sets the modifier for behavior of properties * * @param flags modifier for behavior of properties to set to */ public void setFlags(long flags) { eaxListenerProperties.putLong(flags_offset, flags); } /** * Retrieves the address of this EAXBufferProperties */ public int getAddress() { return Sys.getDirectBufferAddress(eaxListenerProperties); } /** * Retrieves the size of the containing ByteBuffer */ public int getSize() { return EAXLISTENERPROPERTIES_SIZE; } /** * Retrieves the size of the EAXLISTENERPROPERTIES */ protected static native int sizeOfEaxListenerProperties(); /** * Sets the offsets to the fields */ protected static native void assignOffsets(); } Index: BaseEAXConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BaseEAXConstants.java 2 Sep 2002 13:07:48 -0000 1.1 +++ BaseEAXConstants.java 2 Sep 2002 22:06:12 -0000 1.2 @@ -40,5 +40,273 @@ * @version $Revision$ */ public interface BaseEAXConstants { - //add some... + public static final int DSPROPERTY_EAXLISTENER_NONE = 0; + public static final int DSPROPERTY_EAXLISTENER_ALLPARAMETERS = 1; + public static final int DSPROPERTY_EAXLISTENER_ROOM = 2; + public static final int DSPROPERTY_EAXLISTENER_ROOMHF = 3; + public static final int DSPROPERTY_EAXLISTENER_ROOMROLLOFFFACTOR = 4; + public static final int DSPROPERTY_EAXLISTENER_DECAYTIME = 5; + public static final int DSPROPERTY_EAXLISTENER_DECAYHFRATIO = 6; + public static final int DSPROPERTY_EAXLISTENER_REFLECTIONS = 7; + public static final int DSPROPERTY_EAXLISTENER_REFLECTIONSDELAY = 8; + public static final int DSPROPERTY_EAXLISTENER_REVERB = 9; + public static final int DSPROPERTY_EAXLISTENER_REVERBDELAY = 10; + public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENT = 11; + public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENTSIZE = 12; + public static final int DSPROPERTY_EAXLISTENER_ENVIRONMENTDIFFUSION = 13; + public static final int DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF = 14; + public static final int DSPROPERTY_EAXLISTENER_FLAGS = 15; + + /** changes take effect immediately */ + public static final int DSPROPERTY_EAXLISTENER_IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int DSPROPERTY_EAXLISTENER_DEFERRED = 0x80000000; + + public static final int DSPROPERTY_EAXLISTENER_COMMITDEFERREDSETTINGS = + (DSPROPERTY_EAXLISTENER_NONE | + DSPROPERTY_EAXLISTENER_IMMEDIATE); + + public static final int ENVIRONMENT_GENERIC = 0; + public static final int ENVIRONMENT_PADDEDCELL = 1; + public static final int ENVIRONMENT_ROOM = 2; + public static final int ENVIRONMENT_BATHROOM = 3; + public static final int ENVIRONMENT_LIVINGROOM = 4; + public static final int ENVIRONMENT_STONEROOM = 5; + public static final int ENVIRONMENT_AUDITORIUM = 6; + public static final int ENVIRONMENT_CONCERTHALL = 7; + public static final int ENVIRONMENT_CAVE = 8; + public static final int ENVIRONMENT_ARENA = 9; + public static final int ENVIRONMENT_HANGAR = 10; + public static final int ENVIRONMENT_CARPETEDHALLWAY = 11; + public static final int ENVIRONMENT_HALLWAY = 12; + public static final int ENVIRONMENT_STONECORRIDOR = 13; + public static final int ENVIRONMENT_ALLEY = 14; + public static final int ENVIRONMENT_FOREST = 15; + public static final int ENVIRONMENT_CITY = 16; + public static final int ENVIRONMENT_MOUNTAINS = 17; + public static final int ENVIRONMENT_QUARRY = 18; + public static final int ENVIRONMENT_PLAIN = 19; + public static final int ENVIRONMENT_PARKINGLOT = 20; + public static final int ENVIRONMENT_SEWERPIPE = 21; + public static final int ENVIRONMENT_UNDERWATER = 22; + public static final int ENVIRONMENT_DRUGGED = 23; + public static final int ENVIRONMENT_DIZZY = 24; + public static final int ENVIRONMENT_PSYCHOTIC = 25; + public static final int ENVIRONMENT_COUNT = 26; + + /** reverberation decay time */ + public static final int EAXLISTENERFLAGS_DECAYTIMESCALE = 0x00000001; + + /** reflection level */ + public static final int EAXLISTENERFLAGS_REFLECTIONSSCALE = 0x00000002; + + /** initial reflection delay time */ + public static final int EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE = 0x00000004; + + /** reflections level */ + public static final int EAXLISTENERFLAGS_REVERBSCALE = 0x00000008; + + /** late reverberation delay time */ + public static final int EAXLISTENERFLAGS_REVERBDELAYSCALE = 0x00000010; + + /** This flag limits high-frequency decay time according to air absorption. */ + public static final int EAXLISTENERFLAGS_DECAYHFLIMIT = 0x00000020; + + /** reserved future use */ + public static final int EAXLISTENERFLAGS_RESERVED = 0xFFFFFFC0; + + // property ranges and defaults: + public static final int EAXLISTENER_MINROOM = -10000; + public static final int EAXLISTENER_MAXROOM = 0; + public static final int EAXLISTENER_DEFAULTROOM = -1000; + + public static final int EAXLISTENER_MINROOMHF = -10000; + public static final int EAXLISTENER_MAXROOMHF = 0; + public static final int EAXLISTENER_DEFAULTROOMHF = -100; + + public static final float EAXLISTENER_MINROOMROLLOFFFACTOR = 0.0f; + public static final float EAXLISTENER_MAXROOMROLLOFFFACTOR = 10.0f; + public static final float EAXLISTENER_DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final float EAXLISTENER_MINDECAYTIME = 0.1f; + public static final float EAXLISTENER_MAXDECAYTIME = 20.0f; + public static final float EAXLISTENER_DEFAULTDECAYTIME = 1.49f; + + public static final float EAXLISTENER_MINDECAYHFRATIO = 0.1f; + public static final float EAXLISTENER_MAXDECAYHFRATIO = 2.0f; + public static final float EAXLISTENER_DEFAULTDECAYHFRATIO = 0.83f; + + public static final int EAXLISTENER_MINREFLECTIONS = -10000; + public static final int EAXLISTENER_MAXREFLECTIONS = 1000; + public static final int EAXLISTENER_DEFAULTREFLECTIONS = -2602; + + public static final float EAXLISTENER_MINREFLECTIONSDELAY = 0.0f; + public static final float EAXLISTENER_MAXREFLECTIONSDELAY = 0.3f; + public static final float EAXLISTENER_DEFAULTREFLECTIONSDELAY = 0.007f; + + public static final int EAXLISTENER_MINREVERB = -10000; + public static final int EAXLISTENER_MAXREVERB = 2000; + public static final int EAXLISTENER_DEFAULTREVERB = 200; + + public static final float EAXLISTENER_MINREVERBDELAY = 0.0f; + public static final float EAXLISTENER_MAXREVERBDELAY = 0.1f; + public static final float EAXLISTENER_DEFAULTREVERBDELAY = 0.011f; + + public static final int EAXLISTENER_MINENVIRONMENT = 0; + public static final int EAXLISTENER_MAXENVIRONMENT = (ENVIRONMENT_COUNT-1); + public static final int EAXLISTENER_DEFAULTENVIRONMENT = ENVIRONMENT_GENERIC; + + public static final float EAXLISTENER_MINENVIRONMENTSIZE = 1.0f; + public static final float EAXLISTENER_MAXENVIRONMENTSIZE = 100.0f; + public static final float EAXLISTENER_DEFAULTENVIRONMENTSIZE = 7.5f; + + public static final float EAXLISTENER_MINENVIRONMENTDIFFUSION = 0.0f; + public static final float EAXLISTENER_MAXENVIRONMENTDIFFUSION = 1.0f; + public static final float EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION = 1.0f; + + public static final float EAXLISTENER_MINAIRABSORPTIONHF = -100.0f; + public static final float EAXLISTENER_MAXAIRABSORPTIONHF = 0.0f; + public static final float EAXLISTENER_DEFAULTAIRABSORPTIONHF = -5.0f; + + public static final int EAXLISTENER_DEFAULTFLAGS = + (EAXLISTENERFLAGS_DECAYTIMESCALE | + EAXLISTENERFLAGS_REFLECTIONSSCALE | + EAXLISTENERFLAGS_REFLECTIONSDELAYSCALE | + EAXLISTENERFLAGS_REVERBSCALE | + EAXLISTENERFLAGS_REVERBDELAYSCALE | + EAXLISTENERFLAGS_DECAYHFLIMIT); + + //------------------------------------ + public static final int DSPROPERTY_EAXBUFFER_NONE = 0; + public static final int DSPROPERTY_EAXBUFFER_ALLPARAMETERS = 1; + public static final int DSPROPERTY_EAXBUFFER_DIRECT = 2; + public static final int DSPROPERTY_EAXBUFFER_DIRECTHF = 3; + public static final int DSPROPERTY_EAXBUFFER_ROOM = 4; + public static final int DSPROPERTY_EAXBUFFER_ROOMHF = 5; + public static final int DSPROPERTY_EAXBUFFER_ROOMROLLOFFFACTOR = 6; + public static final int DSPROPERTY_EAXBUFFER_OBSTRUCTION = 7; + public static final int DSPROPERTY_EAXBUFFER_OBSTRUCTIONLFRATIO = 8; + public static final int DSPROPERTY_EAXBUFFER_OCCLUSION = 9; + public static final int DSPROPERTY_EAXBUFFER_OCCLUSIONLFRATIO = 10; + public static final int DSPROPERTY_EAXBUFFER_OCCLUSIONROOMRATIO = 11; + public static final int DSPROPERTY_EAXBUFFER_OUTSIDEVOLUMEHF = 12; + public static final int DSPROPERTY_EAXBUFFER_AIRABSORPTIONFACTOR = 13; + public static final int DSPROPERTY_EAXBUFFER_FLAGS = 14; + + /** changes take effect immediately */ + public static final int DSPROPERTY_EAXBUFFER_IMMEDIATE = 0x00000000; + + /** changes take effect later */ + public static final int DSPROPERTY_EAXBUFFER_DEFERRED = 0x80000000; + public static final int DSPROPERTY_EAXBUFFER_COMMITDEFERREDSETTINGS = + (DSPROPERTY_EAXBUFFER_NONE | + DSPROPERTY_EAXBUFFER_IMMEDIATE); + + /** affects DSPROPERTY_EAXBUFFER_DIRECTHF */ + public static final int EAXBUFFERFLAGS_DIRECTHFAUTO = 0x00000001; + + /** affects DSPROPERTY_EAXBUFFER_ROOM */ + public static final int EAXBUFFERFLAGS_ROOMAUTO = 0x00000002; + + /** affects DSPROPERTY_EAXBUFFER_ROOMHF */ + public static final int EAXBUFFERFLAGS_ROOMHFAUTO = 0x00000004; + + /** reserved future use */ + public static final int EAXBUFFERFLAGS_RESERVED = 0xFFFFFFF8; + + // property ranges and defaults: + + public static final int EAXBUFFER_MINDIRECT = -10000; + public static final int EAXBUFFER_MAXDIRECT = 1000; + public static final int EAXBUFFER_DEFAULTDIRECT = 0; + + public static final int EAXBUFFER_MINDIRECTHF = -10000; + public static final int EAXBUFFER_MAXDIRECTHF = 0; + public static final int EAXBUFFER_DEFAULTDIRECTHF = 0; + + public static final int EAXBUFFER_MINROOM = -10000; + public static final int EAXBUFFER_MAXROOM = 1000; + public static final int EAXBUFFER_DEFAULTROOM = 0; + + public static final int EAXBUFFER_MINROOMHF = -10000; + public static final int EAXBUFFER_MAXROOMHF = 0; + public static final int EAXBUFFER_DEFAULTROOMHF = 0; + + public static final float EAXBUFFER_MINROOMROLLOFFFACTOR = 0.0f; + public static final float EAXBUFFER_MAXROOMROLLOFFFACTOR = 10.f; + public static final float EAXBUFFER_DEFAULTROOMROLLOFFFACTOR = 0.0f; + + public static final int EAXBUFFER_MINOBSTRUCTION = -10000; + public static final int EAXBUFFER_MAXOBSTRUCTION = 0; + public static final int EAXBUFFER_DEFAULTOBSTRUCTION = 0; + + public static final float EAXBUFFER_MINOBSTRUCTIONLFRATIO = 0.0f; + public static final float EAXBUFFER_MAXOBSTRUCTIONLFRATIO = 1.0f; + public static final float EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO = 0.0f; + + public static final int EAXBUFFER_MINOCCLUSION = -10000; + public static final int EAXBUFFER_MAXOCCLUSION = 0; + public static final int EAXBUFFER_DEFAULTOCCLUSION = 0; + + public static final float EAXBUFFER_MINOCCLUSIONLFRATIO = 0.0f; + public static final float EAXBUFFER_MAXOCCLUSIONLFRATIO = 1.0f; + public static final float EAXBUFFER_DEFAULTOCCLUSIONLFRATIO = 0.25f; + + public static final float EAXBUFFER_MINOCCLUSIONROOMRATIO = 0.0f; + public static final float EAXBUFFER_MAXOCCLUSIONROOMRATIO = 10.0f; + public static final float EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO = 0.5f; + + public static final int EAXBUFFER_MINOUTSIDEVOLUMEHF = -10000; + public static final int EAXBUFFER_MAXOUTSIDEVOLUMEHF = 0; + public static final int EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF = 0; + + public static final float EAXBUFFER_MINAIRABSORPTIONFACTOR = 0.0f; + public static final float EAXBUFFER_MAXAIRABSORPTIONFACTOR = 10.0f; + public static final float EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR = 1.0f; + + public static final int EAXBUFFER_DEFAULTFLAGS = + (EAXBUFFERFLAGS_DIRECTHFAUTO | + EAXBUFFERFLAGS_ROOMAUTO | + EAXBUFFERFLAGS_ROOMHFAUTO); + + // Single window material preset + public static final int MATERIAL_SINGLEWINDOW = -2800; + public static final float MATERIAL_SINGLEWINDOWLF = 0.71f; + public static final float MATERIAL_SINGLEWINDOWROOMRATIO = 0.43f; + + // Double window material preset + public static final int MATERIAL_DOUBLEWINDOW = -5000; + public static final float MATERIAL_DOUBLEWINDOWHF = 0.40f; + public static final float MATERIAL_DOUBLEWINDOWROOMRATIO = 0.24f; + + // Thin door material preset + public static final int MATERIAL_THINDOOR = -1800; + public static final float MATERIAL_THINDOORLF = 0.66f; + public static final float MATERIAL_THINDOORROOMRATIO = 0.66f; + + // Thick door material preset + public static final int MATERIAL_THICKDOOR = -4400; + public static final float MATERIAL_THICKDOORLF = 0.64f; + public static final float MATERIAL_THICKDOORROOMRTATION = 0.27f; + + // Wood wall material preset + public static final int MATERIAL_WOODWALL = -4000; + public static final float MATERIAL_WOODWALLLF = 0.50f; + public static final float MATERIAL_WOODWALLROOMRATIO = 0.30f; + + // Brick wall material preset + public static final int MATERIAL_BRICKWALL = -5000; + public static final float MATERIAL_BRICKWALLLF = 0.60f; + public static final float MATERIAL_BRICKWALLROOMRATIO = 0.24f; + + // Stone wall material preset + public static final int MATERIAL_STONEWALL = -6000; + public static final float MATERIAL_STONEWALLLF = 0.68f; + public static final float MATERIAL_STONEWALLROOMRATIO = 0.20f; + + // Curtain material preset + public static final int MATERIAL_CURTAIN = -1200; + public static final float MATERIAL_CURTAINLF = 0.15f; + public static final float MATERIAL_CURTAINROOMRATIO = 1.00f; } |
From: Brian M. <ma...@us...> - 2002-09-02 18:01:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv22703/org/lwjgl/openal Modified Files: ALConstants.java Log Message: mod: AL shouldn't have EAX constants Index: ALConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALConstants.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ALConstants.java 30 Aug 2002 21:29:23 -0000 1.3 +++ ALConstants.java 2 Sep 2002 18:01:31 -0000 1.4 @@ -29,7 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; /** * $Id$ @@ -39,5 +39,5 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -public interface ALConstants extends BaseALConstants, BaseEAXConstants { +public interface ALConstants extends BaseALConstants { } |
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv22483 Added Files: org_lwjgl_opengl_eax_BaseEAX.cpp org_lwjgl_opengl_eax_CoreEAX.cpp Removed Files: org_lwjgl_opengl_BaseEAX.cpp org_lwjgl_opengl_CoreEAX.cpp Log Message: mod: moving to eax subpackage --- NEW FILE: org_lwjgl_opengl_eax_BaseEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_BaseEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_BaseEAX.h" /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nDestroy (JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_opengl_eax_CoreEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_eax_CoreEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_eax_CoreEAX.cpp,v 1.1 2002/09/02 13:22:09 matzon Exp $ * * This is the actual JNI implementation of the OpenAL EAX library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_eax_CoreEAX.h" #include "checkALerror.h" #include "extal.h" /** * Throws an OAL exception with the specified message */ void ThrowException(JNIEnv *env, const char* message) { jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); env->ThrowNew(cls, message); } /* * Determines available EAX extensions */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; ALCcontext *Context; ALCdevice *Device; //open device Device = alcOpenDevice(NULL); if(Device == NULL) { ThrowException(env, "Unable to determine EAX Extensions"); return; } //create a context Context = alcCreateContext(Device, NULL); if(Context == NULL) { alcCloseDevice(Device); ThrowException(env, "Unable to determine EAX Extensions"); return; } //make current alcMakeContextCurrent(Context); if(alGetError() != AL_NO_ERROR) { alcCloseDevice(Device); ThrowException(env, "Unable to determine EAX Extensions"); return; } //check for extension, and assign if available if(alIsExtensionPresent((ALubyte*) "EAX")) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); } //clean up alcMakeContextCurrent(NULL); alcDestroyContext(Context); alcCloseDevice(Device); //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); } #else ThrowException(env, "EAX extensions not supported"); #endif } JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID (JNIEnv *env, jobject obj) { #ifdef _WIN32 //get class/fields jclass eax_class = env->FindClass("org/lwjgl/openal/eax/CoreEAX"); jfieldID eaxBuffer_field = env->GetStaticFieldID(eax_class, "BUFFER_GUID", "I"); jfieldID eaxListener_field = env->GetStaticFieldID(eax_class, "LISTENER_GUID", "I"); //set fields env->SetStaticIntField(eax_class, eaxBuffer_field, (jint) &DSPROPSETID_EAX20_BufferProperties); env->SetStaticIntField(eax_class, eaxListener_field, (jint) &DSPROPSETID_EAX20_ListenerProperties); #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function retrieves an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } /* * This function sets an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifndef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } --- org_lwjgl_opengl_BaseEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseEAX.cpp --- org_lwjgl_opengl_CoreEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreEAX.cpp |
From: Brian M. <ma...@us...> - 2002-09-02 13:21:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv22263 Added Files: org_lwjgl_openal_eax_BaseEAX.h org_lwjgl_openal_eax_CoreEAX.h Removed Files: org_lwjgl_openal_BaseEAX.h org_lwjgl_openal_CoreEAX.h Log Message: mod: moving to eax subpackage --- NEW FILE: org_lwjgl_openal_eax_BaseEAX.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_BaseEAX.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_eax_BaseEAX */ #ifndef _Included_org_lwjgl_openal_eax_BaseEAX #define _Included_org_lwjgl_openal_eax_BaseEAX #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: BUFFER_GUID */ /* Inaccessible static: LISTENER_GUID */ /* Inaccessible static: created */ /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nCreate (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nDestroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif --- NEW FILE: org_lwjgl_openal_eax_CoreEAX.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_eax_CoreEAX */ #ifndef _Included_org_lwjgl_openal_eax_CoreEAX #define _Included_org_lwjgl_openal_eax_CoreEAX #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: BUFFER_GUID */ /* Inaccessible static: LISTENER_GUID */ /* Inaccessible static: created */ /* * Class: org_lwjgl_openal_eax_CoreEAX * Method: determineAvailableExtensions * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_eax_CoreEAX * Method: setGUID * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_eax_CoreEAX * Method: eaxGet * Signature: (IIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet (JNIEnv *, jobject, jint, jint, jint, jint, jint); /* * Class: org_lwjgl_openal_eax_CoreEAX * Method: eaxSet * Signature: (IIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *, jobject, jint, jint, jint, jint, jint); #ifdef __cplusplus } #endif #endif --- org_lwjgl_openal_BaseEAX.h DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseEAX.h --- org_lwjgl_openal_CoreEAX.h DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreEAX.h |
From: Brian M. <ma...@us...> - 2002-09-02 13:09:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv18242/org/lwjgl/openal/test Modified Files: EAXTest.java Log Message: fix: updated to reflect moving of EAX stuff to eax subpackage Index: EAXTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/EAXTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/EAXTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- EAXTest.java 30 Aug 2002 22:15:57 -0000 1.2 +++ EAXTest.java 2 Sep 2002 13:09:20 -0000 1.3 @@ -31,7 +31,7 @@ */ package org.lwjgl.openal.test; -import org.lwjgl.openal.EAX; +import org.lwjgl.openal.eax.EAX; /** * $Id$ |
From: Brian M. <ma...@us...> - 2002-09-02 13:07:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory usw-pr-cvs1:/tmp/cvs-serv17766/org/lwjgl/openal/eax Added Files: BaseEAX.java BaseEAXConstants.java CoreEAX.java EAX.java Log Message: mod: moved to eax subpackage --- NEW FILE: BaseEAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAX.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; /** * $Id: BaseEAX.java,v 1.1 2002/09/02 13:07:48 matzon Exp $ * * The base OpenAL EAX functionality. * * This has been provided as a base class that we can use for either the * full EAX specification or as a cut-down OpenAL EAX embedded spec. (aka * a mini-driver). * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public abstract class BaseEAX { /** Has the EAX object been created? */ protected static boolean created; static { initialize(); } /** * Override to provide any initialization code after creation. */ protected void init() { } /** * Static initialization */ private static void initialize() { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } /** * Loads the EAX functions * * @throws Exception if the EAX extensions couldn't be loaded */ public void create() throws Exception { if (created) { return; } if (!nCreate()) { throw new Exception("EAX instance could not be created."); } created = true; init(); } /** * Native method to create EAX instance * * @return true if the EAX extensions could be found */ protected native boolean nCreate(); /** * "Destroy" the EAX object */ public void destroy() { if (!created) { return; } created = false; nDestroy(); } /** * Native method the destroy the EAX */ protected native void nDestroy(); } --- NEW FILE: BaseEAXConstants.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAXConstants.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; /** * $Id: BaseEAXConstants.java,v 1.1 2002/09/02 13:07:48 matzon Exp $ * * This class implements the basic EAX extension constants. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface BaseEAXConstants { //add some... } --- NEW FILE: CoreEAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/CoreEAX.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; /** * $Id: CoreEAX.java,v 1.1 2002/09/02 13:07:48 matzon Exp $ * * This is the OpenAL EAX class. It extends the latest core. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class CoreEAX extends BaseEAX implements BaseEAXConstants { /** GUID for buffer */ public static int BUFFER_GUID; /** GUID for listener */ public static int LISTENER_GUID; /** Creates a new instance of CoreEAX */ public CoreEAX() { } /** * Load extensions */ protected void init() { determineAvailableExtensions(); setGUID(); } /** * Determines available EAX extensions */ protected native void determineAvailableExtensions(); /** * Sets the GUID's for the buffer and listener objects */ protected native void setGUID(); /** * Retrieves an EAX Value * * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) * @param property property being queried * @param source the source to be queried * @param data address to write value to * @param size size of area being written to * @return OpenAL Error code */ public native int eaxGet(int propertySetID, int property, int source, int data, int size); /** * Sets an EAX Value * * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) * @param property property being queried * @param source the source to be queried * @param data address to write value to * @param size size of area being written to * @return OpenAL Error code */ public native int eaxSet(int propertySetID, int property, int source, int data, int size); } --- NEW FILE: EAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/EAX.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal.eax; /** * $Id: EAX.java,v 1.1 2002/09/02 13:07:48 matzon Exp $ * * This is the OpenAL EAX class. It extends the latest core. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAX extends CoreEAX { /** * Nothing to se here - please move along */ public EAX() { } } |
From: Brian M. <ma...@us...> - 2002-09-02 13:07:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv17766/org/lwjgl/openal Removed Files: BaseEAX.java BaseEAXConstants.java CoreEAX.java EAX.java Log Message: mod: moved to eax subpackage --- BaseEAX.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAX.java --- BaseEAXConstants.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAXConstants.java --- CoreEAX.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreEAX.java --- EAX.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/EAX.java |
From: Brian M. <ma...@us...> - 2002-09-02 13:05:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory usw-pr-cvs1:/tmp/cvs-serv17255/eax Log Message: Directory /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax added to the repository |
From: Brian M. <ma...@us...> - 2002-09-02 09:52:03
|
Update of /cvsroot/java-game-lib/LWJGL/doc In directory usw-pr-cvs1:/tmp/cvs-serv24088 Added Files: CREDITS LICENSE Log Message: initial commit --- NEW FILE: CREDITS --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/CREDITS The following people have helped to make this project what it is today: - Caspian Rychlik-Prince <cp...@sh...> - Brian Matzon <br...@ma...> - Niels Jørgensen <nj...@ni...> - Tristan Campbell <tr...@ha...> additional credits goes to: - Joseph I. Valenzuela [OpenAL] - Lev Povalahev [OpenGL Extensions] --- NEW FILE: LICENSE --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/LICENSE /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |