You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
(2) |
|
4
|
5
(2) |
6
(5) |
7
|
8
(7) |
9
(1) |
10
|
|
11
|
12
(4) |
13
|
14
|
15
|
16
|
17
|
|
18
|
19
|
20
(36) |
21
(5) |
22
|
23
|
24
|
|
25
|
26
(8) |
27
(1) |
28
(4) |
29
|
30
(25) |
31
(19) |
|
From: Brian M. <ma...@us...> - 2004-01-12 17:18:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv24805 Modified Files: org_lwjgl_input_Controller.cpp Log Message: assert that Window has been created Index: org_lwjgl_input_Controller.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Controller.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_input_Controller.cpp 20 Dec 2003 22:03:25 -0000 1.18 +++ org_lwjgl_input_Controller.cpp 12 Jan 2004 17:15:41 -0000 1.19 @@ -116,6 +116,13 @@ * Called when the Controller instance is to be created */ JNIEXPORT void JNICALL Java_org_lwjgl_input_Controller_nCreate(JNIEnv *env, jclass clazz) { + + // assert that window has been created + if(hwnd == NULL) { + throwException(env, "Please create the window before initializing input devices\n"); + return; + } + // Create the DirectInput object. HRESULT hr; hr = DirectInputCreate(dll_handle, DIRECTINPUT_VERSION, &cDI, NULL); |
|
From: Brian M. <ma...@us...> - 2004-01-12 16:28:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv13728 Modified Files: org_lwjgl_input_Mouse.cpp Log Message: assert that Direct Input has been created Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- org_lwjgl_input_Mouse.cpp 20 Dec 2003 22:03:25 -0000 1.42 +++ org_lwjgl_input_Mouse.cpp 12 Jan 2004 16:28:51 -0000 1.43 @@ -108,6 +108,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Mouse_nCreate(JNIEnv *env, jclass clazz) { HRESULT hr; + // assert that Direct Input has been created + if(lpdi == NULL) { + throwException(env, "Please create the window before initializing input devices\n"); + return; + } + ShowCursor(FALSE); CacheMouseFields(env, clazz); |
|
From: Brian M. <ma...@us...> - 2004-01-09 00:03:52
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv13512 Modified Files: PlayTest.java PlayTestMemory.java Log Message: -1 for file size in ogg vorbis Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PlayTest.java 8 Jan 2004 23:23:01 -0000 1.11 +++ PlayTest.java 9 Jan 2004 00:03:49 -0000 1.12 @@ -103,7 +103,7 @@ ByteBuffer filebuffer = getData(args[0]); // pass directly to buffer data - AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, filebuffer.capacity(), -1); + AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, -1, -1); filebuffer.clear(); } else { // load wave data from buffer Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- PlayTestMemory.java 8 Jan 2004 23:23:01 -0000 1.11 +++ PlayTestMemory.java 9 Jan 2004 00:03:49 -0000 1.12 @@ -111,7 +111,7 @@ //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); if(usingVorbis) { // pass directly to buffer data - AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, filebuffer.capacity(), -1); + AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, -1, -1); filebuffer.clear(); } else { // load wave data from buffer |
|
From: Brian M. <ma...@us...> - 2004-01-08 23:23:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv5232 Modified Files: PlayTest.java PlayTestMemory.java Log Message: support for ogg vorbis files Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PlayTest.java 17 Aug 2003 16:58:18 -0000 1.10 +++ PlayTest.java 8 Jan 2004 23:23:01 -0000 1.11 @@ -33,7 +33,11 @@ import org.lwjgl.openal.AL; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.nio.ByteOrder; import java.nio.IntBuffer; +import java.nio.ByteBuffer; /** * $Id$ @@ -46,6 +50,8 @@ */ public class PlayTest extends BasicTest { + private boolean usingVorbis; + /** * Creates an instance of PlayTest */ @@ -60,6 +66,18 @@ if(args.length < 1) { System.out.println("no argument supplied, assuming Footsteps.wav"); args = new String[] {"Footsteps.wav"}; + } + + if(args[0].endsWith(".ogg")) { + System.out.print("Attempting to load Ogg Vorbis file, checking for extension..."); + if(AL.alIsExtensionPresent("AL_EXT_vorbis")) { + System.out.println("found"); + usingVorbis = true; + } else { + System.out.println("not supported"); + alExit(); + System.exit(-1); + } } int lastError; @@ -81,18 +99,27 @@ exit(lastError); } - //load wave data - WaveData wavefile = WaveData.create(args[0]); + if(usingVorbis) { + ByteBuffer filebuffer = getData(args[0]); + + // pass directly to buffer data + AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, filebuffer.capacity(), -1); + filebuffer.clear(); + } else { + // load wave data from buffer + WaveData wavefile = WaveData.create(args[0]); + + //copy to buffers + AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); + + //unload file again + wavefile.dispose(); + } - //copy to buffers - AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - - //unload file again - wavefile.dispose(); - + //set up source input AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { @@ -141,6 +168,43 @@ //shutdown alExit(); } + + /** + * Reads the file into a ByteBuffer + * + * @param filename Name of file to load + * @return ByteBuffer containing file data + */ + protected ByteBuffer getData(String filename) { + ByteBuffer buffer = null; + + System.out.println("Attempting to load: " + filename); + + try { + BufferedInputStream bis = new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filename)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + int bufferLength = 4096; + byte[] readBuffer = new byte[bufferLength]; + int read = -1; + + while((read = bis.read(readBuffer, 0, bufferLength)) != -1) { + baos.write(readBuffer, 0, read); + } + + //done reading, close + bis.close(); + + // if ogg vorbis data, we need to pass it unmodified to alBufferData + buffer = ByteBuffer.allocateDirect(baos.size()); + buffer.order(ByteOrder.nativeOrder()); + buffer.put(baos.toByteArray()); + buffer.rewind(); + } catch (Exception ioe) { + ioe.printStackTrace(); + } + return buffer; + } /** * main entry point Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- PlayTestMemory.java 17 Aug 2003 16:58:18 -0000 1.10 +++ PlayTestMemory.java 8 Jan 2004 23:23:01 -0000 1.11 @@ -50,6 +50,8 @@ */ public class PlayTestMemory extends BasicTest { + private boolean usingVorbis; + /** * Creates an instance of PlayTestMemory */ @@ -66,6 +68,18 @@ args = new String[] {"Footsteps.wav"}; } + if(args[0].endsWith(".ogg")) { + System.out.print("Attempting to load Ogg Vorbis file, checking for extension..."); + if(AL.alIsExtensionPresent("AL_EXT_vorbis")) { + System.out.println("found"); + usingVorbis = true; + } else { + System.out.println("not supported"); + alExit(); + System.exit(-1); + } + } + int lastError; //create 1 buffer and 1 source @@ -92,18 +106,29 @@ System.exit(-1); } + System.out.println("loaded " + filebuffer.capacity()); + //ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); - WaveData wavefile = WaveData.create(filebuffer.array()); + if(usingVorbis) { + // pass directly to buffer data + AL.alBufferData(buffers.get(0), AL.AL_FORMAT_VORBIS_EXT, filebuffer, filebuffer.capacity(), -1); + filebuffer.clear(); + } else { + // load wave data from buffer + WaveData wavefile = WaveData.create(filebuffer.array()); + + //copy to buffers + AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); + //unload file again + wavefile.dispose(); + } - //copy to buffers - AL.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.data.capacity(), wavefile.samplerate); + // check for errors if((lastError = AL.alGetError()) != AL.AL_NO_ERROR) { exit(lastError); } - //unload file again - wavefile.dispose(); //set up source input AL.alSourcei(sources.get(0), AL.AL_BUFFER, buffers.get(0)); @@ -179,9 +204,15 @@ //done reading, close bis.close(); - buffer = ByteBuffer.allocate(baos.size()); + // if ogg vorbis data, we need to pass it unmodified to alBufferData + if(usingVorbis) { + buffer = ByteBuffer.allocateDirect(baos.size()); + } else { + buffer = ByteBuffer.allocate(baos.size()); + } buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); + buffer.rewind(); } catch (Exception ioe) { ioe.printStackTrace(); } |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:57:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv32099 Modified Files: BaseALConstants.java Log Message: vorbis extension Index: BaseALConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseALConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseALConstants.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- BaseALConstants.java 17 Aug 2003 16:38:56 -0000 1.9 +++ BaseALConstants.java 8 Jan 2004 22:56:59 -0000 1.10 @@ -230,6 +230,9 @@ /** Sound buffers: format specifier. */ public static final int AL_FORMAT_STEREO16 = 0x1103; + + /** Ogg Vorbis format specifier. */ + public static final int AL_FORMAT_VORBIS_EXT = 0x1110; /** * Sound buffers: frequency, in units of Hertz [Hz]. |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:45:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv29468 Modified Files: EAXTest.java Log Message: better error handling Index: EAXTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- EAXTest.java 6 Jan 2004 19:22:12 -0000 1.9 +++ EAXTest.java 8 Jan 2004 22:45:10 -0000 1.10 @@ -73,6 +73,12 @@ * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { + + if(!AL.isCreated()) { + System.out.println("Unable to continue with EAXTest, since OpenAL could not be initialized."); + return; + } + try { System.out.print("Testing EAX support..."); EAX.create(); @@ -81,13 +87,6 @@ System.out.println("not supported!"); } - try { - AL.create(); - AL.alGetError(); // clear any errors - } catch(Exception e) { - System.out.println("Unable to initialize OpenAL"); - } - // continue with test if EAX is supported if (EAX.isCreated() && AL.isCreated() && initialize()) { runTest(); @@ -102,8 +101,6 @@ //shutdown alExit(); - - System.out.println("test done."); } private boolean initialize() { |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:43:30
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv29030 Modified Files: BasicTest.java Log Message: don't destroy when not created better error message Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- BasicTest.java 27 Dec 2003 12:27:47 -0000 1.11 +++ BasicTest.java 8 Jan 2004 22:43:27 -0000 1.12 @@ -55,7 +55,7 @@ try { AL.create(); } catch (Exception e) { - e.printStackTrace(); + System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system."); return; } } @@ -64,7 +64,9 @@ * Shutdowns OpenAL */ protected void alExit() { - AL.destroy(); + if(AL.isCreated()) { + AL.destroy(); + } } /** |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:42:01
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory sc8-pr-cvs1:/tmp/cvs-serv28416 Modified Files: BaseEAX.java Log Message: created set too quickly Index: BaseEAX.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAX.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAX.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BaseEAX.java 6 Jan 2004 19:22:12 -0000 1.8 +++ BaseEAX.java 8 Jan 2004 22:41:55 -0000 1.9 @@ -72,9 +72,9 @@ if (!nCreate()) { throw new Exception("EAX instance could not be created."); } - created = true; CoreEAX.init(); - } + created = true; + } /** * Native method to create EAX instance |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:41:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv28220 Modified Files: AL.java Log Message: no destroy on !create Index: AL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- AL.java 27 Dec 2003 02:12:02 -0000 1.15 +++ AL.java 8 Jan 2004 22:41:22 -0000 1.16 @@ -124,6 +124,10 @@ * Exit cleanly by calling destroy. */ public static void destroy() { + if(!created) { + return; + } + ALC.alcDestroyContext(context.context); ALC.alcCloseDevice(device.device); ALC.destroy(); |
|
From: Brian M. <ma...@us...> - 2004-01-08 22:40:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv27893 Modified Files: org_lwjgl_openal_eax_CoreEAX.cpp Log Message: better compare Index: org_lwjgl_openal_eax_CoreEAX.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_openal_eax_CoreEAX.cpp 6 Jan 2004 19:22:12 -0000 1.8 +++ org_lwjgl_openal_eax_CoreEAX.cpp 8 Jan 2004 22:40:24 -0000 1.9 @@ -59,7 +59,7 @@ } //check for extension, and assign if available - if(alIsExtensionPresent((ALubyte*) "EAX")) { + if(alIsExtensionPresent((ALubyte*) "EAX") == AL_TRUE) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); |
|
From: Brian M. <ma...@us...> - 2004-01-06 20:00:54
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv15407 Modified Files: PositionTest.java Log Message: better handling of minimized mode Index: PositionTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PositionTest.java 27 Dec 2003 15:28:17 -0000 1.6 +++ PositionTest.java 6 Jan 2004 19:44:29 -0000 1.7 @@ -39,6 +39,9 @@ /** Whether the demo is done */ private boolean finished = false; + + /** Whether in pause mode */ + private boolean pauseMode = false; // OpenAL stuff // =================================================== @@ -243,30 +246,62 @@ while (!finished) { // handle any input handleInput(); - - // render the scene - render(); - + + // render and paint if !minimized and not dirty + if(!Window.isMinimized() || Window.isDirty()) { + render(); + Window.paint(); + } else { + // sleeeeeep + pause(100); + } + // allow window to process internal messages Window.update(); - // paint the content and flip buffer - Window.paint(); - + // act on pause mode + paused(Window.isMinimized()); + // start sound after first paint, since we don't want // the delay before something is painted on the screen - if (firstRun) { + if (firstRun && !pauseMode) { firstRun = false; // start sounds with delays - AL.alSourcePlay(soundSources.get(LEFT)); - pause(300); - AL.alSourcePlay(soundSources.get(CENTER)); - pause(500); - AL.alSourcePlay(soundSources.get(RIGHT)); + startSounds(); } } } + + /** + * Starts playing the sounds at different times + */ + private void startSounds() { + AL.alSourcePlay(soundSources.get(LEFT)); + pause(300); + AL.alSourcePlay(soundSources.get(CENTER)); + pause(500); + AL.alSourcePlay(soundSources.get(RIGHT)); + } + + /** + * Handles any changes in pause mode + * + * @param paused Which pause mode to enter + */ + private void paused(boolean paused) { + // if requesting pause, and not paused - pause and stop sound + if(paused && !pauseMode) { + pauseMode = true; + AL.alSourcePause(soundSources); + } + + // else go out of pause mode and start sounds + else if(!paused && pauseMode) { + pauseMode = false; + startSounds(); + } + } /** * Handles any input @@ -374,6 +409,7 @@ { GL.glRotatef(20.0f, 1.0f, 1.0f, 0.0f); + // left GL.glPushMatrix(); { GL.glTranslatef(leftPosition.get(0), leftPosition.get(1), leftPosition.get(2)); @@ -382,6 +418,7 @@ } GL.glPopMatrix(); + // center GL.glPushMatrix(); { GL.glTranslatef(centerPosition.get(0), centerPosition.get(1), centerPosition.get(2)); @@ -390,6 +427,7 @@ } GL.glPopMatrix(); + // right GL.glPushMatrix(); { GL.glTranslatef(rightPosition.get(0), rightPosition.get(1), rightPosition.get(2)); @@ -398,7 +436,7 @@ } GL.glPopMatrix(); - //the listener + // listener GL.glPushMatrix(); { GL.glTranslatef(listenerPosition.get(0), listenerPosition.get(1), listenerPosition.get(2)); |
|
From: Brian M. <ma...@us...> - 2004-01-06 20:00:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv15654 Modified Files: CoreAL.java Log Message: fixed small bug in alSourcePlay Index: CoreAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreAL.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- CoreAL.java 27 Dec 2003 02:10:56 -0000 1.24 +++ CoreAL.java 6 Jan 2004 19:45:32 -0000 1.25 @@ -495,7 +495,7 @@ * * @param sources array of sources to play */ - public static void alSourcePlay(int n, IntBuffer sources) { + public static void alSourcePlay(IntBuffer sources) { nalSourcePlayv(sources.remaining(), sources, sources.position()); } private static native void nalSourcePlayv(int n, IntBuffer sources, int offset); |
|
From: Brian M. <ma...@us...> - 2004-01-06 19:22:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax In directory sc8-pr-cvs1:/tmp/cvs-serv10107/java/org/lwjgl/openal/eax Modified Files: BaseEAX.java CoreEAX.java EAXBufferProperties.java EAXListenerProperties.java Log Message: New EAX model implemented - needs more testing Index: BaseEAX.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAX.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/BaseEAX.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- BaseEAX.java 17 Aug 2003 16:38:57 -0000 1.7 +++ BaseEAX.java 6 Jan 2004 19:22:12 -0000 1.8 @@ -53,12 +53,6 @@ } /** - * Override to provide any initialization code after creation. - */ - protected static void init() { - } - - /** * Static initialization */ private static void initialize() { @@ -79,7 +73,7 @@ throw new Exception("EAX instance could not be created."); } created = true; - init(); + CoreEAX.init(); } /** @@ -104,4 +98,11 @@ * Native method the destroy the EAX */ protected static native void nDestroy(); + + /** + * @return true if EAX has been created + */ + public static boolean isCreated() { + return created; + } } Index: CoreEAX.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/CoreEAX.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/eax/CoreEAX.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CoreEAX.java 17 Aug 2003 16:38:57 -0000 1.5 +++ CoreEAX.java 6 Jan 2004 19:22:12 -0000 1.6 @@ -44,17 +44,16 @@ public class CoreEAX extends BaseEAX implements BaseEAXConstants { /** GUID for buffer */ - public static int BUFFER_GUID; + public static final int BUFFER_GUID = 1; /** GUID for listener */ - public static int LISTENER_GUID; + public static final int LISTENER_GUID = 2; /** * Load extensions */ - protected static void init() { + protected static void init() { determineAvailableExtensions(); - setGUID(); } /** @@ -63,11 +62,6 @@ protected static native void determineAvailableExtensions(); /** - * Sets the GUID's for the buffer and listener objects - */ - protected static 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) @@ -77,7 +71,10 @@ * @param size size of area being written to * @return OpenAL Error code */ - public static native int eaxGet(int propertySetID, int property, int source, Buffer data, int size); + public static int eaxGet(int propertySetID, int property, int source, Buffer data, int size) { + return neaxGet(propertySetID, property, source, data, data.position(), size); + } + private static native int neaxGet(int propertySetID, int property, int source, Buffer data, int position, int size); /** * Sets an EAX Value @@ -89,5 +86,8 @@ * @param size size of area being written to * @return OpenAL Error code */ - public static native int eaxSet(int propertySetID, int property, int source, Buffer data, int size); + public static int eaxSet(int propertySetID, int property, int source, Buffer data, int size) { + return neaxSet(propertySetID, property, source, data, data.position(), size); + } + private static native int neaxSet(int propertySetID, int property, int source, Buffer data, int position, int size); } 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.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- EAXBufferProperties.java 17 Aug 2003 16:38:57 -0000 1.10 +++ EAXBufferProperties.java 6 Jan 2004 19:22:12 -0000 1.11 @@ -45,12 +45,21 @@ * @version $Revision$ */ public class EAXBufferProperties { + + /** Whether auto commit has been anabled */ + private boolean autoCommit = true; + + /** Current source being operated on */ + private int currentSource = -1; /** ByteBuffer representing EAXBUFFERPROPERTIES */ protected ByteBuffer eaxBufferProperties; /** size needed by ByteBuffer to contain EAXBUFFERPROPERTIES */ protected static int EAXBUFFERPROPERTIES_SIZE; + + // EAX values and offsets + // ======================================================== /** direct path level offset */ protected static int direct_offset; @@ -181,48 +190,193 @@ (EAXBUFFER_FLAGS_DIRECTHFAUTO | EAXBUFFER_FLAGS_ROOMAUTO | EAXBUFFER_FLAGS_ROOMHFAUTO); + + // ------------------------------------------------------- static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXBUFFERPROPERTIES_SIZE = sizeOfEaxBufferProperties(); assignOffsets(); } - + + /** + * Creates a new EAXBufferProperties object + */ public EAXBufferProperties() { eaxBufferProperties = ByteBuffer.allocateDirect(EAXBUFFERPROPERTIES_SIZE); eaxBufferProperties.order(ByteOrder.nativeOrder()); } - + /** - * Sets an EAX Value - * - * @param property property being queried - * @param source the source to be queried + * Sets the current source on which to perform effects + * + * @param source Source on which to perform effects */ - public void eaxSet(int property, int source) { - EAX.eaxSet( - CoreEAX.BUFFER_GUID, - property, - source, - eaxBufferProperties, - EAXBUFFERPROPERTIES_SIZE); + public void setCurrentSource(int source) { + currentSource = source; } - + /** - * Sets an EAX Value - * - * @param property property being queried - * @param source the source to be queried + * Retrieves the current source + * + * @return Source on which effects are being performed */ - public void eaxGet(int property, int source) { + public int getCurrentSource() { + return currentSource; + } + + /** + * Loads current EAX values from current source + */ + public void loadEAXValues() { EAX.eaxGet( - CoreEAX.BUFFER_GUID, - property, - source, - eaxBufferProperties, - EAXBUFFERPROPERTIES_SIZE); + CoreEAX.BUFFER_GUID, + EAXBUFFER_ALLPARAMETERS, + currentSource, + eaxBufferProperties, + EAXBUFFERPROPERTIES_SIZE); } + + /** + * Resets this buffer property to default values + */ + public void reset() { + boolean commitValue = autoCommit; + + // disable autocommit + autoCommit = false; + + // set values + setDirect(EAXBUFFER_DEFAULTDIRECT); + setDirectHF(EAXBUFFER_DEFAULTDIRECTHF); + setRoom(EAXBUFFER_DEFAULTROOM); + setRoomHF(EAXBUFFER_DEFAULTROOMHF); + setRoomRolloffFactor(EAXBUFFER_DEFAULTROOMROLLOFFFACTOR); + setObstruction(EAXBUFFER_DEFAULTOBSTRUCTION); + setObstructionLFRatio(EAXBUFFER_DEFAULTOBSTRUCTIONLFRATIO); + setOcclusion(EAXBUFFER_DEFAULTOCCLUSION); + setOcclusionLFRatio(EAXBUFFER_DEFAULTOCCLUSIONLFRATIO); + setOcclusionRoomRatio(EAXBUFFER_DEFAULTOCCLUSIONROOMRATIO); + setOutsideVolumeHF(EAXBUFFER_DEFAULTOUTSIDEVOLUMEHF); + setAirAbsorptionFactor(EAXBUFFER_DEFAULTAIRABSORPTIONFACTOR); + setFlags(EAXBUFFER_DEFAULTFLAGS); + + // reset auto commit + autoCommit = commitValue; + } + + + /** + * Commits any changes + */ + public void commit() { + // call eaxSet with Buffer guid, setting all parameters + EAX.eaxSet( + CoreEAX.BUFFER_GUID, EAXBUFFER_ALLPARAMETERS, + currentSource, eaxBufferProperties, EAXBUFFERPROPERTIES_SIZE); + } + + /** + * Tests whether auto commit is enabled or not + * + * @return true if auto commit is inabled + */ + public boolean isAutoCommitEnabled() { + return autoCommit; + } + + /** + * Enabled or disables auto commit + * + * @param enabled True to enable, false to disable + */ + public void setAutoCommit(boolean enabled) { + autoCommit = enabled; + } + + /** + * Performs auto commit, if enabled + */ + private final void autoCommit() { + if(autoCommit) { + commit(); + } + } + + /** + * Retrieves the size of the containing ByteBuffer + */ + public static int getSize() { + return EAXBUFFERPROPERTIES_SIZE; + } + + /** + * Returns a String representation of the EAXBufferProperties object + * + * @return String representation of the EAXBufferProperties object + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("EAXBufferProperties ["); + + sb.append("lDirect = "); + sb.append(getDirect()); + sb.append(", "); + + sb.append("lDirectHF = "); + sb.append(getDirectHF()); + sb.append(", "); + + sb.append("lRoom = "); + sb.append(getRoom()); + sb.append(", "); + + sb.append("lRoomHF = "); + sb.append(getRoomHF()); + sb.append(", "); + + sb.append("flRoomRolloffFactor = "); + sb.append(getRoomRolloffFactor()); + sb.append(", "); + + sb.append("lObstruction = "); + sb.append(getObstruction()); + sb.append(", "); + + sb.append("flObstructionLFRatio = "); + sb.append(getObstructionLFRatio()); + sb.append(", "); + + sb.append("lOcclusion = "); + sb.append(getOcclusion()); + sb.append(", "); + + sb.append("flOcclusionLFRatio = "); + sb.append(getOcclusionLFRatio()); + sb.append(", "); + + sb.append("flOcclusionRoomRatio = "); + sb.append(getOcclusionRoomRatio()); + sb.append(", "); + + sb.append("lOutsideVolumeHF = "); + sb.append(getOutsideVolumeHF()); + sb.append(", "); + + sb.append("flAirAbsorptionFactor = "); + sb.append(getAirAbsorptionFactor()); + sb.append(", "); + + sb.append("dwFlags = "); + sb.append(getFlags()); + + sb.append("]"); + return sb.toString(); + } + // Getters and Setters of struct + // ========================================================================== + /** * Retireves the direct path level * @@ -239,6 +393,7 @@ */ public void setDirect(int direct) { eaxBufferProperties.putInt(direct_offset, direct); + autoCommit(); } /** @@ -257,6 +412,7 @@ */ public void setDirectHF(int directHF) { eaxBufferProperties.putInt(directHF_offset, directHF); + autoCommit(); } /** @@ -275,6 +431,7 @@ */ public void setRoom(int room) { eaxBufferProperties.putInt(room_offset, room); + autoCommit(); } /** @@ -293,6 +450,7 @@ */ public void setRoomHF(int roomHF) { eaxBufferProperties.putInt(roomHF_offset, roomHF); + autoCommit(); } /** @@ -311,6 +469,7 @@ */ public void setRoomRolloffFactor(float roomRolloffFactor) { eaxBufferProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); + autoCommit(); } /** @@ -329,6 +488,7 @@ */ public void setObstruction(int obstruction) { eaxBufferProperties.putInt(obstruction_offset, obstruction); + autoCommit(); } /** @@ -347,6 +507,7 @@ */ public void setObstructionLFRatio(float obstructionLFRatio) { eaxBufferProperties.putFloat(obstructionLFRatio_offset, obstructionLFRatio); + autoCommit(); } /** @@ -365,6 +526,7 @@ */ public void setOcclusion(int occlusion) { eaxBufferProperties.putInt(occlusion_offset, occlusion); + autoCommit(); } /** @@ -383,6 +545,7 @@ */ public void setOcclusionLFRatio(float occlusionLFRatio) { eaxBufferProperties.putFloat(occlusionLFRatio_offset, occlusionLFRatio); + autoCommit(); } /** @@ -401,6 +564,7 @@ */ public void setOcclusionRoomRatio(float occlusionRoomRatio) { eaxBufferProperties.putFloat(occlusionRoomRatio_offset, occlusionRoomRatio); + autoCommit(); } /** @@ -419,6 +583,7 @@ */ public void setOutsideVolumeHF(int outsideVolumeHF) { eaxBufferProperties.putInt(outsideVolumeHF_offset, outsideVolumeHF); + autoCommit(); } /** @@ -436,9 +601,8 @@ * @param airAbsorptionFactor multiplier for DSPROPERTY_EAXLISTENER_AIRABSORPTIONHF to set to */ public void setAirAbsorptionFactor(float airAbsorptionFactor) { - eaxBufferProperties.putFloat( - airAbsorptionFactor_offset, - airAbsorptionFactor); + eaxBufferProperties.putFloat(airAbsorptionFactor_offset, airAbsorptionFactor); + autoCommit(); } /** @@ -457,15 +621,11 @@ */ public void setFlags(int flags) { eaxBufferProperties.putInt(flags_offset, flags); + autoCommit(); } - - /** - * Retrieves the size of the containing ByteBuffer - */ - public static int getSize() { - return EAXBUFFERPROPERTIES_SIZE; - } - + + // -------------------------------------------------------------------------- + /** * Retrieves the size of the EAXBUFFERPROPERTIES */ @@ -474,46 +634,5 @@ /** * Sets the offsets to the fields */ - protected static native void assignOffsets(); - - /** - * Retrieves the size of the property - * - * @param property Property to determine size of - * @return size of property - */ - private static int getSizeOfProperty(int property) { - switch (property) { - case EAXBufferProperties.EAXBUFFER_NONE : - return 0; - - /* long */ - case EAXBufferProperties.EAXBUFFER_DIRECT : - case EAXBufferProperties.EAXBUFFER_DIRECTHF : - case EAXBufferProperties.EAXBUFFER_ROOM : - case EAXBufferProperties.EAXBUFFER_ROOMHF : - case EAXBufferProperties.EAXBUFFER_OBSTRUCTION : - case EAXBufferProperties.EAXBUFFER_OCCLUSION : - case EAXBufferProperties.EAXBUFFER_OUTSIDEVOLUMEHF : - - /* float */ - case EAXBufferProperties.EAXBUFFER_ROOMROLLOFFFACTOR : - case EAXBufferProperties.EAXBUFFER_OBSTRUCTIONLFRATIO : - case EAXBufferProperties.EAXBUFFER_OCCLUSIONLFRATIO : - case EAXBufferProperties.EAXBUFFER_OCCLUSIONROOMRATIO : - case EAXBufferProperties.EAXBUFFER_AIRABSORPTIONFACTOR : - - /* unsigned long */ - case EAXBufferProperties.EAXBUFFER_FLAGS : - return 4; - - case EAXBufferProperties.EAXBUFFER_ALLPARAMETERS : - return EAXBufferProperties.EAXBUFFERPROPERTIES_SIZE; - - default : - throw new IllegalArgumentException( - "No such property '" + property + "'"); - - } - } + protected static native void assignOffsets(); } 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.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- EAXListenerProperties.java 17 Aug 2003 16:38:57 -0000 1.9 +++ EAXListenerProperties.java 6 Jan 2004 19:22:12 -0000 1.10 @@ -43,12 +43,18 @@ * @version $Revision$ */ public class EAXListenerProperties { + + /** Whether auto commit has been anabled */ + private boolean autoCommit = true; /** ByteBuffer representing EAXLISTENERPROPERTIES */ protected ByteBuffer eaxListenerProperties; /** size needed by ByteBuffer to contain EAXLISTENERPROPERTIES */ protected static int EAXLISTENERPROPERTIES_SIZE; + + // EAX values and offsets + // ======================================================== /** room effect level offset */ protected static int room_offset; @@ -201,6 +207,9 @@ | EAXLISTENERFLAGS_REVERBSCALE | EAXLISTENERFLAGS_REVERBDELAYSCALE | EAXLISTENERFLAGS_DECAYHFLIMIT); + + // ------------------------------------------------------- + static { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); EAXLISTENERPROPERTIES_SIZE = sizeOfEaxListenerProperties(); @@ -212,36 +221,163 @@ ByteBuffer.allocateDirect(EAXLISTENERPROPERTIES_SIZE); eaxListenerProperties.order(ByteOrder.nativeOrder()); } + + /** + * Loads current EAX values + */ + public void loadEAXValues() { + EAX.eaxGet( + CoreEAX.LISTENER_GUID, + EAXLISTENER_ALLPARAMETERS, + 0, + eaxListenerProperties, + EAXLISTENERPROPERTIES_SIZE ); + } /** - * Sets an EAX Value - * - * @param property property being queried - * @param source the source to be queried + * Resets this buffer property to default values */ - public void eaxSet(int property, int source) { + public void reset() { + boolean commitValue = autoCommit; + + // disable autocommit + autoCommit = false; + + // set values + setRoom(EAXLISTENER_DEFAULTROOM); + setRoomHF(EAXLISTENER_DEFAULTROOMHF); + setRoomRolloffFactor(EAXLISTENER_DEFAULTROOMROLLOFFFACTOR); + setDecayTime(EAXLISTENER_DEFAULTDECAYTIME); + setDecayTimeHFRatio(EAXLISTENER_DEFAULTDECAYHFRATIO); + setReflections(EAXLISTENER_DEFAULTREFLECTIONS); + setReflectionsDelay(EAXLISTENER_DEFAULTREFLECTIONSDELAY); + setReverb(EAXLISTENER_DEFAULTREVERB); + setReverbDelay(EAXLISTENER_DEFAULTREVERBDELAY); + setEnvironment(EAXLISTENER_DEFAULTENVIRONMENT); + setEnvironmentSize(EAXLISTENER_DEFAULTENVIRONMENTSIZE); + setEnvironmentDiffusion(EAXLISTENER_DEFAULTENVIRONMENTDIFFUSION); + setAirAbsorptionFactor(EAXLISTENER_DEFAULTAIRABSORPTIONHF); + setFlags(EAXLISTENER_DEFAULTFLAGS); + + // reset auto commit + autoCommit = commitValue; + } + + + /** + * Commits any changes + */ + public void commit() { + // call eaxSet with Listener guid, setting all parameters EAX.eaxSet( - CoreEAX.LISTENER_GUID, - property, - source, - eaxListenerProperties, - EAXLISTENERPROPERTIES_SIZE); + CoreEAX.LISTENER_GUID, EAXLISTENER_ALLPARAMETERS | EAXLISTENER_IMMEDIATE, + 0, eaxListenerProperties, EAXLISTENERPROPERTIES_SIZE); + } + + /** + * Tests whether auto commit is enabled or not + * + * @return true if auto commit is inabled + */ + public boolean isAutoCommitEnabled() { + return autoCommit; + } + + /** + * Enabled or disables auto commit + * + * @param enabled True to enable, false to disable + */ + public void setAutoCommit(boolean enabled) { + autoCommit = enabled; + } + + /** + * Performs auto commit, if enabled + */ + private final void autoCommit() { + if(autoCommit) { + commit(); + } } /** - * Gets an EAX Value - * - * @param property property being queried - * @param source the source to be queried + * Retrieves the size of the containing ByteBuffer */ - public void eaxGet(int property, int source) { - EAX.eaxGet( - CoreEAX.LISTENER_GUID, - property, - source, - eaxListenerProperties, - EAXLISTENERPROPERTIES_SIZE); + public int getSize() { + return EAXLISTENERPROPERTIES_SIZE; } + + /** + * Returns a String representation of the EAXBufferProperties object + * + * @return String representation of the EAXBufferProperties object + */ + public String toString() { + StringBuffer sb = new StringBuffer(); + sb.append("EAXListenerProperties ["); + + sb.append("lRoom = "); + sb.append(getRoom()); + sb.append(", "); + + sb.append("lRoomHF = "); + sb.append(getRoomHF()); + sb.append(", "); + + sb.append("flRoomRolloffFactor = "); + sb.append(getRoomRolloffFactor()); + sb.append(", "); + + sb.append("flDecayTime = "); + sb.append(getDecayTime()); + sb.append(", "); + + sb.append("flDecayHFRatio = "); + sb.append(getDecayTimeHFRatio()); + sb.append(", "); + + sb.append("lReflections = "); + sb.append(getReflections()); + sb.append(", "); + + sb.append("flReflectionsDelay = "); + sb.append(getReflectionsDelay()); + sb.append(", "); + + sb.append("lReverb = "); + sb.append(getReverb()); + sb.append(", "); + + sb.append("flReverbDelay = "); + sb.append(getReverbDelay()); + sb.append(", "); + + sb.append("dwEnvironment = "); + sb.append(getEnvironment()); + sb.append(", "); + + sb.append("flEnvironmentSize = "); + sb.append(getEnvironmentSize()); + sb.append(", "); + + sb.append("flEnvironmentDiffusion = "); + sb.append(getEnvironmentDiffusion()); + sb.append(", "); + + sb.append("flAirAbsorptionHF = "); + sb.append(getAirAbsorptionHF()); + sb.append(", "); + + sb.append("dwFlags = "); + sb.append(getFlags()); + + sb.append("]"); + return sb.toString(); + } + + // Getters and Setters of struct + // ========================================================================== /** * Retireves the room effect level @@ -259,6 +395,7 @@ */ public void setRoom(int room) { eaxListenerProperties.putInt(room_offset, room); + autoCommit(); } /** @@ -277,6 +414,7 @@ */ public void setRoomHF(int roomHF) { eaxListenerProperties.putInt(roomHF_offset, roomHF); + autoCommit(); } /** @@ -295,6 +433,7 @@ */ public void setRoomRolloffFactor(float roomRolloffFactor) { eaxListenerProperties.putFloat(roomRolloffFactor_offset, roomRolloffFactor); + autoCommit(); } /** @@ -313,6 +452,7 @@ */ public void setDecayTime(float decayTime) { eaxListenerProperties.putFloat(decayTime_offset, decayTime); + autoCommit(); } /** @@ -331,6 +471,7 @@ */ public void setDecayTimeHFRatio(float decayTimeHFRatio) { eaxListenerProperties.putFloat(decayHFRatio_offset, decayTimeHFRatio); + autoCommit(); } /** @@ -349,6 +490,7 @@ */ public void setReflections(int reflections) { eaxListenerProperties.putInt(reflections_offset, reflections); + autoCommit(); } /** @@ -367,6 +509,7 @@ */ public void setReflectionsDelay(float reflectionsDelay) { eaxListenerProperties.putFloat(reflectionsDelay_offset, reflectionsDelay); + autoCommit(); } /** @@ -385,6 +528,7 @@ */ public void setReverb(int reverb) { eaxListenerProperties.putInt(reverb_offset, reverb); + autoCommit(); } /** @@ -403,6 +547,7 @@ */ public void setReverbDelay(float reverbDelay) { eaxListenerProperties.putFloat(reverbDelay_offset, reverbDelay); + autoCommit(); } /** @@ -421,6 +566,22 @@ */ public void setEnvironment(int environment) { eaxListenerProperties.putInt(environment_offset, environment); + + // we need to handle environment differently than all other + // values on auto commit, since it cannot be single handely set + // using ALLPARAMETERS + // + // To set the environment specifically we need to pass + // only the environment value and its size. Also pass the + // EAXLISTENER_ENVIRONMENT value (and since we're committing IMMEDIATE too) + if (autoCommit) { + EAX.eaxSet( + CoreEAX.LISTENER_GUID, EAXLISTENER_ENVIRONMENT | EAXLISTENER_IMMEDIATE, + 0, eaxListenerProperties.position(environment_offset), 4); + + // rewind buffer + eaxListenerProperties.rewind(); + } } /** @@ -439,6 +600,22 @@ */ public void setEnvironmentSize(float environmentSize) { eaxListenerProperties.putFloat(environmentSize_offset, environmentSize); + + // we need to handle environment size differently than all other + // values on auto commit, since it cannot be single handely set + // using ALLPARAMETERS + // + // To set the environment size specifically we need to pass + // only the environment size value and its size. Also pass the + // EAXLISTENER_ENVIRONMENTSIZE value (and since we're committing IMMEDIATE too) + if (autoCommit) { + EAX.eaxSet( + CoreEAX.LISTENER_GUID, EAXLISTENER_ENVIRONMENTSIZE | EAXLISTENER_IMMEDIATE, + 0, eaxListenerProperties.position(environmentSize_offset), 4); + + // rewind buffer + eaxListenerProperties.rewind(); + } } /** @@ -456,9 +633,8 @@ * @param environmentDiffusion environment diffusion to set to */ public void setEnvironmentDiffusion(float environmentDiffusion) { - eaxListenerProperties.putFloat( - environmentDiffusion_offset, - environmentDiffusion); + eaxListenerProperties.putFloat(environmentDiffusion_offset, environmentDiffusion); + autoCommit(); } /** @@ -477,6 +653,7 @@ */ public void setAirAbsorptionFactor(float airAbsorptionHF) { eaxListenerProperties.putFloat(airAbsorptionHF_offset, airAbsorptionHF); + autoCommit(); } /** @@ -495,14 +672,10 @@ */ public void setFlags(int flags) { eaxListenerProperties.putInt(flags_offset, flags); + autoCommit(); } - /** - * Retrieves the size of the containing ByteBuffer - */ - public int getSize() { - return EAXLISTENERPROPERTIES_SIZE; - } + // -------------------------------------------------------------------------- /** * Retrieves the size of the EAXLISTENERPROPERTIES |
|
From: Brian M. <ma...@us...> - 2004-01-06 19:22:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv10107/native/common Modified Files: extal.h org_lwjgl_openal_eax_CoreEAX.cpp org_lwjgl_openal_eax_CoreEAX.h Log Message: New EAX model implemented - needs more testing Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- extal.h 22 Oct 2003 10:57:18 -0000 1.22 +++ extal.h 6 Jan 2004 19:22:12 -0000 1.23 @@ -128,17 +128,12 @@ #endif #ifdef _WIN32 -DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties, - 0x306a6a8, - 0xb224, - 0x11d2, - 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); +// EAX 2.0 GUIDs +const GUID DSPROPSETID_EAX20_ListenerProperties + = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; -DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties, - 0x306a6a7, - 0xb224, - 0x11d2, - 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22); +const GUID DSPROPSETID_EAX20_BufferProperties + = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } }; #endif #define INITGUID Index: org_lwjgl_openal_eax_CoreEAX.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_openal_eax_CoreEAX.cpp 16 Jul 2003 21:16:36 -0000 1.7 +++ org_lwjgl_openal_eax_CoreEAX.cpp 6 Jan 2004 19:22:12 -0000 1.8 @@ -42,26 +42,20 @@ /* OpenAL includes */ #include "checkALerror.h" +#include "common_tools.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, jclass clazz) { #ifdef _WIN32 + bool EAXSupported = false; //check that we have a current context if(alcGetCurrentContext() == NULL) { - ThrowException(env, "Unable to determine EAX Extensions: No current context"); + throwOpenALException(env, "Unable to determine EAX Extensions: No current context"); } //check for extension, and assign if available @@ -73,25 +67,10 @@ //throw exception if no EAX support if(EAXSupported != true) { - ThrowException(env, "Unable to determine EAX Extensions"); + throwOpenALException(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, jclass clazz) { -#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"); + throwOpenALException(env, "EAX extensions not supported"); #endif } @@ -102,18 +81,20 @@ * 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, jclass clazz, jint propertySetID, jint property, jint source, jobject value, jint size) { +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_neaxGet (JNIEnv *env, jclass clazz, jint propertySetID, jint property, jint source, jobject value, jint offset, jint size) { #ifdef _WIN32 - /* - jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) env->GetDirectBufferAddress(value), (ALuint) size); - CHECK_AL_ERROR + jint result = 0; + // determine buffer or listener + if (propertySetID == org_lwjgl_openal_eax_CoreEAX_BUFFER_GUID) { + result = (jint) eaxGet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + } else if (propertySetID == org_lwjgl_openal_eax_CoreEAX_LISTENER_GUID) { + result = (jint) eaxGet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) property, (ALuint) source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + } + CHECK_AL_ERROR return result; - */ - printf("Method currently deactivated. Fixed soon\n"); - return -1; #else - ThrowException(env, "EAX extensions not supported"); + throwOpenALException(env, "EAX extensions not supported"); return 0; #endif } @@ -125,18 +106,20 @@ * ALenum EAXSet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jclass clazz, jint propertySetID, jint property, jint source, jobject value, jint size) { +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_neaxSet (JNIEnv *env, jclass clazz, jint propertySetID, jint property, jint source, jobject value, jint offset, jint size) { #ifdef _WIN32 - /* - jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, env->GetDirectBufferAddress(value), (ALuint) size); - CHECK_AL_ERROR - + jint result = 0; + + // determine buffer or listener + if (propertySetID == org_lwjgl_openal_eax_CoreEAX_BUFFER_GUID) { + result = (jint) eaxSet(&DSPROPSETID_EAX20_BufferProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + } else if (propertySetID == org_lwjgl_openal_eax_CoreEAX_LISTENER_GUID) { + result = (jint) eaxSet(&DSPROPSETID_EAX20_ListenerProperties, (ALuint) (property), source, (ALvoid*) (offset + (const char*) env->GetDirectBufferAddress(value)), (ALuint) size); + } + CHECK_AL_ERROR return result; - */ - printf("Method currently deactivated. Fixed soon\n"); - return -1; #else - ThrowException(env, "EAX extensions not supported"); + throwOpenALException(env, "EAX extensions not supported"); return 0; #endif } Index: 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 =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_openal_eax_CoreEAX.h 25 Nov 2003 22:28:28 -0000 1.3 +++ org_lwjgl_openal_eax_CoreEAX.h 6 Jan 2004 19:22:12 -0000 1.4 @@ -8,8 +8,10 @@ extern "C" { #endif /* Inaccessible static: created */ -/* Inaccessible static: BUFFER_GUID */ -/* Inaccessible static: LISTENER_GUID */ +#undef org_lwjgl_openal_eax_CoreEAX_BUFFER_GUID +#define org_lwjgl_openal_eax_CoreEAX_BUFFER_GUID 1L +#undef org_lwjgl_openal_eax_CoreEAX_LISTENER_GUID +#define org_lwjgl_openal_eax_CoreEAX_LISTENER_GUID 2L /* * Class: org_lwjgl_openal_eax_CoreEAX * Method: determineAvailableExtensions @@ -20,27 +22,19 @@ /* * Class: org_lwjgl_openal_eax_CoreEAX - * Method: setGUID - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID - (JNIEnv *, jclass); - -/* - * Class: org_lwjgl_openal_eax_CoreEAX - * Method: eaxGet - * Signature: (IIILjava/nio/Buffer;I)I + * Method: neaxGet + * Signature: (IIILjava/nio/Buffer;II)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet - (JNIEnv *, jclass, jint, jint, jint, jobject, jint); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_neaxGet + (JNIEnv *, jclass, jint, jint, jint, jobject, jint, jint); /* * Class: org_lwjgl_openal_eax_CoreEAX - * Method: eaxSet - * Signature: (IIILjava/nio/Buffer;I)I + * Method: neaxSet + * Signature: (IIILjava/nio/Buffer;II)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet - (JNIEnv *, jclass, jint, jint, jint, jobject, jint); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_neaxSet + (JNIEnv *, jclass, jint, jint, jint, jobject, jint, jint); #ifdef __cplusplus } |
|
From: Brian M. <ma...@us...> - 2004-01-06 19:22:15
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv10107/java/org/lwjgl/test/openal Modified Files: EAXTest.java MovingSoundTest.java Log Message: New EAX model implemented - needs more testing Index: EAXTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- EAXTest.java 17 Aug 2003 16:58:18 -0000 1.8 +++ EAXTest.java 6 Jan 2004 19:22:12 -0000 1.9 @@ -31,7 +31,14 @@ */ package org.lwjgl.test.openal; -import org.lwjgl.openal.eax.EAX; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.IntBuffer; + +import org.lwjgl.openal.eax.*; +import org.lwjgl.openal.*; +import org.lwjgl.Sys; /** * $Id$ @@ -42,39 +49,240 @@ * @version $Revision$ */ public class EAXTest extends BasicTest { + + /** OpenAL buffers */ + private IntBuffer soundBuffers = createIntBuffer(1); + + /** OpenAL sources */ + private IntBuffer soundSources = createIntBuffer(1); + + /** Listener EAX property object */ + private EAXListenerProperties listenerProperties; + + /** Buffer EAX property object */ + private EAXBufferProperties bufferProperties; + + /** + * Creates an instance of EAXTest + */ + public EAXTest() { + super(); + } + + /** + * Runs the actual test, using supplied arguments + */ + protected void execute(String[] args) { + try { + System.out.print("Testing EAX support..."); + EAX.create(); + System.out.println("supported!"); + } catch (Exception e) { + System.out.println("not supported!"); + } - /** - * Creates an instance of EAXTest - */ - public EAXTest() { - super(); + try { + AL.create(); + AL.alGetError(); // clear any errors + } catch(Exception e) { + System.out.println("Unable to initialize OpenAL"); } - /** - * Runs the actual test, using supplied arguments - */ - protected void execute(String[] args) { - try { - System.out.print("Testing EAX support..."); - EAX.create(); - System.out.println("supported!"); - } catch (Exception e) { - System.out.println("no supported!"); + // continue with test if EAX is supported + if (EAX.isCreated() && AL.isCreated() && initialize()) { + runTest(); + + // kill sources and buffers + AL.alSourceStop(soundSources.get(0)); + AL.alDeleteSources(soundSources); + AL.alDeleteBuffers(soundBuffers); + + EAX.destroy(); + } + + //shutdown + alExit(); + + System.out.println("test done."); + } + + private boolean initialize() { + // creating buffers + Sys.log("Creating buffers"); + AL.alGenBuffers(soundBuffers); + soundBuffers.rewind(); + + // creating sources + Sys.log("Creating sources"); + AL.alGenSources(soundSources); + soundSources.rewind(); + + // load sound files (left, center, right).wav + Sys.log("Loading Footsteps.wav"); + WaveData footsteps = WaveData.create("Footsteps.wav"); + AL.alBufferData(soundBuffers.get(0), footsteps.format, footsteps.data, footsteps.data.capacity(), footsteps.samplerate); + AL.alSourcef(soundSources.get(0), AL.AL_PITCH, 1.0f); + AL.alSourcef(soundSources.get(0), AL.AL_GAIN, 1.0f); + AL.alSourcei(soundSources.get(0), AL.AL_BUFFER, soundBuffers.get(0)); + AL.alSourcei(soundSources.get(0), AL.AL_LOOPING, AL.AL_TRUE); + + // create eax property objects + listenerProperties = new EAXListenerProperties(); + bufferProperties = new EAXBufferProperties(); + + // set buffer to work on source 0 + bufferProperties.setCurrentSource(soundSources.get(0)); + + return AL.alGetError() == AL.AL_NO_ERROR; + } + + /** + * Runs the actual EAXTest + */ + private void runTest() { + boolean running = true; + char key; + + assert AL.alIsBuffer(soundBuffers.get(0)) : "Failed to validate buffer"; + + // handle menu + do { + printMenu(); + key = readInput(); + + switch (key) { + // play sound + case '1' : { + AL.alSourcePlay(soundSources.get(0)); + break; + } + + // stop sound + case '2' : { + AL.alSourceStop(soundSources.get(0)); + break; + } + + // add reverb + case '3' : { + listenerProperties.setEnvironment(EAX.EAX_ENVIRONMENT_HANGAR); + break; + } + + // remove reverb + case '4' : { + listenerProperties.setEnvironment(EAX.EAX_ENVIRONMENT_GENERIC); + break; + } + + // add occlusion + case '5' : { + bufferProperties.setOcclusion(bufferProperties.getOcclusion()-5000); + break; + } + + // remove occlusion + case '6' : { + bufferProperties.setOcclusion(bufferProperties.getOcclusion()+5000); + break; + } + + // add obstruction + case '7' : { + bufferProperties.setObstruction(bufferProperties.getObstruction()-5000); + break; + } + + // remove obstruction + case '8' : { + bufferProperties.setObstruction(bufferProperties.getObstruction()+5000); + break; + } + + // commit eax values + case 'c' : { + bufferProperties.commit(); + listenerProperties.commit(); + break; + } + + // toggle autocommit + case 't' : { + bufferProperties.setAutoCommit(!bufferProperties.isAutoCommitEnabled()); + listenerProperties.setAutoCommit(!listenerProperties.isAutoCommitEnabled()); + System.out.println("\n[Buffer] Auto Commit is now: " + bufferProperties.isAutoCommitEnabled()); + System.out.println("\n[Listen] Auto Commit is now: " + listenerProperties.isAutoCommitEnabled()); + break; } - //shutdown - alExit(); + // show current eax values + case 's' : { + System.out.println(bufferProperties); + System.out.println(listenerProperties); + break; + } - System.out.println("test done."); - } + // load current eax values + case 'l' : { + bufferProperties.loadEAXValues(); + listenerProperties.loadEAXValues(); + break; + } + + // reset to default values + case 'r' : { + bufferProperties.reset(); + listenerProperties.reset(); + break; + } + + // quit demo + case 'q' : { + running = false; + break; + } + } + } while (running); + } + + private void printMenu() { + System.out.println(""); + System.out.println("EAXTest menu, please select an option from the following list:"); + System.out.println("1: Play looping sound"); + System.out.println("2: Stop looping sound"); + System.out.println("3: Add reverberation effect"); + System.out.println("4: Remove reverberation effect"); + System.out.println("5: Add occlusion effect"); + System.out.println("6: Remove occlusion effect"); + System.out.println("7: Add obstruction effect"); + System.out.println("8: Remove obstruction effect"); + + System.out.println("C: Commit current eax values"); + System.out.println("L: Load current values"); + System.out.println("T: Toggle autocomit"); + System.out.println("R: Reset to inital values"); + System.out.println("S: Show current values"); - /** - * main entry point - * - * @param args String array containing arguments - */ - public static void main(String[] args) { - EAXTest eaxTest = new EAXTest(); - eaxTest.execute(args); + System.out.println("Q: Quit demo"); + System.out.print("Input: "); + } + + private char readInput() { + BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + try { + return br.readLine().toLowerCase().charAt(0); + } catch (IOException ioe) { + return 'q'; } + } + + /** + * main entry point + * + * @param args String array containing arguments + */ + public static void main(String[] args) { + EAXTest eaxTest = new EAXTest(); + eaxTest.execute(args); + } } Index: MovingSoundTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- MovingSoundTest.java 17 Aug 2003 18:40:58 -0000 1.23 +++ MovingSoundTest.java 6 Jan 2004 19:22:12 -0000 1.24 @@ -185,10 +185,8 @@ if(Keyboard.isKeyDown(Keyboard.KEY_E)) { if(eaxApplied) { eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_GENERIC); - eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0); } else { eaxListenerProp.setEnvironment(EAX.EAX_ENVIRONMENT_HANGAR); - eaxListenerProp.eaxSet(EAXListenerProperties.EAXLISTENER_ENVIRONMENT, 0); } eaxApplied = !eaxApplied; } |
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv1274/common Modified Files: common_tools.h org_lwjgl_opengl_CoreGL11.cpp org_lwjgl_opengl_CoreGL12.cpp org_lwjgl_opengl_CoreGL14.cpp org_lwjgl_opengl_GL.cpp Log Message: Moved utility functions to common_tools in preparation of extension separation Index: common_tools.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/common_tools.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- common_tools.h 20 Dec 2003 22:03:24 -0000 1.6 +++ common_tools.h 5 Jan 2004 22:43:42 -0000 1.7 @@ -67,4 +67,22 @@ extern void setDebugEnabled(bool enable); extern void printfDebug(const char *format, ...); +static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer) { + if (buffer == NULL) + return NULL; + else + return env->GetDirectBufferAddress(buffer); +} + +static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) { + if (p == NULL) + return NULL; + else + return env->NewDirectByteBuffer(p, size); +} + +static inline const void *offsetToPointer(jint offset) { + return (const char *)NULL + offset; +} + #endif Index: org_lwjgl_opengl_CoreGL11.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL11.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL11.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- org_lwjgl_opengl_CoreGL11.cpp 4 Aug 2003 23:00:49 -0000 1.7 +++ org_lwjgl_opengl_CoreGL11.cpp 5 Jan 2004 22:43:42 -0000 1.8 @@ -47,17 +47,6 @@ #include "checkGLerror.h" #include "extgl.h" -static inline jobject newBuffer(JNIEnv *env, void *p, int size) { - if (p == NULL) - return NULL; - else - return env->NewDirectByteBuffer(p, size); -} - -static inline const void *offsetToPointer(jint offset) { - return (const char *)NULL + offset; -} - /* * Class: org_lwjgl_opengl_CoreGL11 * Method: glAccum @@ -906,7 +895,7 @@ void *pointer; glGetPointerv((GLint) p0, &pointer); CHECK_GL_ERROR - return newBuffer(env, pointer, size); + return safeNewBuffer(env, pointer, size); } /* Index: org_lwjgl_opengl_CoreGL12.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL12.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL12.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_CoreGL12.cpp 4 Aug 2003 23:00:49 -0000 1.3 +++ org_lwjgl_opengl_CoreGL12.cpp 5 Jan 2004 22:43:42 -0000 1.4 @@ -47,10 +47,6 @@ #include "checkGLerror.h" #include "extgl.h" -static inline const void *offsetToPointer(jint offset) { - return (const char *)NULL + offset; -} - /* * Class: org_lwjgl_opengl_CoreGL12 * Method: glColorTable Index: org_lwjgl_opengl_CoreGL14.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL14.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_CoreGL14.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_CoreGL14.cpp 4 Aug 2003 23:00:49 -0000 1.3 +++ org_lwjgl_opengl_CoreGL14.cpp 5 Jan 2004 22:43:42 -0000 1.4 @@ -47,10 +47,6 @@ #include "checkGLerror.h" #include "extgl.h" -static inline const void *offsetToPointer(jint offset) { - return (const char *)NULL + offset; -} - /* * Class: org_lwjgl_opengl_CoreGL14 * Method: glFogCoordf Index: org_lwjgl_opengl_GL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GL.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- org_lwjgl_opengl_GL.cpp 23 Oct 2003 08:42:54 -0000 1.21 +++ org_lwjgl_opengl_GL.cpp 5 Jan 2004 22:43:42 -0000 1.22 @@ -51,24 +51,6 @@ extern HDC hdc; #endif -static inline void * safeGetBufferAddress(JNIEnv *env, jobject buffer) { - if (buffer == NULL) - return NULL; - else - return env->GetDirectBufferAddress(buffer); -} - -static inline jobject safeNewBuffer(JNIEnv *env, void *p, int size) { - if (p == NULL) - return NULL; - else - return env->NewDirectByteBuffer(p, size); -} - -static inline const void *offsetToPointer(jint offset) { - return (const char *)NULL + offset; -} - /* * Class: org_lwjgl_opengl_GL * Method: glActiveStencilFaceEXT |
|
From: Elias N. <eli...@us...> - 2004-01-05 13:21:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv16516/common Modified Files: extgl.cpp Log Message: Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- extgl.cpp 3 Jan 2004 08:09:17 -0000 1.9 +++ extgl.cpp 5 Jan 2004 13:21:41 -0000 1.10 @@ -3080,7 +3080,7 @@ static void extgl_InitGLUSupportedExtensions(JNIEnv *env, jobject ext_set) { - char *s = (char*) gluGetString(GLU_VERSION); + const char *s = (const char *)gluGetString(GLU_VERSION); if (!s) return; s = strstr(s, "1."); |
|
From: Elias N. <eli...@us...> - 2004-01-03 08:09:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv28353/src/native/common Modified Files: extgl.cpp extgl.h Log Message: Implemented linux swap control through GLX_SGI_swap_control Index: extgl.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extgl.cpp 20 Dec 2003 22:03:24 -0000 1.8 +++ extgl.cpp 3 Jan 2004 08:09:17 -0000 1.9 @@ -87,6 +87,9 @@ glXGetClientStringPROC glXGetClientString = NULL; glXQueryServerStringPROC glXQueryServerString = NULL; glXQueryExtensionsStringPROC glXQueryExtensionsString = NULL; + +/* GLX_SGI_swap_control */ +glXSwapIntervalSGIPROC glXSwapIntervalSGI = NULL; #endif #ifdef _AGL @@ -2538,6 +2541,15 @@ { extgl_Extensions.GLX_EXT_visual_info = GLXQueryExtension(env, ext_set, disp, screen, "GLX_EXT_visual_info"); extgl_Extensions.GLX_EXT_visual_rating = GLXQueryExtension(env, ext_set, disp, screen, "GLX_EXT_visual_rating"); + extgl_Extensions.GLX_SGI_swap_control = GLXQueryExtension(env, ext_set, disp, screen, "GLX_SGI_swap_control"); +} + +static void extgl_InitGLXSGISwapControl(JNIEnv *env, jobject ext_set) +{ + if (extgl_Extensions.GLX_SGI_swap_control != 1) + return; + glXSwapIntervalSGI = (glXSwapIntervalSGIPROC)extgl_GetProcAddress("glXSwapIntervalSGI"); + EXTGL_SANITY_CHECK(env, ext_set, GLX_SGI_swap_control) } bool extgl_InitGLX(JNIEnv *env, jobject ext_set, Display *disp, int screen) @@ -2556,6 +2568,7 @@ if (major > 1 || (major == 1 && minor >= 3)) extgl_Extensions.GLX13 = true; extgl_InitGLX13(env, ext_set); + extgl_InitGLXSGISwapControl(env, ext_set); return true; } #endif Index: extgl.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- extgl.h 15 Dec 2003 09:38:14 -0000 1.17 +++ extgl.h 3 Jan 2004 08:09:17 -0000 1.18 @@ -539,6 +539,11 @@ extern glXQueryServerStringPROC glXQueryServerString; extern glXQueryExtensionsStringPROC glXQueryExtensionsString; +/* GLX_SGI_swap_control */ +typedef void (APIENTRY * glXSwapIntervalSGIPROC)(int interval); + +extern glXSwapIntervalSGIPROC glXSwapIntervalSGI; + #endif /* X11 */ #ifdef _AGL @@ -5535,6 +5540,7 @@ bool GLX13; bool GLX_EXT_visual_info; bool GLX_EXT_visual_rating; + bool GLX_SGI_swap_control; #endif /* X11 */ bool OpenGL12; |
|
From: Elias N. <eli...@us...> - 2004-01-03 08:09:22
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv28353/src/native/linux Modified Files: org_lwjgl_opengl_Window.cpp Log Message: Implemented linux swap control through GLX_SGI_swap_control Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_opengl_Window.cpp 20 Dec 2003 22:03:25 -0000 1.14 +++ org_lwjgl_opengl_Window.cpp 3 Jan 2004 08:09:17 -0000 1.15 @@ -68,6 +68,7 @@ static bool input_released; static bool dirty; +static bool vsync_enabled; static bool minimized; static bool focused; static bool closerequested; @@ -182,7 +183,7 @@ focused = true; minimized = false; closerequested = false; - + vsync_enabled = false; Window root_win; Window win; XSetWindowAttributes attribs; @@ -556,25 +557,21 @@ return focused; } -/* - * Class: org_lwjgl_opengl_Window - * Method: nIsVSyncEnabled - * Signature: ()Z - */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_Window_nIsVSyncEnabled (JNIEnv * env, jclass clazz) { - // Always return false - return false; + return vsync_enabled; } -/* - * Class: org_lwjgl_opengl_Window - * Method: nSetVSyncEnabled - * Signature: (Z)V - */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_Window_nSetVSyncEnabled (JNIEnv * env, jclass clazz, jboolean sync) { - // Do nothing on Linux + if (extgl_Extensions.GLX_SGI_swap_control) { + bool vsync = sync == JNI_TRUE ? true : false; + if (vsync != vsync_enabled) { + int interval = vsync ? 1 : 0; + glXSwapIntervalSGI(interval); + vsync_enabled = vsync; + } + } } |