You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
1
|
2
|
3
|
|
4
|
5
|
6
|
7
|
8
|
9
|
10
|
|
11
|
12
|
13
|
14
|
15
(1) |
16
(21) |
17
(5) |
|
18
(5) |
19
(14) |
20
(5) |
21
|
22
|
23
(2) |
24
(18) |
|
25
(3) |
26
(22) |
27
(8) |
28
(10) |
29
(11) |
30
(9) |
31
|
|
From: Tristan C. <ex...@us...> - 2002-08-29 21:40:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv16457 Modified Files: org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp Log Message: Safe version now exists, some testing performed. Index: org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp 28 Aug 2002 16:45:24 -0000 1.2 +++ org_lwjgl_Math_MatrixOpNormalise_MatrixOpDirect.cpp 29 Aug 2002 21:40:44 -0000 1.3 @@ -74,8 +74,7 @@ float * sourceRecord, * destRecord; float magnitude, magnitude_squared; - int i; - register int j; + int i, j; for (i = 0; i < source.elements; i++) { @@ -84,12 +83,12 @@ sourceRecord = source.nextRecord(); destRecord = dest.nextRecord(); - for (j = 0 ; j < sourceWidth*sourceHeight; i++) + for (j = 0 ; j < sourceWidth*sourceHeight; j++) magnitude_squared += sourceRecord[j] * sourceRecord[j]; magnitude = (float) sqrt((double) magnitude_squared); - for (j = 0; j < sourceWidth*sourceHeight; i++) + for (j = 0; j < sourceWidth*sourceHeight; j++) destRecord[j] = sourceRecord[j] / magnitude; dest.writeRecord(); Index: org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp 28 Aug 2002 16:45:24 -0000 1.2 +++ org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.cpp 29 Aug 2002 21:40:44 -0000 1.3 @@ -40,7 +40,7 @@ */ #include <windows.h> -#include "org_lwjgl_Math_MatrixOpSubtract_MatrixOpSafe.h" +#include "org_lwjgl_Math_MatrixOpNormalise_MatrixOpSafe.h" #include "MatrixOpCommon.h" #include <cmath> @@ -72,22 +72,21 @@ float * sourceRecord, * destRecord; float magnitude, magnitude_squared; - int i; - register int j; + int i, j; for (i = 0; i < source.elements; i++) { magnitude_squared = 0; sourceRecord = source.nextRecord(); - destRecord = dest.nextRecord(); + destRecord = dest.nextRecord(); - for (j = 0 ; j < sourceWidth*sourceHeight; i++) + for (j = 0 ; j < sourceWidth*sourceHeight; j++) magnitude_squared += sourceRecord[j] * sourceRecord[j]; magnitude = (float) sqrt((double) magnitude_squared); - for (j = 0; j < sourceWidth*sourceHeight; i++) + for (j = 0; j < sourceWidth*sourceHeight; j++) destRecord[j] = sourceRecord[j] / magnitude; dest.writeRecord(); |
|
From: Brian M. <ma...@us...> - 2002-08-29 14:06:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv20916 Removed Files: EAXALConstants.java Log Message: mov: renamed to BaseEAXConstants.java --- EAXALConstants.java DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/EAXALConstants.java |
|
From: Brian M. <ma...@us...> - 2002-08-29 12:44:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv18864/org/lwjgl/openal/test Modified Files: ALCTest.java ALTest.java BasicTest.java PlayTest.java PlayTestMemory.java Log Message: fix: now using Int- & Float- Buffers fix: to small iteration when unqueing buffers fix: nulling of buffer Index: ALCTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALCTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALCTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALCTest.java 27 Aug 2002 23:21:03 -0000 1.2 +++ ALCTest.java 29 Aug 2002 12:44:32 -0000 1.3 @@ -37,8 +37,8 @@ import org.lwjgl.openal.ALCdevice; import org.lwjgl.Sys; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; +import java.nio.IntBuffer; + /** * $Id$ * @@ -71,15 +71,14 @@ } //create attribute list for context creation - ByteBuffer buffer = ByteBuffer.allocateDirect(28); - buffer.order(ByteOrder.nativeOrder()); - buffer.putInt(ALC.FREQUENCY); - buffer.putInt(44100); - buffer.putInt(ALC.REFRESH); - buffer.putInt(15); - buffer.putInt(ALC.SYNC); - buffer.putInt(ALC.FALSE); - buffer.putInt(0); //terminating int + IntBuffer buffer = createIntBuffer(7); + buffer.put(ALC.FREQUENCY); + buffer.put(44100); + buffer.put(ALC.REFRESH); + buffer.put(15); + buffer.put(ALC.SYNC); + buffer.put(ALC.FALSE); + buffer.put(0); //terminating int //create a context, using above attributes context = alc.createContext(device, Sys.getDirectBufferAddress(buffer)); @@ -112,8 +111,8 @@ alc.getIntegerv(device, ALC.MAJOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)); alc.getIntegerv(device, ALC.MINOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)+4); - System.out.println("ALC_MAJOR_VERSION: " + buffer.getInt()); - System.out.println("ALC_MINOR_VERSION: " + buffer.getInt()); + System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0)); + System.out.println("ALC_MINOR_VERSION: " + buffer.get(1)); //no check for ALC_ALL_ATTRIBUTES / ALC_ATTRIBUTES_SIZE since it //is buggy on win32 - my dev platform 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.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ALTest.java 29 Aug 2002 02:00:49 -0000 1.6 +++ ALTest.java 29 Aug 2002 12:44:32 -0000 1.7 @@ -41,6 +41,8 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.nio.IntBuffer; +import java.nio.FloatBuffer; import java.io.IOException; /** @@ -57,7 +59,7 @@ public static final int NUM_BUFFERS = 7; [...1868 lines suppressed...] - pos.getFloat() + "\n"); + pos.get(0) + ", " + + pos.get(1) + ", " + + pos.get(2) + "\n"); // Enable looping - al.sourcei(Sources.getInt(4*i), AL.LOOPING, AL.TRUE); + al.sourcei(Sources.get(i), AL.LOOPING, AL.TRUE); pos.clear(); } @@ -2319,7 +2196,7 @@ switch (ch) { case '1': for (i = 0; i < numSources; i++) { - al.sourcePlay(Sources.getInt(4*i)); + al.sourcePlay(Sources.get(i)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcePlay : ", error); 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.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BasicTest.java 26 Aug 2002 21:10:08 -0000 1.1 +++ BasicTest.java 29 Aug 2002 12:44:32 -0000 1.2 @@ -37,6 +37,10 @@ import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.ALUT; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; + /** * $Id$ * @@ -94,6 +98,20 @@ throw new RuntimeException("An error occurred while making context current"); } } + + /** + * Creates an integer buffer to hold specified ints + * - strictly a utility method + * + * @param size how many int to contain + * @return created IntBuffer + */ + protected IntBuffer createIntBuffer(int size) { + ByteBuffer temp = ByteBuffer.allocateDirect(4*size); + temp.order(ByteOrder.nativeOrder()); + + return temp.asIntBuffer(); + } /** * Exits the test NOW, printing errorcode to stdout Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- PlayTest.java 29 Aug 2002 01:11:46 -0000 1.7 +++ PlayTest.java 29 Aug 2002 12:44:32 -0000 1.8 @@ -35,8 +35,7 @@ import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; +import java.nio.IntBuffer; /** * $Id$ @@ -71,11 +70,8 @@ alInitialize(); //create 1 buffer and 1 source - ByteBuffer buffers = ByteBuffer.allocateDirect(4); - buffers.order(ByteOrder.nativeOrder()); - - ByteBuffer sources = ByteBuffer.allocateDirect(4); - sources.order(ByteOrder.nativeOrder()); + IntBuffer buffers = createIntBuffer(1); + IntBuffer sources = createIntBuffer(1); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); @@ -96,7 +92,7 @@ //copy to buffers - al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); + al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -108,19 +104,19 @@ } //set up source input - al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); + al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound - al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); + al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 - al.sourcePlay(sources.getInt(0)); + al.sourcePlay(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -133,7 +129,7 @@ } //stop source 0 - al.sourceStop(sources.getInt(0)); + al.sourceStop(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -158,7 +154,7 @@ /** * main entry point - *+ + * * @param args String array containing arguments */ public static void main(String[] args) { Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTestMemory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PlayTestMemory.java 29 Aug 2002 01:11:25 -0000 1.1 +++ PlayTestMemory.java 29 Aug 2002 12:44:32 -0000 1.2 @@ -41,6 +41,7 @@ import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; +import java.nio.IntBuffer; /** * $Id$ @@ -75,11 +76,8 @@ alInitialize(); //create 1 buffer and 1 source - ByteBuffer buffers = ByteBuffer.allocateDirect(4); - buffers.order(ByteOrder.nativeOrder()); - - ByteBuffer sources = ByteBuffer.allocateDirect(4); - sources.order(ByteOrder.nativeOrder()); + IntBuffer buffers = createIntBuffer(1); + IntBuffer sources = createIntBuffer(1); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); @@ -106,7 +104,7 @@ //copy to buffers - al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); + al.bufferData(buffers.get(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -118,19 +116,19 @@ } //set up source input - al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); + al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound - al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); + al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 - al.sourcePlay(sources.getInt(0)); + al.sourcePlay(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -143,7 +141,7 @@ } //stop source 0 - al.sourceStop(sources.getInt(0)); + al.sourceStop(sources.get(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } |
|
From: Brian M. <ma...@us...> - 2002-08-29 02:00:53
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv32005/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: add: finished full automated tests 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ALTest.java 29 Aug 2002 01:49:25 -0000 1.5 +++ ALTest.java 29 Aug 2002 02:00:49 -0000 1.6 @@ -509,7 +509,7 @@ do { System.out.print("\n\n\nAutomated Test Series:\n\n"); - System.out.print("*A) Run Fully Automated Tests\n"); + System.out.print("A) Run Fully Automated Tests\n"); System.out.print("*B) Run Semi-Automated Tests\n"); System.out.print("\nInteractive Tests:\n\n"); System.out.print("1 Position Test\n"); @@ -581,7 +581,7 @@ fA_VectorStateTransition(); // Vector State Transistion Testing fA_GetBufferProperties(); // Get Buffer Properties fA_EnumerationValue(); // Enumeration Value Test - //fA_QueuingUnderrunStates(); // test underrun while queuing + fA_QueuingUnderrunStates(); // test underrun while queuing System.out.print("\n\n"); delay_ms(1000); @@ -906,6 +906,75 @@ } if(result == true) { + System.out.print("PASSED."); + } else { + System.out.print("FAILED."); + } + } + + protected void fA_QueuingUnderrunStates() { + ByteBuffer testSources = ByteBuffer.allocateDirect(4*1); + testSources.order(ByteOrder.nativeOrder()); + + ByteBuffer tempInt = ByteBuffer.allocateDirect(4); + tempInt.order(ByteOrder.nativeOrder()); + int error; + ByteBuffer bufferName = ByteBuffer.allocateDirect(4); + bufferName.order(ByteOrder.nativeOrder()); + + ByteBuffer listenerOri = ByteBuffer.allocateDirect(24); + listenerOri.order(ByteOrder.nativeOrder()); + listenerOri.putFloat(0.0f); + listenerOri.putFloat(0.0f); + listenerOri.putFloat(-1.0f); + listenerOri.putFloat(0.0f); + listenerOri.putFloat(1.0f); + listenerOri.putFloat(0.0f); + + ByteBuffer sourceOri = ByteBuffer.allocateDirect(24); + sourceOri.order(ByteOrder.nativeOrder()); + sourceOri.putFloat(1.0f); + sourceOri.putFloat(0.0f); + sourceOri.putFloat(0.0f); + sourceOri.putFloat(0.0f); + sourceOri.putFloat(1.0f); + sourceOri.putFloat(0.0f); + + boolean localResultOK; + + System.out.print("\nQueuing Underrun States Test. "); + localResultOK = true; + al.getError(); + al.genSources(1, Sys.getDirectBufferAddress(testSources)); + al.sourcei(testSources.getInt(4*0), AL.BUFFER, 0); + al.sourcei(testSources.getInt(4*0), AL.LOOPING, AL.FALSE); + if ((error = al.getError()) != AL.NO_ERROR) + displayALError("Init error : ", error); + al.sourceQueueBuffers(testSources.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*1)); + if ((error = al.getError()) != AL.NO_ERROR) localResultOK = false; + al.sourcePlay(testSources.getInt(4*0)); + delay_ms(1000); + al.getSourcei(testSources.getInt(4*0), AL.SOURCE_STATE, Sys.getDirectBufferAddress(tempInt)); + if (tempInt.getInt(0) != AL.STOPPED) localResultOK = false; + al.getSourcei(testSources.getInt(4*0), AL.BUFFERS_PROCESSED, Sys.getDirectBufferAddress(tempInt)); + if (tempInt.getInt(0) != 1) { + localResultOK = false; + } else { + al.sourceUnqueueBuffers(testSources.getInt(4*0), tempInt.getInt(0), Sys.getDirectBufferAddress(bufferName)); + } + al.sourceQueueBuffers(testSources.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*1)); + if ((error = al.getError()) != AL.NO_ERROR) localResultOK = false; + al.sourcePlay(testSources.getInt(4*0)); + delay_ms(100); + al.getSourcei(testSources.getInt(4*0), AL.SOURCE_STATE, Sys.getDirectBufferAddress(tempInt)); + if (tempInt.getInt(0) != AL.PLAYING) localResultOK = false; + + // cleanup + al.sourcei(testSources.getInt(4*0), AL.BUFFER, 0); + al.deleteSources(1, Sys.getDirectBufferAddress(testSources)); + + // display result + if (localResultOK == true) { System.out.print("PASSED."); } else { System.out.print("FAILED."); |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:49:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv18188/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: add: added EnumerationValue test 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.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ALTest.java 29 Aug 2002 01:45:44 -0000 1.4 +++ ALTest.java 29 Aug 2002 01:49:25 -0000 1.5 @@ -895,16 +895,16 @@ int getVal; System.out.print("\nEnumeration Value Test. "); -/* - while (enumeration[i].enumName) { - getVal = alGetEnumValue(enumeration[i].enumName); - if (getVal != enumeration[i].value) { - printf("\n%s has an invalid enum value.", enumeration[i].enumName); + + while (i < enumerationString.length) { + getVal = al.getEnumValue(enumerationString[i]); + if (getVal != enumeration[i]) { + System.out.print("\n" + enumerationString[i] + " has an invalid enum value."); result = false; } i++; } -*/ + if(result == true) { System.out.print("PASSED."); } else { |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:45:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv15477/org/lwjgl/openal/test Modified Files: ALTest.java Log Message: add: Queue test 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.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ALTest.java 29 Aug 2002 01:11:46 -0000 1.3 +++ ALTest.java 29 Aug 2002 01:45:44 -0000 1.4 @@ -515,7 +515,7 @@ 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("*4 Queue Test\n"); + System.out.print("4 Queue Test\n"); System.out.print("5 Buffer Test\n"); System.out.print("6 Frequency Test\n"); System.out.print("7 Stereo Test\n"); @@ -1245,15 +1245,15 @@ } protected void i_QueueTest() { - System.out.println("i_QueueTest"); - delay_ms(3000); - - /* int error; - int[] source = new int[1]; + ByteBuffer source = ByteBuffer.allocateDirect(4); + source.order(ByteOrder.nativeOrder()); int ch = -1; - int[] tbuffers = new int[5]; - int[] buffersremoved; + ByteBuffer tbuffers = ByteBuffer.allocateDirect(4*5); + tbuffers.order(ByteOrder.nativeOrder()); + + ByteBuffer buffersremoved = ByteBuffer.allocateDirect(4*5); + buffersremoved.order(ByteOrder.nativeOrder()); int bLooping; ByteBuffer BuffersInQueue = ByteBuffer.allocateDirect(4); @@ -1281,33 +1281,33 @@ // Clear Error Code al.getError(); - al.genSources(1,source); + al.genSources(1,Sys.getDirectBufferAddress(source)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alGenSources 1 : ", error); return; } - al.sourcef(source[0],AL.PITCH,1.0f); + al.sourcef(source.getInt(4*0),AL.PITCH,1.0f); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourcef 0 AL_PITCH : ", error); } - al.sourcef(source[0],AL.GAIN,1.0f); + al.sourcef(source.getInt(4*0),AL.GAIN,1.0f); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourcef 0 AL_GAIN : ", error); } - al.sourcefv(source[0],AL.POSITION,Sys.getDirectBufferAddress(source0Pos)); + al.sourcefv(source.getInt(4*0),AL.POSITION,Sys.getDirectBufferAddress(source0Pos)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourcefv 0 AL_POSITION : ", error); } - al.sourcefv(source[0],AL.VELOCITY,Sys.getDirectBufferAddress(source0Vel)); + al.sourcefv(source.getInt(4*0),AL.VELOCITY,Sys.getDirectBufferAddress(source0Vel)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourcefv 0 AL_VELOCITY : ", error); } - al.sourcei(source[0],AL.LOOPING,AL.FALSE); + al.sourcei(source.getInt(4*0),AL.LOOPING,AL.FALSE); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourcei 0 AL_LOOPING false: ", error); } @@ -1337,11 +1337,11 @@ System.out.print("Source 0 not looping\n"); - tbuffers[0] = buffers[2]; - tbuffers[1] = buffers[3]; - tbuffers[2] = buffers[4]; - tbuffers[3] = buffers[5]; - tbuffers[4] = 0; + tbuffers.putInt(4*0, buffers.getInt(4*2)); + tbuffers.putInt(4*1, buffers.getInt(4*3)); + tbuffers.putInt(4*2, buffers.getInt(4*4)); + tbuffers.putInt(4*3, buffers.getInt(4*5)); + tbuffers.putInt(4*4, 0); do { try { @@ -1350,12 +1350,12 @@ } switch (ch) { case '1': - al.sourcePlay(source[0]); + al.sourcePlay(source.getInt(4*0)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcePlay source 0 : ", error); break; case '2': - al.sourceStop(source[0]); + al.sourceStop(source.getInt(4*0)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceStop source 0 : ", error); break; @@ -1370,70 +1370,69 @@ bLooping = AL.TRUE; System.out.print("Source 0 looping \n"); } - al.sourcei(source[0], AL.LOOPING, bLooping); + al.sourcei(source.getInt(4*0), AL.LOOPING, bLooping); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcei AL_LOOPING : ", error); break; case '4': - al.sourceQueueBuffers(source[0], 4, buffers); + al.sourceQueueBuffers(source.getInt(4*0), 4, Sys.getDirectBufferAddress(buffers)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 4 : ", error); break; case '5': - //al.sourceQueueBuffers(source[0], 1, buffers[0]); + al.sourceQueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*0)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 : ", error); break; case '6': - //al.sourceQueueBuffers(source[0], 1, buffers[1]); + al.sourceQueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*1)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 : ", error); break; case '7': - //al.sourceQueueBuffers(source[0], 1, buffers[2]); + al.sourceQueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*2)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 : ", error); break; case '8': - //al.sourceQueueBuffers(source[0], 1, buffers[3]); + al.sourceQueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*3)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 : ", error); break; case '9': // Queue buffer 0 - //al.sourceQueueBuffers(source[0], 1, buffers[4]); + al.sourceQueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffers) + (4*4)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 (buffer 0) : ", error); break; case 'A': // Unqueue first Buffer - buffersremoved = new int[1]; - al.sourceUnqueueBuffers(source[0], 1, buffersremoved); + buffersremoved.clear(); + al.sourceUnqueueBuffers(source.getInt(4*0), 1, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourceUnqueueBuffers 1 : ", error); } else { - if (buffersremoved[0] == buffers[0]) - buffersremoved[0] = 1; - else if (buffersremoved[0] == buffers[1]) - buffersremoved[0] = 2; - else if (buffersremoved[0] == buffers[2]) - buffersremoved[0] = 3; - else if (buffersremoved[0] == buffers[3]) - buffersremoved[0] = 4; + if (buffersremoved.getInt(4*0) == buffers.getInt(4*0)) + buffersremoved.putInt(4*0, 1); + if (buffersremoved.getInt(4*0) == buffers.getInt(4*1)) + buffersremoved.putInt(4*0, 2); + if (buffersremoved.getInt(4*0) == buffers.getInt(4*2)) + buffersremoved.putInt(4*0, 3); + if (buffersremoved.getInt(4*0) == buffers.getInt(4*3)) + buffersremoved.putInt(4*0, 4); else - buffersremoved[0] = 0; + buffersremoved.putInt(4*0, 0); - System.out.print("\nRemoved Buffer " + buffersremoved[0] + " from queue\n"); + System.out.print("\nRemoved Buffer " + buffersremoved.getInt(4*0) + " from queue\n"); } - buffersremoved = null; break; case 'B': // Unqueue first 2 Buffers - buffersremoved = new int[2]; - al.sourceUnqueueBuffers(source[0], 2, buffersremoved); + buffersremoved.clear(); + al.sourceUnqueueBuffers(source.getInt(4*0), 2, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) { @@ -1442,81 +1441,77 @@ { for (i = 0; i < 2; i++) { - if (buffersremoved[i] == buffers[0]) - buffersremoved[i] = 1; - else if (buffersremoved[i] == buffers[1]) - buffersremoved[i] = 2; - else if (buffersremoved[i] == buffers[2]) - buffersremoved[i] = 3; - else if (buffersremoved[i] == buffers[3]) - buffersremoved[i] = 4; + if (buffersremoved.getInt(4*i) == buffers.getInt(4*0)) + buffersremoved.putInt(4*i, 1); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*1)) + buffersremoved.putInt(4*i, 2); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*2)) + buffersremoved.putInt(4*i, 3); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*3)) + buffersremoved.putInt(4*i, 4); else - buffersremoved[i] = 0; + buffersremoved.putInt(4*i, 0); } - System.out.print("\nRemoved Buffers " + buffersremoved[0] + " and " + buffersremoved[1] + " from queue\n"); + System.out.print("\nRemoved Buffers " + buffersremoved.getInt(4*0) + " and " + buffersremoved.getInt(4*1) + " from queue\n"); } - - buffersremoved = null; break; case 'C': // Unqueue first 3 Buffers - buffersremoved = new int[3]; - al.sourceUnqueueBuffers(source[0], 3, buffersremoved); + buffersremoved.clear(); + al.sourceUnqueueBuffers(source.getInt(0), 3, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourceUnqueueBuffers 3 : ", error); } else { - for (i = 0; i < 3; i++) + for (i = 0; i < 2; i++) { - if (buffersremoved[i] == buffers[0]) - buffersremoved[i] = 1; - else if (buffersremoved[i] == buffers[1]) - buffersremoved[i] = 2; - else if (buffersremoved[i] == buffers[2]) - buffersremoved[i] = 3; - else if (buffersremoved[i] == buffers[3]) - buffersremoved[i] = 4; + if (buffersremoved.getInt(4*i) == buffers.getInt(4*0)) + buffersremoved.putInt(4*i, 1); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*1)) + buffersremoved.putInt(4*i, 2); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*2)) + buffersremoved.putInt(4*i, 3); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*3)) + buffersremoved.putInt(4*i, 4); else - buffersremoved[i] = 0; + buffersremoved.putInt(4*i, 0); } - System.out.print("\nRemoved Buffers " + buffersremoved[0] + - ", " + buffersremoved[1] + " and " + - buffersremoved[2] +" from queue\n"); + System.out.print("\nRemoved Buffers " + buffersremoved.getInt(4*0) + + ", " + buffersremoved.getInt(4*1) + " and " + + buffersremoved.getInt(4*2) +" from queue\n"); } - - buffersremoved = null; break; case 'D': // Unqueue first 4 Buffers - buffersremoved = new int[4]; - al.sourceUnqueueBuffers(source[0], 4, buffersremoved); + buffersremoved.clear(); + al.sourceUnqueueBuffers(source.getInt(4*0), 4, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourceUnqueueBuffers 1 : ", error); } else { - for (i = 0; i < 4; i++) + for (i = 0; i < 2; i++) { - if (buffersremoved[i] == buffers[0]) - buffersremoved[i] = 1; - else if (buffersremoved[i] == buffers[1]) - buffersremoved[i] = 2; - else if (buffersremoved[i] == buffers[2]) - buffersremoved[i] = 3; - else if (buffersremoved[i] == buffers[3]) - buffersremoved[i] = 4; + if (buffersremoved.getInt(4*i) == buffers.getInt(4*0)) + buffersremoved.putInt(4*i, 1); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*1)) + buffersremoved.putInt(4*i, 2); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*2)) + buffersremoved.putInt(4*i, 3); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*3)) + buffersremoved.putInt(4*i, 4); else - buffersremoved[i] = 0; + buffersremoved.putInt(4*i, 0); } - System.out.print("\nRemoved Buffers " + buffersremoved[0] + - ", " + buffersremoved[1] + - ", " + buffersremoved[2] + - "and " + buffersremoved[3] + + System.out.print("\nRemoved Buffers " + buffersremoved.getInt(4*0) + + ", " + buffersremoved.getInt(4*1) + + ", " + buffersremoved.getInt(4*2) + + "and " + buffersremoved.getInt(4*3) + " from queue\n"); } @@ -1524,80 +1519,81 @@ break; case 'E': // Unqueue first 5 Buffers - buffersremoved = new int[5]; - al.sourceUnqueueBuffers(source[0], 5, buffersremoved); + buffersremoved.clear(); + al.sourceUnqueueBuffers(source.getInt(4*0), 5, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) { displayALError("alSourceUnqueueBuffers 1 : ", error); } else { - for (i = 0; i < 5; i++) + for (i = 0; i < 2; i++) { - if (buffersremoved[i] == buffers[0]) - buffersremoved[i] = 1; - else if (buffersremoved[i] == buffers[1]) - buffersremoved[i] = 2; - else if (buffersremoved[i] == buffers[2]) - buffersremoved[i] = 3; - else if (buffersremoved[i] == buffers[3]) - buffersremoved[i] = 4; + if (buffersremoved.getInt(4*i) == buffers.getInt(4*0)) + buffersremoved.putInt(4*i, 1); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*1)) + buffersremoved.putInt(4*i, 2); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*2)) + buffersremoved.putInt(4*i, 3); + else if (buffersremoved.getInt(4*i) == buffers.getInt(4*3)) + buffersremoved.putInt(4*i, 4); else - buffersremoved[i] = 0; + buffersremoved.putInt(4*i, 0); } - System.out.print("\nRemoved Buffers " + buffersremoved[0] + - ", " + buffersremoved[1] + - ", " + buffersremoved[2] + - ", " + buffersremoved[3] + - "and " + buffersremoved[4] + + System.out.print("\nRemoved Buffers " + buffersremoved.getInt(4*0) + + ", " + buffersremoved.getInt(4*1) + + ", " + buffersremoved.getInt(4*2) + + ", " + buffersremoved.getInt(4*3) + + "and " + buffersremoved.getInt(4*4) + " from queue\n"); } buffersremoved = null; break; case 'F': - al.sourcei(source[0], AL.BUFFER, 0); + al.sourcei(source.getInt(4*0), AL.BUFFER, 0); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSource AL_BUFFER NULL : ", error); break; case '0': // Retrieve number of buffers in queue - al.getSourcei(source[0], AL.BUFFERS_QUEUED, Sys.getDirectBufferAddress(BuffersInQueue)); + al.getSourcei(source.getInt(4*0), AL.BUFFERS_QUEUED, Sys.getDirectBufferAddress(BuffersInQueue)); // Retrieve number of processed buffers - al.getSourcei(source[0], AL.BUFFERS_PROCESSED, Sys.getDirectBufferAddress(BuffersProcessed)); + al.getSourcei(source.getInt(4*0), AL.BUFFERS_PROCESSED, Sys.getDirectBufferAddress(BuffersProcessed)); // Retrieve current buffer - al.getSourcei(source[0], AL.BUFFER, Sys.getDirectBufferAddress(Buffer)); + al.getSourcei(source.getInt(4*0), AL.BUFFER, Sys.getDirectBufferAddress(Buffer)); int address = Buffer.getInt(); - if (address == buffers[0]) + if (address == buffers.getInt(4*0)) address = 1; - else if (address == buffers[1]) + else if (address == buffers.getInt(4*1)) address = 2; - else if (address == buffers[2]) + else if (address == buffers.getInt(4*2)) address = 3; - else if (address == buffers[3]) + else if (address == buffers.getInt(4*3)) address = 4; else address = 0; System.out.print("Current Buffer is " + address + ", " + BuffersInQueue.getInt() + " Buffers in queue, " + BuffersProcessed.getInt() + " Processed\n"); - + Buffer.clear(); + BuffersProcessed.clear(); + BuffersInQueue.clear(); break; } } while (ch != 'Q'); // Release resources - al.sourceStop(source[0]); + al.sourceStop(source.getInt(4*0)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceStop : ", error); - al.deleteSources(1, source); + al.deleteSources(1, Sys.getDirectBufferAddress(source)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alDeleteSources 1 : ", error); - */ } @@ -1833,8 +1829,8 @@ return; } - tbuffers.putInt(0, buffers.getInt(4*6)); - tbuffers.putInt(1, buffers.getInt(4*6)); + tbuffers.putInt(4*0, buffers.getInt(4*6)); + tbuffers.putInt(4*1, buffers.getInt(4*6)); System.out.print("Stereo Test\n"); System.out.print("Press '1' to play a stereo buffer on source 0 (looping)\n"); |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:11:49
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv7699 Modified Files: ALTest.java ALUTTest.java PlayTest.java Log Message: fix: now using ByteBuffer all the way 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.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALTest.java 28 Aug 2002 14:17:06 -0000 1.2 +++ ALTest.java 29 Aug 2002 01:11:46 -0000 1.3 @@ -57,7 +57,7 @@ public static final int NUM_BUFFERS = 7; /** buffers used */ - protected int[] buffers = new int[NUM_BUFFERS]; + protected ByteBuffer buffers; /** enumerations string */ protected String[] enumerationString = new String[]{ @@ -216,6 +216,9 @@ */ public ALTest() { [...1438 lines suppressed...] displayALError("alSourcePlay : ", error); @@ -1917,7 +2263,7 @@ } break; case '2': - al.sourceStopv(numSources, Sources); + al.sourceStopv(numSources, Sys.getDirectBufferAddress(Sources)); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceStopv : ", error); break; @@ -1925,7 +2271,7 @@ } while (ch != 'Q'); // Delete the Sources - al.deleteSources(numSources, Sources); + al.deleteSources(numSources, Sys.getDirectBufferAddress(Sources)); } /** Index: ALUTTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALUTTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/ALUTTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ALUTTest.java 27 Aug 2002 23:30:21 -0000 1.1 +++ ALUTTest.java 29 Aug 2002 01:11:46 -0000 1.2 @@ -31,15 +31,13 @@ */ package org.lwjgl.openal.test; +import org.lwjgl.Sys; import org.lwjgl.openal.AL; -import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; -import org.lwjgl.openal.ALUT; import org.lwjgl.openal.ALUTLoadWAVData; -import java.io.*; -import java.net.*; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + /** * $Id$ * @@ -73,16 +71,19 @@ alut.init(args); //create 1 buffer and 1 source - int[] buffers = new int[1]; - int[] sources = new int[1]; + ByteBuffer buffers = ByteBuffer.allocateDirect(4); + buffers.order(ByteOrder.nativeOrder()); + + ByteBuffer sources = ByteBuffer.allocateDirect(4); + sources.order(ByteOrder.nativeOrder()); // al generate buffers and sources - al.genBuffers(1, buffers); + al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } - al.genSources(1, sources); + al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -95,7 +96,7 @@ //copy to buffers - al.bufferData(buffers[0], file.format, file.data, file.size, file.freq); + al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -107,19 +108,19 @@ } //set up source input - al.sourcei(sources[0], AL.BUFFER, buffers[0]); + al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound - al.sourcei(sources[0], AL.LOOPING, AL.TRUE); + al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 - al.sourcePlay(sources[0]); + al.sourcePlay(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -132,18 +133,18 @@ } //stop source 0 - al.sourceStop(sources[0]); + al.sourceStop(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources - al.deleteSources(1, sources); + al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } - al.deleteBuffers(1, buffers); + al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- PlayTest.java 28 Aug 2002 22:31:15 -0000 1.6 +++ PlayTest.java 29 Aug 2002 01:11:46 -0000 1.7 @@ -31,13 +31,13 @@ */ package org.lwjgl.openal.test; +import org.lwjgl.Sys; import org.lwjgl.openal.AL; -import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; -import org.lwjgl.openal.ALUT; import org.lwjgl.openal.ALUTLoadWAVData; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + /** * $Id$ * @@ -71,16 +71,19 @@ alInitialize(); //create 1 buffer and 1 source - int[] buffers = new int[1]; - int[] sources = new int[1]; + ByteBuffer buffers = ByteBuffer.allocateDirect(4); + buffers.order(ByteOrder.nativeOrder()); + + ByteBuffer sources = ByteBuffer.allocateDirect(4); + sources.order(ByteOrder.nativeOrder()); // al generate buffers and sources - al.genBuffers(1, buffers); + al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } - al.genSources(1, sources); + al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -93,7 +96,7 @@ //copy to buffers - al.bufferData(buffers[0], file.format, file.data, file.size, file.freq); + al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -105,19 +108,19 @@ } //set up source input - al.sourcei(sources[0], AL.BUFFER, buffers[0]); + al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound - al.sourcei(sources[0], AL.LOOPING, AL.TRUE); + al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 - al.sourcePlay(sources[0]); + al.sourcePlay(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -130,18 +133,18 @@ } //stop source 0 - al.sourceStop(sources[0]); + al.sourceStop(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources - al.deleteSources(1, sources); + al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } - al.deleteBuffers(1, buffers); + al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } @@ -155,7 +158,7 @@ /** * main entry point - * + *+ * @param args String array containing arguments */ public static void main(String[] args) { |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:11:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv7610 Added Files: PlayTestMemory.java Log Message: initial import --- NEW FILE: PlayTestMemory.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/PlayTestMemory.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.test; import org.lwjgl.Sys; import org.lwjgl.openal.AL; import org.lwjgl.openal.ALUTLoadWAVData; import java.io.BufferedInputStream; import java.io.ByteArrayOutputStream; import java.net.MalformedURLException; import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; /** * $Id: PlayTestMemory.java,v 1.1 2002/08/29 01:11:25 matzon Exp $ * * This is a basic play test * Yes, over zealous use of getError ;) * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class PlayTestMemory extends BasicTest { /** * Creates an instance of PlayTestMemory */ public PlayTestMemory() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { if(args.length < 1) { System.out.println("please specify filename to play"); return; } int lastError; //initialize AL, using ALC alInitialize(); //create 1 buffer and 1 source ByteBuffer buffers = ByteBuffer.allocateDirect(4); buffers.order(ByteOrder.nativeOrder()); ByteBuffer sources = ByteBuffer.allocateDirect(4); sources.order(ByteOrder.nativeOrder()); // al generate buffers and sources al.genBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.genSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //load wave data ByteBuffer filebuffer = getData(args[0]); if(filebuffer == null) { System.out.println("Error loading file: " + args[0]); System.exit(-1); } ALUTLoadWAVData file = alut.loadWAVMemory(Sys.getDirectBufferAddress(filebuffer)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //copy to buffers al.bufferData(buffers.getInt(0), file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //unload file again alut.unloadWAV(file.format, file.data, file.size, file.freq); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //set up source input al.sourcei(sources.getInt(0), AL.BUFFER, buffers.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //lets loop the sound al.sourcei(sources.getInt(0), AL.LOOPING, AL.TRUE); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //play source 0 al.sourcePlay(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //wait 5 secs try { System.out.println("Waiting 5 seconds for sound to complete"); Thread.sleep(5000); } catch (InterruptedException inte) { } //stop source 0 al.sourceStop(sources.getInt(0)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //delete buffers and sources al.deleteSources(1, Sys.getDirectBufferAddress(sources)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers)); if((lastError = al.getError()) != AL.NO_ERROR) { exit(lastError); } //no errorchecking from now on, since our context is gone. //shutdown alc.makeContextCurrent(null); alc.destroyContext(context); alc.closeDevice(device); } /** * 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; URL url = null; String cwd = System.getProperty("user.dir"); try { url = new URL("file:///" + cwd + "/" + filename); } catch (MalformedURLException mue) { mue.printStackTrace(); } System.out.println("Attempting to load: " + url); try { BufferedInputStream bis = new BufferedInputStream(url.openStream()); 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(); buffer = ByteBuffer.allocateDirect(baos.size()); buffer.order(ByteOrder.nativeOrder()); buffer.put(baos.toByteArray()); } catch (Exception ioe) { ioe.printStackTrace(); } return buffer; } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { PlayTestMemory playTestMemory = new PlayTestMemory(); playTestMemory.execute(args); } } |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:11:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv7492 Modified Files: ALUT.java CoreAL.java Log Message: fix: now using ByteBuffer all the way 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ALUT.java 19 Aug 2002 14:02:54 -0000 1.5 +++ ALUT.java 29 Aug 2002 01:11:03 -0000 1.6 @@ -73,10 +73,10 @@ /** * Loads a byte buffer into memory * - * @param buffer byte buffer containing file + * @param buffer buffer address containing file * @return ALUTLoadWAVData object containing information regarding wave data loaded */ - public native ALUTLoadWAVData loadWAVMemory(byte[] buffer); + public native ALUTLoadWAVData loadWAVMemory(int buffer); /** * Unloads the specified file from memory 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.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CoreAL.java 19 Aug 2002 13:55:23 -0000 1.7 +++ CoreAL.java 29 Aug 2002 01:11:03 -0000 1.8 @@ -255,7 +255,7 @@ * @param n number of sources to generate * @param sources array holding sources */ - public native void genSources(int n, int[] sources); + public native void genSources(int n, int sources); /** * Delete one or more sources. @@ -263,7 +263,7 @@ * @param n Number of sources to delete * @param source Source array to delete from */ - public native void deleteSources(int n, int[] source); + public native void deleteSources(int n, int source); /** * Tests if a source is valid. @@ -355,7 +355,7 @@ * @param n number of sources to play * @param source array of sources to play */ - public native void sourcePlayv(int n, int[] sources); + public native void sourcePlayv(int n, int sources); /** * Pauses a set of sources. @@ -363,7 +363,7 @@ * @param n number of sources to pause * @param source array of sources to pause */ - public native void sourcePausev(int n, int[] sources); + public native void sourcePausev(int n, int sources); /** * Stops a set of sources. @@ -371,7 +371,7 @@ * @param n number of sources to stop * @param source array of sources to stop */ - public native void sourceStopv(int n, int[] sources); + public native void sourceStopv(int n, int sources); /** * Rewinds a set of sources. @@ -379,7 +379,7 @@ * @param n number of sources to rewind * @param source array of sources to rewind */ - public native void sourceRewindv(int n, int[] sources); + public native void sourceRewindv(int n, int sources); /** * Play a source. @@ -415,7 +415,7 @@ * @param n number of buffers to generate * @param buffers array holding buffers */ - public native void genBuffers(int n, int[] buffers); + public native void genBuffers(int n, int buffers); /** * Delete one or more buffers. @@ -423,7 +423,7 @@ * @param n Number of buffers to delete * @param buffers Buffer array to delete from */ - public native void deleteBuffers(int n, int[] buffers); + public native void deleteBuffers(int n, int buffers); /** * Tests if buffer is valid. @@ -469,7 +469,7 @@ * @param n number of buffers to be queued * @param buffers buffers to be queued */ - public native void sourceQueueBuffers(int source, int n, int[] buffers); + public native void sourceQueueBuffers(int source, int n, int buffers); /** * Unqueues a set of buffers attached to a source. @@ -478,7 +478,7 @@ * @param n number of buffers to be unqueued * @param buffers buffers to be unqueued */ - public native void sourceUnqueueBuffers(int source, int n, int[] buffers); + public native void sourceUnqueueBuffers(int source, int n, int buffers); /** * Selects the OpenAL distance model. |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:09:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv7132 Modified Files: org_lwjgl_openal_CoreAL.h Log Message: fix: now using ByteBuffer all the way Index: org_lwjgl_openal_CoreAL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_CoreAL.h 19 Aug 2002 13:54:14 -0000 1.5 +++ org_lwjgl_openal_CoreAL.h 29 Aug 2002 01:09:48 -0000 1.6 @@ -242,18 +242,18 @@ /* * Class: org_lwjgl_openal_CoreAL * Method: genSources - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genSources - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: deleteSources - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteSources - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -330,34 +330,34 @@ /* * Class: org_lwjgl_openal_CoreAL * Method: sourcePlayv - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlayv - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: sourcePausev - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePausev - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: sourceStopv - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStopv - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: sourceRewindv - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewindv - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -394,18 +394,18 @@ /* * Class: org_lwjgl_openal_CoreAL * Method: genBuffers - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genBuffers - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: deleteBuffers - * Signature: (I[I)V + * Signature: (II)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteBuffers - (JNIEnv *, jobject, jint, jintArray); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_CoreAL @@ -442,18 +442,18 @@ /* * Class: org_lwjgl_openal_CoreAL * Method: sourceQueueBuffers - * Signature: (II[I)V + * Signature: (III)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceQueueBuffers - (JNIEnv *, jobject, jint, jint, jintArray); + (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_lwjgl_openal_CoreAL * Method: sourceUnqueueBuffers - * Signature: (II[I)V + * Signature: (III)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceUnqueueBuffers - (JNIEnv *, jobject, jint, jint, jintArray); + (JNIEnv *, jobject, jint, jint, jint); /* * Class: org_lwjgl_openal_CoreAL |
|
From: Brian M. <ma...@us...> - 2002-08-29 01:09:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv7032 Modified Files: org_lwjgl_openal_CoreAL.cpp Log Message: fix: now using ByteBuffer all the way Index: org_lwjgl_openal_CoreAL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_CoreAL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_CoreAL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_openal_CoreAL.cpp 26 Aug 2002 18:23:11 -0000 1.3 +++ org_lwjgl_openal_CoreAL.cpp 29 Aug 2002 01:09:22 -0000 1.4 @@ -354,10 +354,8 @@ * C Specification: * ALvoid alGenSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genSources (JNIEnv *env, jobject obj, jint n, jintArray sources) { - int* array = (int*) env->GetIntArrayElements(sources, 0); - alGenSources(n, (ALuint*) array); - env->ReleaseIntArrayElements(sources, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genSources (JNIEnv *env, jobject obj, jint n, jint sources) { + alGenSources(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -367,10 +365,8 @@ * C Specification: * ALvoid alDeleteSources(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteSources (JNIEnv *env, jobject obj, jint n, jintArray source) { - int* array = (int*) env->GetIntArrayElements(source, 0); - alDeleteSources(n, (ALuint*) array); - env->ReleaseIntArrayElements(source, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteSources (JNIEnv *env, jobject obj, jint n, jint sources) { + alDeleteSources(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -479,10 +475,8 @@ * C Specification: * ALvoid alSourcePlayv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlayv (JNIEnv *env, jobject obj, jint n, jintArray sources) { - int* array = (int*) env->GetIntArrayElements(sources, 0); - alSourcePlayv(n, (ALuint*) array); - env->ReleaseIntArrayElements(sources, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlayv (JNIEnv *env, jobject obj, jint n, jint sources) { + alSourcePlayv(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -492,10 +486,8 @@ * C Specification: * ALvoid alSourcePausev(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePausev (JNIEnv *env, jobject obj, jint n, jintArray sources) { - int* array = (int*) env->GetIntArrayElements(sources, 0); - alSourcePausev(n, (ALuint*) array); - env->ReleaseIntArrayElements(sources, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePausev (JNIEnv *env, jobject obj, jint n, jint sources) { + alSourcePausev(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -505,10 +497,8 @@ * C Specification: * ALvoid alSourceStopv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStopv (JNIEnv *env, jobject obj, jint n, jintArray sources) { - int* array = (int*) env->GetIntArrayElements(sources, 0); - alSourceStopv(n, (ALuint*) array); - env->ReleaseIntArrayElements(sources, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStopv (JNIEnv *env, jobject obj, jint n, jint sources) { + alSourceStopv(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -518,10 +508,8 @@ * C Specification: * ALvoid alSourceRewindv(ALsizei n,ALuint *sources); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewindv (JNIEnv *env, jobject obj, jint n, jintArray sources) { - int* array = (int*) env->GetIntArrayElements(sources, 0); - alSourceRewindv(n, (ALuint*) array); - env->ReleaseIntArrayElements(sources, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewindv (JNIEnv *env, jobject obj, jint n, jint sources) { + alSourceRewindv(n, (ALuint*) sources); CHECK_AL_ERROR } @@ -575,10 +563,8 @@ * C Specification: * ALvoid alGenBuffers(ALsizei n,ALuint *buffers); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genBuffers (JNIEnv *env, jobject obj, jint n, jintArray buffers) { - int* array = (int*) env->GetIntArrayElements(buffers, 0); - alGenBuffers(n, (ALuint*) array); - env->ReleaseIntArrayElements(buffers, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genBuffers (JNIEnv *env, jobject obj, jint n, jint buffers) { + alGenBuffers(n, (ALuint*) buffers); CHECK_AL_ERROR } @@ -588,10 +574,8 @@ * C Specification: * ALvoid alDeleteBuffers(ALsizei n,ALuint *buffers); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteBuffers (JNIEnv *env, jobject obj, jint n, jintArray buffer) { - int* array = (int*) env->GetIntArrayElements(buffer, 0); - alDeleteBuffers(n, (ALuint*) array); - env->ReleaseIntArrayElements(buffer, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteBuffers (JNIEnv *env, jobject obj, jint n, jint buffers) { + alDeleteBuffers(n, (ALuint*) buffers); CHECK_AL_ERROR } @@ -647,10 +631,8 @@ * C Specification: * ALvoid alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceQueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jintArray buffers) { - int* array = (int*) env->GetIntArrayElements(buffers, 0); - alSourceQueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) array); - env->ReleaseIntArrayElements(buffers, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceQueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jint buffers) { + alSourceQueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) buffers); CHECK_AL_ERROR } @@ -660,10 +642,8 @@ * C Specification: * ALvoid alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceUnqueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jintArray buffers) { - int* array = (int*) env->GetIntArrayElements(buffers, 0); - alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) array); - env->ReleaseIntArrayElements(buffers, (jint*) array, 0); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceUnqueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jint buffers) { + alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) buffers); CHECK_AL_ERROR } |