You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Brian M. <ma...@us...> - 2002-08-30 22:16:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv19410/org/lwjgl/openal/test Modified Files: EAXTest.java Log Message: add: small output line to tell that EAX is possible Index: EAXTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/EAXTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/EAXTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EAXTest.java 30 Aug 2002 21:30:40 -0000 1.1 +++ EAXTest.java 30 Aug 2002 22:15:57 -0000 1.2 @@ -59,7 +59,9 @@ eax.create(); } catch (Exception e) { e.printStackTrace(); + return; } + System.out.println("EAX supported..."); } /** |
From: Brian M. <ma...@us...> - 2002-08-30 21:45:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv9541 Modified Files: org_lwjgl_opengl_CoreEAX.cpp Log Message: fix: actually set Listener & Buffer GUID's Index: org_lwjgl_opengl_CoreEAX.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreEAX.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreEAX.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_CoreEAX.cpp 30 Aug 2002 21:27:40 -0000 1.1 +++ org_lwjgl_opengl_CoreEAX.cpp 30 Aug 2002 21:45:48 -0000 1.2 @@ -104,6 +104,21 @@ #endif } +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreEAX_setGUID (JNIEnv *env, jobject obj) { +#ifdef _WIN32 + //get class/fields + jclass eax_class = env->FindClass("org/lwjgl/openal/CoreEAX"); + jfieldID eaxBuffer_field = env->GetStaticFieldID(eax_class, "BUFFER_GUID", "I"); + jfieldID eaxListener_field = env->GetStaticFieldID(eax_class, "LISTENER_GUID", "I"); + + //set fields + env->SetStaticIntField(eax_class, eaxBuffer_field, (jint) &DSPROPSETID_EAX20_BufferProperties); + env->SetStaticIntField(eax_class, eaxListener_field, (jint) &DSPROPSETID_EAX20_ListenerProperties); +#else + ThrowException(env, "EAX extensions not supported"); +#endif +} + /* * This function retrieves an EAX value. * |
From: Brian M. <ma...@us...> - 2002-08-30 21:45:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv9418 Modified Files: org_lwjgl_openal_CoreEAX.h Log Message: fix: actually set Listener & Buffer GUID's Index: org_lwjgl_openal_CoreEAX.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreEAX.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreEAX.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_openal_CoreEAX.h 30 Aug 2002 21:26:30 -0000 1.1 +++ org_lwjgl_openal_CoreEAX.h 30 Aug 2002 21:45:28 -0000 1.2 @@ -52,6 +52,14 @@ /* * Class: org_lwjgl_openal_CoreEAX + * Method: setGUID + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreEAX_setGUID + (JNIEnv *, jobject); + +/* + * Class: org_lwjgl_openal_CoreEAX * Method: eaxGet * Signature: (IIIII)I */ |
From: Brian M. <ma...@us...> - 2002-08-30 21:45:09
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv9281 Modified Files: BaseEAX.java CoreEAX.java Log Message: fix: actually set Listener & Buffer GUID's Index: BaseEAX.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAX.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAX.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BaseEAX.java 30 Aug 2002 21:30:09 -0000 1.1 +++ BaseEAX.java 30 Aug 2002 21:45:04 -0000 1.2 @@ -45,12 +45,6 @@ */ public abstract class BaseEAX { - /** GUID for buffer */ - public static int BUFFER_GUID; - - /** GUID for listener */ - public static int LISTENER_GUID; - /** Has the EAX object been created? */ protected static boolean created; Index: CoreEAX.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreEAX.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreEAX.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CoreEAX.java 30 Aug 2002 21:30:09 -0000 1.1 +++ CoreEAX.java 30 Aug 2002 21:45:04 -0000 1.2 @@ -41,6 +41,12 @@ */ public class CoreEAX extends BaseEAX implements BaseEAXConstants { + /** GUID for buffer */ + public static int BUFFER_GUID; + + /** GUID for listener */ + public static int LISTENER_GUID; + /** Creates a new instance of CoreEAX */ public CoreEAX() { } @@ -50,12 +56,18 @@ */ protected void init() { determineAvailableExtensions(); + setGUID(); } /** * Determines available EAX extensions */ protected native void determineAvailableExtensions(); + + /** + * Sets the GUID's for the buffer and listener objects + */ + protected native void setGUID(); /** * Retrieves an EAX Value |
From: Brian M. <ma...@us...> - 2002-08-30 21:30:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv3768 Added Files: EAXTest.java Log Message: add: first stab at EAX support --- NEW FILE: EAXTest.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test/EAXTest.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.openal.EAX; /** * $Id: EAXTest.java,v 1.1 2002/08/30 21:30:40 matzon Exp $ * * This test initializes EAX and tries to get and set some EAX values * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAXTest extends BasicTest { /** * Creates an instance of EAXTest */ public EAXTest() { super(); } /** * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { EAX eax = new EAX(); try { eax.create(); } catch (Exception e) { e.printStackTrace(); } } /** * main entry point * * @param args String array containing arguments */ public static void main(String[] args) { EAXTest eaxTest = new EAXTest(); eaxTest.execute(args); } } |
From: Brian M. <ma...@us...> - 2002-08-30 21:30:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv3612 Added Files: BaseEAX.java BaseEAXConstants.java CoreEAX.java EAX.java Log Message: add: first stab at EAX support --- NEW FILE: BaseEAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAX.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal; /** * $Id: BaseEAX.java,v 1.1 2002/08/30 21:30:09 matzon Exp $ * * The base OpenAL EAX functionality. * * This has been provided as a base class that we can use for either the * full EAX specification or as a cut-down OpenAL EAX embedded spec. (aka * a mini-driver). * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public abstract class BaseEAX { /** GUID for buffer */ public static int BUFFER_GUID; /** GUID for listener */ public static int LISTENER_GUID; /** Has the EAX object been created? */ protected static boolean created; static { initialize(); } /** * Override to provide any initialization code after creation. */ protected void init() { } /** * Static initialization */ private static void initialize() { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } /** * Loads the EAX functions * * @throws Exception if the EAX extensions couldn't be loaded */ public void create() throws Exception { if (created) { return; } if (!nCreate()) { throw new Exception("EAX instance could not be created."); } created = true; init(); } /** * Native method to create EAX instance * * @return true if the EAX extensions could be found */ protected native boolean nCreate(); /** * "Destroy" the EAX object */ public void destroy() { if (!created) { return; } created = false; nDestroy(); } /** * Native method the destroy the EAX */ protected native void nDestroy(); } --- NEW FILE: BaseEAXConstants.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseEAXConstants.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal; /** * $Id: BaseEAXConstants.java,v 1.1 2002/08/30 21:30:09 matzon Exp $ * * This class implements the basic EAX extension constants. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public interface BaseEAXConstants { //add some... } --- NEW FILE: CoreEAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/CoreEAX.java /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.openal; /** * $Id: CoreEAX.java,v 1.1 2002/08/30 21:30:09 matzon Exp $ * * This is the OpenAL EAX class. It extends the latest core. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class CoreEAX extends BaseEAX implements BaseEAXConstants { /** Creates a new instance of CoreEAX */ public CoreEAX() { } /** * Load extensions */ protected void init() { determineAvailableExtensions(); } /** * Determines available EAX extensions */ protected native void determineAvailableExtensions(); /** * Retrieves an EAX Value * * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) * @param property property being queried * @param source the source to be queried * @param data address to write value to * @param size size of area being written to * @return OpenAL Error code */ public native int eaxGet(int propertySetID, int property, int source, int data, int size); /** * Sets an EAX Value * * @param propertySetID adress to the property set GUID of the object being queried (a listener or a source) * @param property property being queried * @param source the source to be queried * @param data address to write value to * @param size size of area being written to * @return OpenAL Error code */ public native int eaxSet(int propertySetID, int property, int source, int data, int size); } --- NEW FILE: EAX.java --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/EAX.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; /** * $Id: EAX.java,v 1.1 2002/08/30 21:30:09 matzon Exp $ * * This is the OpenAL EAX class. It extends the latest core. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ public class EAX extends CoreEAX { /** * Nothing to se here - please move along */ public EAX() { } } |
From: Brian M. <ma...@us...> - 2002-08-30 21:29:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory usw-pr-cvs1:/tmp/cvs-serv3311 Modified Files: ALConstants.java Log Message: fix: constants cleanup Index: ALConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALConstants.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALConstants.java 15 Aug 2002 15:14:42 -0000 1.2 +++ ALConstants.java 30 Aug 2002 21:29:23 -0000 1.3 @@ -39,5 +39,5 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -public interface ALConstants extends BaseALConstants, EAXALConstants { +public interface ALConstants extends BaseALConstants, BaseEAXConstants { } |
From: Brian M. <ma...@us...> - 2002-08-30 21:27:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv2916 Added Files: extal.c org_lwjgl_opengl_BaseEAX.cpp org_lwjgl_opengl_CoreEAX.cpp Log Message: add: first stab at EAX support --- NEW FILE: extal.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/extal.c /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "extal.h" /** * $Id: extal.c,v 1.1 2002/08/30 21:27:40 matzon Exp $ * * This file contains the AL extension assigning mechanism * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ --- NEW FILE: org_lwjgl_opengl_BaseEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_BaseEAX.h" /* * Class: org_lwjgl_openal_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseEAX_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseEAX_nDestroy (JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_opengl_CoreEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_CoreEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_CoreEAX.cpp,v 1.1 2002/08/30 21:27:40 matzon Exp $ * * This is the actual JNI implementation of the OpenAL EAX library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_CoreEAX.h" #include "checkALerror.h" #include "extal.h" /** * Throws an OAL exception with the specified message */ void ThrowException(JNIEnv *env, const char* message) { jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); env->ThrowNew(cls, message); } /* * Determines available EAX extensions */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; ALCcontext *Context; ALCdevice *Device; //open device Device = alcOpenDevice(NULL); if(Device == NULL) { ThrowException(env, "Unable to determine EAX Extensions"); return; } //create a context Context = alcCreateContext(Device, NULL); if(Context == NULL) { alcCloseDevice(Device); ThrowException(env, "Unable to determine EAX Extensions"); return; } //make current alcMakeContextCurrent(Context); if(alGetError() != AL_NO_ERROR) { alcCloseDevice(Device); ThrowException(env, "Unable to determine EAX Extensions"); return; } //check for extension, and assign if available if(alIsExtensionPresent((ALubyte*) "EAX")) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); } //clean up alcMakeContextCurrent(NULL); alcDestroyContext(Context); alcCloseDevice(Device); //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); } #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function retrieves an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreEAX_eaxGet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } /* * This function sets an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifndef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else return AL_INVALID_OPERATION; #endif } |
From: Brian M. <ma...@us...> - 2002-08-30 21:26:34
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv2645 Added Files: extal.h org_lwjgl_openal_BaseEAX.h org_lwjgl_openal_CoreEAX.h Log Message: add: first stab at EAX support --- NEW FILE: extal.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifdef _WIN32 #ifndef _AL_TEST_H #define _AL_TEST_H #define INITGUID #define OPENAL #include <windows.h> #include <al.h> #include <alc.h> #include <eax.h> EAXSet eaxSet; // EAXSet function, retrieved if EAX Extension is supported EAXGet eaxGet; // EAXGet function, retrieved if EAX Extension is supported #endif #endif --- NEW FILE: org_lwjgl_openal_BaseEAX.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseEAX.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_BaseEAX */ #ifndef _Included_org_lwjgl_openal_BaseEAX #define _Included_org_lwjgl_openal_BaseEAX #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: BUFFER_GUID */ /* Inaccessible static: LISTENER_GUID */ /* Inaccessible static: created */ /* * Class: org_lwjgl_openal_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseEAX_nCreate (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseEAX_nDestroy (JNIEnv *, jobject); #ifdef __cplusplus } #endif #endif --- NEW FILE: org_lwjgl_openal_CoreEAX.h --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreEAX.h /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_CoreEAX */ #ifndef _Included_org_lwjgl_openal_CoreEAX #define _Included_org_lwjgl_openal_CoreEAX #ifdef __cplusplus extern "C" { #endif /* Inaccessible static: BUFFER_GUID */ /* Inaccessible static: LISTENER_GUID */ /* Inaccessible static: created */ /* * Class: org_lwjgl_openal_CoreEAX * Method: determineAvailableExtensions * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreEAX_determineAvailableExtensions (JNIEnv *, jobject); /* * Class: org_lwjgl_openal_CoreEAX * Method: eaxGet * Signature: (IIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreEAX_eaxGet (JNIEnv *, jobject, jint, jint, jint, jint, jint); /* * Class: org_lwjgl_openal_CoreEAX * Method: eaxSet * Signature: (IIIII)I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreEAX_eaxSet (JNIEnv *, jobject, jint, jint, jint, jint, jint); #ifdef __cplusplus } #endif #endif |
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 } |
From: Brian M. <ma...@us...> - 2002-08-28 23:41:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv18308 Modified Files: org_lwjgl_openal_ALUT.cpp Log Message: fix: don't check for errors after the exit! - will crash since no current context Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_ALUT.cpp 28 Aug 2002 22:46:54 -0000 1.6 +++ org_lwjgl_openal_ALUT.cpp 28 Aug 2002 23:41:05 -0000 1.7 @@ -202,5 +202,4 @@ */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_exit (JNIEnv *env, jobject obj) { alutExit(); - CHECK_AL_ERROR } |
From: Brian M. <ma...@us...> - 2002-08-28 22:46:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory usw-pr-cvs1:/tmp/cvs-serv4170 Modified Files: org_lwjgl_openal_ALUT.cpp Log Message: fix: now uses ByteBuffer address to load buffer when using alutLoadWAVMemory fix: minor cleanup Index: org_lwjgl_openal_ALUT.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_openal_ALUT.cpp 26 Aug 2002 18:23:11 -0000 1.5 +++ org_lwjgl_openal_ALUT.cpp 28 Aug 2002 22:46:54 -0000 1.6 @@ -106,7 +106,7 @@ /* class type to find */ jclass alutLoadWAVFile_class = NULL; - /* method id - will be set to constructor of alutLoadWAVFile */ + /* method id - will be set to constructor of alutLoadWAVData */ jmethodID methodID = NULL; /* sound data vars */ @@ -141,7 +141,7 @@ * ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei * *size,ALsizei *freq,ALboolean *loop) */ -JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVMemory (JNIEnv *env, jobject obj, jbyteArray buffer) { +JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVMemory (JNIEnv *env, jobject obj, jint buffer) { /* * NOTE: Since Java doesn't support modification of supplied @@ -158,17 +158,16 @@ /* class type to find */ jclass alutLoadWAVFile_class = NULL; - /* method id - will be set to constructor of alutLoadWAVFile */ + /* method id - will be set to constructor of alutLoadWAVData */ jmethodID methodID = NULL; /* sound data vars */ jint format, size, freq; jboolean loop; void* data; - ALbyte* bufferlocation = (ALbyte*) (env->GetByteArrayElements(buffer, 0)); - + /* load wave from mem */ - alutLoadWAVMemory(bufferlocation, (ALenum*) &format, (void**) &data, (ALsizei*) &size, (ALsizei*) &freq, (ALboolean*) &loop); + alutLoadWAVMemory((ALbyte*) buffer, (ALenum*) &format, (void**) &data, (ALsizei*) &size, (ALsizei*) &freq, (ALboolean*) &loop); /* get class */ alutLoadWAVFile_class = env->FindClass("org/lwjgl/openal/ALUTLoadWAVData"); @@ -178,9 +177,6 @@ /* create object */ alutLoadWAVFile_object = env->NewObject(alutLoadWAVFile_class, methodID, format, (int) data, size, freq, loop); - - /* release bytearray again */ - env->ReleaseByteArrayElements(buffer, (jbyte*) bufferlocation, 0); CHECK_AL_ERROR return alutLoadWAVFile_object; |
From: Brian M. <ma...@us...> - 2002-08-28 22:45:50
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory usw-pr-cvs1:/tmp/cvs-serv3867 Modified Files: org_lwjgl_openal_ALUT.h Log Message: fix: now uses ByteBuffer address to load buffer when using alutLoadWAVMemory Index: org_lwjgl_openal_ALUT.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_openal_ALUT.h 18 Aug 2002 13:41:35 -0000 1.4 +++ org_lwjgl_openal_ALUT.h 28 Aug 2002 22:45:46 -0000 1.5 @@ -50,7 +50,7 @@ /* * Class: org_lwjgl_openal_ALUT * Method: loadWAVFile - * Signature: (Ljava/lang/String;)Lorg/lwjgl/openal/ALUTLoadWAVFile; + * Signature: (Ljava/lang/String;)Lorg/lwjgl/openal/ALUTLoadWAVData; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVFile (JNIEnv *, jobject, jstring); @@ -58,10 +58,10 @@ /* * Class: org_lwjgl_openal_ALUT * Method: loadWAVMemory - * Signature: ([B)Lorg/lwjgl/openal/ALUTLoadWAVFile; + * Signature: (I)Lorg/lwjgl/openal/ALUTLoadWAVData; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVMemory - (JNIEnv *, jobject, jbyteArray); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALUT |
From: Brian M. <ma...@us...> - 2002-08-28 22:31:19
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/test In directory usw-pr-cvs1:/tmp/cvs-serv32138/org/lwjgl/openal/test Modified Files: PlayTest.java Log Message: rem: not needed imports 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.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- PlayTest.java 27 Aug 2002 23:28:52 -0000 1.5 +++ PlayTest.java 28 Aug 2002 22:31:15 -0000 1.6 @@ -38,8 +38,6 @@ import org.lwjgl.openal.ALUT; import org.lwjgl.openal.ALUTLoadWAVData; -import java.io.*; -import java.net.*; /** * $Id$ * |
From: Caspian Rychlik-P. <ci...@us...> - 2002-08-28 21:58:18
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory usw-pr-cvs1:/tmp/cvs-serv21286/src/java/org/lwjgl/input Modified Files: Joystick.java Mouse.java Keyboard.java Log Message: Stuff Index: Joystick.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Joystick.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Joystick.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Joystick.java 26 Aug 2002 21:05:20 -0000 1.6 +++ Joystick.java 28 Aug 2002 21:58:14 -0000 1.7 @@ -179,6 +179,19 @@ } /** + * See if a particular mouse button is down. + * + * @param button The index of the button you wish to test (0..getNumButtons()) + * @return true if the specified button is down + * @see #getNumButtons() + */ + public static boolean isButtonDown(int button) { + assert created : "The joystick has not been created."; + return Joystick.button[button]; + } + + + /** * Native implementation of hasZValue() */ private static native boolean nHasZValue(); Index: Mouse.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Mouse.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Mouse.java 26 Aug 2002 21:05:20 -0000 1.8 +++ Mouse.java 28 Aug 2002 21:58:14 -0000 1.9 @@ -182,6 +182,18 @@ private static native boolean nHasZValue(); /** + * See if a particular mouse button is down. + * + * @param button The index of the button you wish to test (0..getNumButtons()) + * @return true if the specified button is down + * @see #getNumButtons() + */ + public static boolean isButtonDown(int button) { + assert created : "The mouse has not been created."; + return Mouse.button[button]; + } + + /** * Enable mouse buffering. Must be called after the mouse is created. * @return the size of the mouse buffer in events, or 0 if no buffering * can be enabled for any reason Index: Keyboard.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Keyboard.java 26 Aug 2002 21:05:20 -0000 1.8 +++ Keyboard.java 28 Aug 2002 21:58:14 -0000 1.9 @@ -173,6 +173,128 @@ public static final int KEY_POWER = 0xDE; public static final int KEY_SLEEP = 0xDF; + // Maps keycodes to ascii characters + private static final char map[] = + { + 0, + 0, + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '0', + '-', + '=', + 0, + 0, + 'q', + 'w', + 'e', + 'r', + 't', + 'y', + 'u', + 'i', + 'o', + 'p', + '[', + ']', + '*', + '*', + 'a', + 's', + 'd', + 'f', + 'g', + 'h', + 'j', + 'k', + 'l', + ';', + '\'', + '#', + '*', + '\\', + 'z', + 'x', + 'c', + 'v', + 'b', + 'n', + 'm', + ',', + '.', + '/', + '*', + '*', + '*', + ' ' }; + private static final char shiftMap[] = + { + 0, + 0, + '!', + '"', + '*', + '$', + '%', + '^', + '&', + '*', + '(', + ')', + '_', + '+', + '*', + '*', + 'Q', + 'W', + 'E', + 'R', + 'T', + 'Y', + 'U', + 'I', + 'O', + 'P', + '{', + '}', + 0, + 0, + 'A', + 'S', + 'D', + 'F', + 'G', + 'H', + 'J', + 'K', + 'L', + ':', + '@', + '~', + 0, + '|', + 'Z', + 'X', + 'C', + 'V', + 'B', + 'N', + 'M', + '<', + '>', + '?', + 0, + 0, + 0, + ' ' }; + static { initialize(); } @@ -343,5 +465,23 @@ } else return false; + } + + /** + * Maps a keycode to a character. + * @param keyCode The keycode + * @return the corresponding ASCII character or 0 if no mapping is possible + */ + public static char map(int keyCode) { + char c; + + if (keyCode < 0 || keyCode >= map.length) + return 0; + else if (isKeyDown(KEY_LSHIFT) || isKeyDown(KEY_RSHIFT)) { + c = shiftMap[keyCode]; + } else { + c = map[keyCode]; + } + return c; } } |