You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
|
2
|
3
(8) |
4
|
5
|
|
6
|
7
(5) |
8
|
9
(1) |
10
|
11
|
12
|
|
13
(1) |
14
(1) |
15
|
16
(1) |
17
|
18
|
19
|
|
20
|
21
|
22
|
23
|
24
|
25
|
26
(4) |
|
27
(9) |
28
(7) |
29
|
30
(1) |
|
|
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv11159 Modified Files: Matrix.java Matrix2f.java Matrix3f.java Matrix4f.java Vector.java Vector2f.java Vector3f.java Vector4f.java Log Message: fix: added Serializable interface to allow serialization Index: Matrix.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Matrix.java 21 Dec 2002 12:37:20 -0000 1.5 +++ Matrix.java 30 Apr 2003 15:38:11 -0000 1.6 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; /** @@ -42,7 +43,7 @@ * @author cix_foo <ci...@us...> * @version $Revision$ */ -public abstract class Matrix { +public abstract class Matrix implements Serializable { /** * Constructor for Matrix. Index: Matrix2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix2f.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Matrix2f.java 21 Dec 2002 12:37:20 -0000 1.10 +++ Matrix2f.java 30 Apr 2003 15:38:12 -0000 1.11 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; /** @@ -42,7 +43,7 @@ * @version $Revision$ */ -public class Matrix2f extends Matrix { +public class Matrix2f extends Matrix implements Serializable { public float m00 = 1.0f, m01, m10, m11 = 1.0f; Index: Matrix3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix3f.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Matrix3f.java 21 Dec 2002 12:37:20 -0000 1.12 +++ Matrix3f.java 30 Apr 2003 15:38:12 -0000 1.13 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; /** @@ -42,7 +43,7 @@ * @version $Revision$ */ -public class Matrix3f extends Matrix { +public class Matrix3f extends Matrix implements Serializable { public float m00 = 1.0f, m01, Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Matrix4f.java 28 Apr 2003 12:10:54 -0000 1.14 +++ Matrix4f.java 30 Apr 2003 15:38:12 -0000 1.15 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -32,6 +32,8 @@ package org.lwjgl.vector; import org.lwjgl.Math; + +import java.io.Serializable; import java.nio.FloatBuffer; /** @@ -39,7 +41,7 @@ * * @author foo */ -public class Matrix4f extends Matrix { +public class Matrix4f extends Matrix implements Serializable { public float m00 = 1.0f, m01, m02, m03, m10, m11 = 1.0f, m12, m13, m20, m21, m22 = 1.0f, m23, m30, m31, m32, m33 = 1.0f; Index: Vector.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Vector.java 22 Dec 2002 19:53:41 -0000 1.5 +++ Vector.java 30 Apr 2003 15:38:13 -0000 1.6 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002 Light Weight Java Game Library Project + * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; import org.lwjgl.Math; @@ -43,7 +44,7 @@ * @author cix_foo <ci...@us...> * @version $Revision$ */ -public abstract class Vector { +public abstract class Vector implements Serializable { /** * Constructor for Vector. Index: Vector2f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector2f.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Vector2f.java 21 Dec 2002 12:37:20 -0000 1.8 +++ Vector2f.java 30 Apr 2003 15:38:13 -0000 1.9 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; import org.lwjgl.Math; @@ -44,7 +45,7 @@ * @version $Revision$ */ -public class Vector2f extends Vector { +public class Vector2f extends Vector implements Serializable { public float x, y; Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Vector3f.java 9 Apr 2003 15:24:27 -0000 1.11 +++ Vector3f.java 30 Apr 2003 15:38:13 -0000 1.12 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; import org.lwjgl.Math; @@ -44,7 +45,7 @@ * @version $Revision$ */ -public class Vector3f extends Vector { +public class Vector3f extends Vector implements Serializable { public float x, y, z; Index: Vector4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector4f.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- Vector4f.java 21 Dec 2002 12:37:20 -0000 1.8 +++ Vector4f.java 30 Apr 2003 15:38:14 -0000 1.9 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import java.io.Serializable; import java.nio.FloatBuffer; import org.lwjgl.Math; @@ -44,7 +45,7 @@ * @version $Revision$ */ -public class Vector4f extends Vector { +public class Vector4f extends Vector implements Serializable { public float x, y, z, w; |
|
From: Brian M. <ma...@us...> - 2003-04-28 22:47:28
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv29951 Modified Files: AL.java Log Message: fix: call base destroy fix: null references Index: AL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- AL.java 28 Apr 2003 21:50:11 -0000 1.7 +++ AL.java 28 Apr 2003 22:43:27 -0000 1.8 @@ -123,6 +123,12 @@ alc.destroyContext(context.context); alc.closeDevice(device.device); alc.destroy(); + + alc = null; + device = null; + context = null; + + super.destroy(); } /** |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-04-28 21:50:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv2985a/src/java/org/lwjgl/openal Modified Files: AL.java Log Message: Added destroy() method to prevent a crash Index: AL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- AL.java 27 Apr 2003 21:26:01 -0000 1.6 +++ AL.java 28 Apr 2003 21:50:11 -0000 1.7 @@ -42,84 +42,102 @@ * @version $Revision$ */ public class AL extends CoreAL { - - /** ALC instance. */ - protected ALC alc; - /** ALCdevice instance. */ - protected ALCdevice device; + /** ALC instance. */ + protected ALC alc; - /** Current ALCcontext. */ - protected ALCcontext context; - - /** - * String that requests a certain device or device configuration. - * If null is specified, the implementation will provide an - * implementation specific default. */ - protected String deviceArguments; - - /** Frequency for mixing output buffer, in units of Hz. */ - protected int contextFrequency = -1; - - /** Refresh intervalls, in units of Hz. */ - protected int contextRefresh = -1; - - /** Flag, indicating a synchronous context. */ - protected int contextSynchronized = ALC.FALSE; + /** ALCdevice instance. */ + protected ALCdevice device; - /** - * Creates an OpenAL instance. The empty constructor will cause OpenAL to - * open the default device, and create a context using default values. - */ - public AL() { - } + /** Current ALCcontext. */ + protected ALCcontext context; + + /** + * String that requests a certain device or device configuration. + * If null is specified, the implementation will provide an + * implementation specific default. */ + protected String deviceArguments; + + /** Frequency for mixing output buffer, in units of Hz. */ + protected int contextFrequency = -1; + + /** Refresh intervalls, in units of Hz. */ + protected int contextRefresh = -1; + + /** Flag, indicating a synchronous context. */ + protected int contextSynchronized = ALC.FALSE; /** - * Creates an OpenAL instance. Using this constructor will cause OpenAL to - * open the device using supplied device argument, and create a context using the context values - * supplied. - * - * @param deviceArguments Arguments supplied to native device - * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100). - * @param contextRefresh Refresh intervalls, in units of Hz. - * @param contextSynchronized Flag, indicating a synchronous context.* + * Creates an OpenAL instance. The empty constructor will cause OpenAL to + * open the default device, and create a context using default values. + */ + public AL() { + } + + /** + * Creates an OpenAL instance. Using this constructor will cause OpenAL to + * open the device using supplied device argument, and create a context using the context values + * supplied. + * + * @param deviceArguments Arguments supplied to native device + * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100). + * @param contextRefresh Refresh intervalls, in units of Hz. + * @param contextSynchronized Flag, indicating a synchronous context.* */ public AL(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized) { - this.deviceArguments = deviceArguments; - this.contextFrequency = contextFrequency; - this.contextRefresh = contextRefresh; - this.contextSynchronized = contextSynchronized ? ALC.TRUE : ALC.FALSE; + this.deviceArguments = deviceArguments; + this.contextFrequency = contextFrequency; + this.contextRefresh = contextRefresh; + this.contextSynchronized = contextSynchronized ? ALC.TRUE : ALC.FALSE; } - - - /** + + /** * @see org.lwjgl.openal.BaseAL#create() */ public void create() throws OpenALException { super.create(); - - alc = new ALC(this); - alc.create(); - - device = alc.openDevice(deviceArguments); - //check if doing default values or not - if (contextFrequency == -1) { - context = alc.createContext(device.device, 0); - } else { - context = alc.createContext(device.device, - Sys.getDirectBufferAddress( - ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized))); - } + alc = new ALC(this); + alc.create(); - - alc.makeContextCurrent(context.context); + device = alc.openDevice(deviceArguments); + + //check if doing default values or not + if (contextFrequency == -1) { + context = alc.createContext(device.device, 0); + } else { + context = + alc.createContext( + device.device, + Sys.getDirectBufferAddress( + ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized))); + } + + alc.makeContextCurrent(context.context); + } + + /** + * Exit cleanly by calling destroy. + */ + public void destroy() { + alc.destroyContext(context.context); + alc.closeDevice(device.device); + alc.destroy(); + } + + /** + * Emergency finalizer! + */ + protected void finalize() throws Throwable { + super.finalize(); + + destroy(); + } + + /** + * Retrieves the AL Context class + */ + public final ALC getALC() { + return alc; } - - /** - * Retrieves the AL Context class - */ - public ALC getALC() { - return alc; - } } |
|
From: Elias N. <eli...@us...> - 2003-04-28 16:41:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv14332/src/java/org/lwjgl/opengl Modified Files: CoreGLConstants.java Log Message: Fixed a typo Index: CoreGLConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGLConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/CoreGLConstants.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- CoreGLConstants.java 21 Dec 2002 12:37:19 -0000 1.5 +++ CoreGLConstants.java 28 Apr 2003 16:41:39 -0000 1.6 @@ -1166,7 +1166,7 @@ /* ClientAttribMask */ public static final int CLIENT_PIXEL_STORE_BIT = 0x00000001; public static final int CLIENT_VERTEX_ARRAY_BIT = 0x00000002; - public static final int CLIENT_ALL_ATTRIB_BITS = 0xffffffff; + public static final int ALL_CLIENT_ATTRIB_BITS = 0xffffffff; /* polygon_offset */ public static final int POLYGON_OFFSET_FACTOR = 0x8038; |
|
From: Elias N. <eli...@us...> - 2003-04-28 12:11:02
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv2955/src/java/org/lwjgl/vector Modified Files: Matrix4f.java Log Message: Added scale to Matrix4f Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Matrix4f.java 28 Apr 2003 11:12:53 -0000 1.13 +++ Matrix4f.java 28 Apr 2003 12:10:54 -0000 1.14 @@ -463,6 +463,27 @@ m33 += m03 * vec.x + m13 * vec.y + m23 * vec.z; return this; } + + /** + * Scales this matrix + * @param vec The vector to scale by + * @return this + */ + public Matrix4f scale(Vector3f vec) { + m00 *= vec.x; + m01 *= vec.x; + m02 *= vec.x; + m03 *= vec.x; + m10 *= vec.y; + m11 *= vec.y; + m12 *= vec.y; + m13 *= vec.y; + m20 *= vec.z; + m21 *= vec.z; + m22 *= vec.z; + m23 *= vec.z; + return this; + } /** * Rotates the matrix around the given axis the specified angle |
|
From: Elias N. <eli...@us...> - 2003-04-28 11:21:00
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv16466/common Modified Files: extgl.c Log Message: Reverted the glu loading Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- extgl.c 28 Apr 2003 11:04:15 -0000 1.13 +++ extgl.c 28 Apr 2003 11:20:55 -0000 1.14 @@ -3275,7 +3275,7 @@ lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; - lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); + lib_glu_handle = dlopen("libGLU.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; return 0; |
|
From: Elias N. <eli...@us...> - 2003-04-28 11:12:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv13013/src/java/org/lwjgl/vector Modified Files: Matrix4f.java Log Message: Index: Matrix4f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Matrix4f.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Matrix4f.java 21 Dec 2002 12:37:20 -0000 1.12 +++ Matrix4f.java 28 Apr 2003 11:12:53 -0000 1.13 @@ -31,6 +31,7 @@ */ package org.lwjgl.vector; +import org.lwjgl.Math; import java.nio.FloatBuffer; /** @@ -50,6 +51,18 @@ } /** + * Returns a string representation of this matrix + */ + public String toString() { + StringBuffer buf = new StringBuffer(); + buf.append(m00).append(' ').append(m10).append(' ').append(m20).append(' ').append(m30).append('\n'); + buf.append(m01).append(' ').append(m11).append(' ').append(m21).append(' ').append(m31).append('\n'); + buf.append(m02).append(' ').append(m12).append(' ').append(m22).append(' ').append(m32).append('\n'); + buf.append(m03).append(' ').append(m13).append(' ').append(m23).append(' ').append(m33).append('\n'); + return buf.toString(); + } + + /** * Set this matrix to be the identity matrix. * @return this */ @@ -450,8 +463,108 @@ m33 += m03 * vec.x + m13 * vec.y + m23 * vec.z; return this; } - + /** + * Rotates the matrix around the given axis the specified angle + * @param angle the angle, in degrees. + * @param axis The vector representing the rotation axis. Must be normalized. + * @return this + */ + public Matrix4f rotate(float angle, Vector3f axis) { + float c = Math.cos(angle); + float s = Math.sin(angle); + float oneminusc = 1.0f - c; + float xy = axis.x*axis.y; + float yz = axis.y*axis.z; + float xz = axis.x*axis.z; + float xs = axis.x*s; + float ys = axis.y*s; + float zs = axis.z*s; + + float f00 = axis.x*axis.x*oneminusc+c; + float f01 = xy*oneminusc+zs; + float f02 = xz*oneminusc-ys; + // n[3] not used + float f10 = xy*oneminusc-zs; + float f11 = axis.y*axis.y*oneminusc+c; + float f12 = yz*oneminusc+xs; + // n[7] not used + float f20 = xz*oneminusc+ys; + float f21 = yz*oneminusc-xs; + float f22 = axis.z*axis.z*oneminusc+c; + + float t00 = m00 * f00 + m10 * f01 + m20 * f02; + float t01 = m01 * f00 + m11 * f01 + m21 * f02; + float t02 = m02 * f00 + m12 * f01 + m22 * f02; + float t03 = m03 * f00 + m13 * f01 + m23 * f02; + float t10 = m00 * f10 + m10 * f11 + m20 * f12; + float t11 = m01 * f10 + m11 * f11 + m21 * f12; + float t12 = m02 * f10 + m12 * f11 + m22 * f12; + float t13 = m03 * f10 + m13 * f11 + m23 * f12; + m20 = m00 * f20 + m10 * f21 + m20 * f22; + m21 = m01 * f20 + m11 * f21 + m21 * f22; + m22 = m02 * f20 + m12 * f21 + m22 * f22; + m23 = m03 * f20 + m13 * f21 + m23 * f22; + m00 = t00; + m01 = t01; + m02 = t02; + m03 = t03; + m10 = t10; + m11 = t11; + m12 = t12; + m13 = t13; + return this; + } + + /** + * Rotates the matrix around the given axis the specified angle, and stores it in the specified destination + * @param angle the angle, in degrees. + * @param axis The vector representing the rotation axis. Must be normalized. + * @param dest The destination matrix or null if a new matrix is to be created + * @return The rotated matrix + */ + public Matrix4f rotate(float angle, Vector3f axis, Matrix4f dest) { + if (dest == null) + dest = new Matrix4f(); + else if (dest == this) + return rotate(angle, axis); + float c = Math.cos(angle); + float s = Math.sin(angle); + float oneminusc = 1.0f - c; + float xy = axis.x*axis.y; + float yz = axis.y*axis.z; + float xz = axis.x*axis.z; + float xs = axis.x*s; + float ys = axis.y*s; + float zs = axis.z*s; + + float f0 = axis.x*axis.x*oneminusc+c; + float f1 = xy*oneminusc+zs; + float f2 = xz*oneminusc-ys; + // n[3] not used + float f4 = xy*oneminusc-zs; + float f5 = axis.y*axis.y*oneminusc+c; + float f6 = yz*oneminusc+xs; + // n[7] not used + float f8 = xz*oneminusc+ys; + float f9 = yz*oneminusc-xs; + float f10 = axis.z*axis.z*oneminusc+c; + + /* m[12] to m[15] are not changed by a rotate */ + dest.m00 = m00 * f0 + m10 * f1 + m20 * f2; + dest.m01 = m01 * f0 + m11 * f1 + m21 * f2; + dest.m02 = m02 * f0 + m12 * f1 + m22 * f2; + dest.m03 = m03 * f0 + m13 * f1 + m23 * f2; + dest.m10 = m00 * f4 + m10 * f5 + m20 * f6; + dest.m11 = m01 * f4 + m11 * f5 + m21 * f6; + dest.m12 = m02 * f4 + m12 * f5 + m22 * f6; + dest.m13 = m03 * f4 + m13 * f5 + m23 * f6; + dest.m20 = m00 * f8 + m10 * f9 + m20 * f10; + dest.m21 = m01 * f8 + m11 * f9 + m21 * f10; + dest.m22 = m02 * f8 + m12 * f9 + m22 * f10; + dest.m23 = m03 * f8 + m13 * f9 + m23 * f10; + return dest; + } /** * Translate this matrix and stash the result in another matrix |
|
From: Caspian Rychlik-P. <ci...@us...> - 2003-04-28 11:04:20
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv9531/src/native/common Modified Files: extgl.c Log Message: Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- extgl.c 13 Apr 2003 09:28:01 -0000 1.12 +++ extgl.c 28 Apr 2003 11:04:15 -0000 1.13 @@ -1250,7 +1250,7 @@ glCullParameterdvEXTPROC glCullParameterdvEXT = NULL; #endif /* GL_EXT_cull_vertex */ -#ifdef GL_EXT_blend_function_sepatate +#ifdef GL_EXT_blend_function_separate glBlendFuncSeparateEXTPROC glBlendFuncSeparateEXT = NULL; glBlendFuncSeparateINGRPROC glBlendFuncSeparateINGR = NULL; #endif /* GL_EXT_blend_func_separate */ @@ -3275,7 +3275,7 @@ lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; - lib_glu_handle = dlopen("libGLU.so.1", RTLD_LAZY | RTLD_GLOBAL); + lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; return 0; |
|
From: Brian M. <ma...@us...> - 2003-04-27 21:46:34
|
Update of /cvsroot/java-game-lib/LWJGL/doc/tutorial In directory sc8-pr-cvs1:/tmp/cvs-serv24632 Modified Files: openal_basics.html Log Message: updated to reflect version in website folder Index: openal_basics.html CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/doc/tutorial/openal_basics.html =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/doc/tutorial/openal_basics.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- openal_basics.html 21 Dec 2002 12:10:05 -0000 1.2 +++ openal_basics.html 27 Apr 2003 21:46:30 -0000 1.3 @@ -29,99 +29,50 @@ <br> <b>1.2 Basic setup</b><br> Lets start out by creating a skeleton class for some very basic sound. We'll -start of by creating the required OpenAL objects<br> +start of by creating the required OpenAL object<br> <p style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"><tt>import org.lwjgl.openal.AL;<br> -import org.lwjgl.openal.ALC;<br> -import org.lwjgl.openal.ALCcontext;<br> -import org.lwjgl.openal.ALCdevice;<br> -<br> <br> public class PlayTest {<br> <br> /** OpenAL instance */<br> protected AL al;<br> - <br> - /** OpenAL Context instance */<br> - protected ALC alc;<br> - <br> - /** OpenAL context */<br> - protected ALCcontext context;<br> - <br> - /** OpenAL device */<br> - protected ALCdevice device; <br> - <br> + <br> + /**<br> * Creates an instance of PlayTest<br> */<br> public PlayTest() {<br> try {<br> </tt> -<tt> al = new AL();<br> - alc = new ALC();<br> -<br> +<tt> al = new AL();<br> al.create();<br> - alc.create();<br> } catch (Exception e) {<br> e.printStackTrace();<br> }</tt><tt><br> }<br> -}</tt><code></code></p> -We need instances of the following classes:<br> -<ul> - <li><tt>AL </tt>- basic source, buffer and listener interaction</li> - <li><tt>ALC </tt>- context and device creatiuon</li> -</ul> -<b>1.3 OpenAL initialization</b><br> -Now that we have created a basic class containing instances of the relevant -OpenAL classes, lets start of by initializing OpenAL - that is create a device -and a context:<br> -<p - style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"> <tt> -/**<br> - * Initializes OpenAL<br> - */<br> - protected void alInitialize() { <br> - //get default device<br> - device = alc.openDevice(null);<br> - <br> - //create context (no attributes specified)<br> - context = alc.createContext(device, 0);<br> - <br> - //make context current<br> - alc.makeContextCurrent(context);<br> - }</tt><code><br> -</code></p> -Start of by opening a device using the <tt>openDevice </tt>method. <tt>openDevice -</tt>takes a <tt>String </tt>as argument, containing the name of the device -to open. If no name is supplied, the default device will be used (OpenAL -currently doesn't support enumeration of devices available).<br> -<br> -Having opened a device, create a context to that device using <tt>createContext</tt>. -<tt>createContext</tt> takes two arguments: device to use and a list of attributes -(see specification for list of attributes). Since we're going by default context, -we just specify <tt>0</tt> for attributes.<br> -<br> -Finish of by making the created context current. Do this by calling <tt>makeContextCurrent</tt>, -supplying just created context as argument.<br> -<p><b>1.4 Buffer and Source creation</b><br> -Now that we have opened a device and gotten a context, we need to create +}</tt></p> +<p><b>1.3 Buffer and Source creation</b><br> +Now that we have created the AL instance, we need to create two things to actually get some sound. We need to create a buffer to hold -sounddata, and a source that is to play the sounddata.<br> +sound data, and a source that is to play the sound data.<br> Lets start of by creating one source, and one buffer:</p> -<p - style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"><tt> -//create one IntBuffer as buffer and one as source<br> +<p style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"> +<tt> + //create one IntBuffer as buffer and one as source<br> + //createIntBuffer is a utility method which allocates a direct ByteBuffer in native order<br> IntBuffer buffers = createIntBuffer(1);<br> IntBuffer sources = createIntBuffer(1);<br> <br> //generate buffers and sources<br> al.genBuffers(1, Sys.getDirectBufferAddress(buffers));<br> - al.genSources(1, Sys.getDirectBufferAddress(sources));</tt></p> -<p>There, all set for actually loading some sounddata into the buffer.<br> + al.genSources(1, Sys.getDirectBufferAddress(sources)); +</tt> </p> -<b>1.5 Loading sounddata and setting up a buffer</b><br> +<p>There, all set for actually loading some sound data into the buffer.<br> +</p> +<b>1.4 Loading sound data and setting up a buffer</b><br> Now that we have a buffer, we need to load some sound data into this buffer. This is done using the <tt>al.bufferData</tt> method. In our example we will "cheat" a bit, by using the <tt>WaveData</tt> class to load @@ -138,11 +89,11 @@ wavefile.dispose(); <br> </tt></p> Having loaded the data, we pass it to <tt>bufferData</tt>. Once the buffer -has been filled with sounddata, we unload it from the system using <tt>wavefile.dispose()</tt>. -Don't worry about deleting it this soon - the sounddata has been <b>copied</b> +has been filled with sound data, we unload it from the system using <tt>wavefile.dispose()</tt>. +Don't worry about deleting it this soon - the sound data has been <b>copied</b> to the buffer.<br> <br> -<b>1.6 Associating sources and buffers</b><br> +<b>1.5 Associating sources and buffers</b><br> To associate a source to a buffer we set the integer BUFFER attribute on the source, and assign it a value of the buffer to play:<br> <p @@ -150,7 +101,7 @@ //set up source input<br> al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0));</tt><tt><br> </tt></p> -<b>1.7 Setting source properties</b><br> +<b>1.6 Setting source properties</b><br> Having set up the source, it is time to set some attributes on the source - there are many that can be set, but in this example we only set the looping attribute to true by doing the following:<br> @@ -159,7 +110,7 @@ //loop source<br> al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE);</tt><tt><br> </tt></p> -<b>1.8 Sound...<br> +<b>1.7 Sound...<br> </b>There, ready to play the sound, do this using the <tt>sourcePlay </tt>method of the <tt>AL </tt>class. to stop and pause use <tt>sourcePause </tt>and <tt>sourceStop </tt>respectively, and supply the source to affect:<br> @@ -177,12 +128,11 @@ <br> //stop source 0<br> al.sourceStop(sources.get(0));</tt></p> -<b>1.9 Cleaning up<br> +<b>1.8 Cleaning up<br> </b>Having had loads of fun playing a sound (!), it is now time to do some house chores. We need to clean up what we have created, this amounts to:<br> - deleting source and buffer<br> - - deleting context<br> - - closing devce<br> + - destroying AL<br> as is shown here:<b><br> </b> <p @@ -192,9 +142,9 @@ al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers));<br> <br> //shutdown<br> - alc.makeContextCurrent(null);<br> - alc.destroyContext(context);<br> - alc.closeDevice(device);</tt></p> + al.destroy();<br> +</tt> +</p> There, all set. Now you should be able to play some basic sound!<br> This tutorial is rather short, and the above examples feature no error checking. For the complete source code, look at the classes in the <br> |
|
From: Brian M. <ma...@us...> - 2003-04-27 21:26:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv17944/org/lwjgl/test/openal Modified Files: BasicTest.java OpenALCreationTest.java Log Message: add: default constructor for OpenAL Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- BasicTest.java 27 Apr 2003 18:39:18 -0000 1.6 +++ BasicTest.java 27 Apr 2003 21:26:02 -0000 1.7 @@ -58,7 +58,7 @@ * Creates an instance of PlayTest */ public BasicTest() { - al = new AL(null, 44100, 15, false); + al = new AL(); try { al.create(); } catch (Exception e) { Index: OpenALCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OpenALCreationTest.java 27 Apr 2003 18:37:38 -0000 1.2 +++ OpenALCreationTest.java 27 Apr 2003 21:26:02 -0000 1.3 @@ -61,7 +61,7 @@ * Creates an instance of OpenALCreationTest */ public OpenALCreationTest() { - al = new AL(null, 44100, 15, false); + al = new AL(); } public void alInitialize() { |
|
From: Brian M. <ma...@us...> - 2003-04-27 21:26:05
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv17944/org/lwjgl/openal Modified Files: AL.java Log Message: add: default constructor for OpenAL Index: AL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- AL.java 27 Apr 2003 18:37:37 -0000 1.5 +++ AL.java 27 Apr 2003 21:26:01 -0000 1.6 @@ -59,16 +59,25 @@ protected String deviceArguments; /** Frequency for mixing output buffer, in units of Hz. */ - protected int contextFrequency; + protected int contextFrequency = -1; /** Refresh intervalls, in units of Hz. */ - protected int contextRefresh; + protected int contextRefresh = -1; /** Flag, indicating a synchronous context. */ - protected int contextSynchronized; + protected int contextSynchronized = ALC.FALSE; + + /** + * Creates an OpenAL instance. The empty constructor will cause OpenAL to + * open the default device, and create a context using default values. + */ + public AL() { + } /** - * Creates an OpenAL instance + * Creates an OpenAL instance. Using this constructor will cause OpenAL to + * open the device using supplied device argument, and create a context using the context values + * supplied. * * @param deviceArguments Arguments supplied to native device * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100). @@ -93,10 +102,16 @@ alc.create(); device = alc.openDevice(deviceArguments); - + + //check if doing default values or not + if (contextFrequency == -1) { + context = alc.createContext(device.device, 0); + } else { context = alc.createContext(device.device, Sys.getDirectBufferAddress( ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized))); + } + alc.makeContextCurrent(context.context); } |
|
From: Brian M. <ma...@us...> - 2003-04-27 21:25:40
|
Update of /cvsroot/java-game-lib/LWJGL/website/documents/tutorials/openal In directory sc8-pr-cvs1:/tmp/cvs-serv17713 Modified Files: openal_basics.html Log Message: add: default constructor for OpenAL Index: openal_basics.html CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/website/documents/tutorials/openal/openal_basics.html =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/website/documents/tutorials/openal/openal_basics.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- openal_basics.html 27 Apr 2003 18:38:00 -0000 1.3 +++ openal_basics.html 27 Apr 2003 21:25:35 -0000 1.4 @@ -46,20 +46,13 @@ public PlayTest() {<br> try {<br> </tt> -<tt> al = new AL(null, 44100, 15, false);<br> +<tt> al = new AL();<br> al.create();<br> } catch (Exception e) {<br> e.printStackTrace();<br> }</tt><tt><br> }<br> }</tt></p> -The arguments passed to AL, are as follows:<br> -<ul> - <li><i>null</i> - Device argument, depends on OpenAL native implementation. We just pass Null to get default device.</li> - <li><i>44100</i> - Frequency for mixing output buffer, in units of Hz.</li> - <li><i>15</i> - Refresh intervalls, in units of Hz.</li> - <li><i>false</i> - Flag, indicating a synchronous context (Whether or not you're not going to synchronice sound to framerate).</li> -</ul> <p><b>1.3 Buffer and Source creation</b><br> Now that we have created the AL instance, we need to create two things to actually get some sound. We need to create a buffer to hold |
|
From: Brian M. <ma...@us...> - 2003-04-27 18:39:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv22668 Modified Files: BasicTest.java Log Message: only do 10 updates / sec Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- BasicTest.java 27 Apr 2003 18:37:38 -0000 1.5 +++ BasicTest.java 27 Apr 2003 18:39:18 -0000 1.6 @@ -58,7 +58,7 @@ * Creates an instance of PlayTest */ public BasicTest() { - al = new AL(null, 44100, 40, false); + al = new AL(null, 44100, 15, false); try { al.create(); } catch (Exception e) { |
|
From: Brian M. <ma...@us...> - 2003-04-27 18:38:05
|
Update of /cvsroot/java-game-lib/LWJGL/website/documents/tutorials/openal In directory sc8-pr-cvs1:/tmp/cvs-serv22143/documents/tutorials/openal Modified Files: openal_basics.html Log Message: New OpenAL programming model: no context/device fiddling easier initialization Index: openal_basics.html CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/website/documents/tutorials/openal/openal_basics.html =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/website/documents/tutorials/openal/openal_basics.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- openal_basics.html 21 Dec 2002 12:10:51 -0000 1.2 +++ openal_basics.html 27 Apr 2003 18:38:00 -0000 1.3 @@ -29,99 +29,57 @@ <br> <b>1.2 Basic setup</b><br> Lets start out by creating a skeleton class for some very basic sound. We'll -start of by creating the required OpenAL objects<br> +start of by creating the required OpenAL object<br> <p style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"><tt>import org.lwjgl.openal.AL;<br> -import org.lwjgl.openal.ALC;<br> -import org.lwjgl.openal.ALCcontext;<br> -import org.lwjgl.openal.ALCdevice;<br> -<br> <br> public class PlayTest {<br> <br> /** OpenAL instance */<br> protected AL al;<br> - <br> - /** OpenAL Context instance */<br> - protected ALC alc;<br> - <br> - /** OpenAL context */<br> - protected ALCcontext context;<br> - <br> - /** OpenAL device */<br> - protected ALCdevice device; <br> - <br> + <br> + /**<br> * Creates an instance of PlayTest<br> */<br> public PlayTest() {<br> try {<br> </tt> -<tt> al = new AL();<br> - alc = new ALC();<br> -<br> +<tt> al = new AL(null, 44100, 15, false);<br> al.create();<br> - alc.create();<br> } catch (Exception e) {<br> e.printStackTrace();<br> }</tt><tt><br> }<br> -}</tt><code></code></p> -We need instances of the following classes:<br> +}</tt></p> +The arguments passed to AL, are as follows:<br> <ul> - <li><tt>AL </tt>- basic source, buffer and listener interaction</li> - <li><tt>ALC </tt>- context and device creatiuon</li> + <li><i>null</i> - Device argument, depends on OpenAL native implementation. We just pass Null to get default device.</li> + <li><i>44100</i> - Frequency for mixing output buffer, in units of Hz.</li> + <li><i>15</i> - Refresh intervalls, in units of Hz.</li> + <li><i>false</i> - Flag, indicating a synchronous context (Whether or not you're not going to synchronice sound to framerate).</li> </ul> -<b>1.3 OpenAL initialization</b><br> -Now that we have created a basic class containing instances of the relevant -OpenAL classes, lets start of by initializing OpenAL - that is create a device -and a context:<br> -<p - style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"> <tt> -/**<br> - * Initializes OpenAL<br> - */<br> - protected void alInitialize() { <br> - //get default device<br> - device = alc.openDevice(null);<br> - <br> - //create context (no attributes specified)<br> - context = alc.createContext(device, 0);<br> - <br> - //make context current<br> - alc.makeContextCurrent(context);<br> - }</tt><code><br> -</code></p> -Start of by opening a device using the <tt>openDevice </tt>method. <tt>openDevice -</tt>takes a <tt>String </tt>as argument, containing the name of the device -to open. If no name is supplied, the default device will be used (OpenAL -currently doesn't support enumeration of devices available).<br> -<br> -Having opened a device, create a context to that device using <tt>createContext</tt>. -<tt>createContext</tt> takes two arguments: device to use and a list of attributes -(see specification for list of attributes). Since we're going by default context, -we just specify <tt>0</tt> for attributes.<br> -<br> -Finish of by making the created context current. Do this by calling <tt>makeContextCurrent</tt>, -supplying just created context as argument.<br> -<p><b>1.4 Buffer and Source creation</b><br> -Now that we have opened a device and gotten a context, we need to create +<p><b>1.3 Buffer and Source creation</b><br> +Now that we have created the AL instance, we need to create two things to actually get some sound. We need to create a buffer to hold -sounddata, and a source that is to play the sounddata.<br> +sound data, and a source that is to play the sound data.<br> Lets start of by creating one source, and one buffer:</p> -<p - style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"><tt> -//create one IntBuffer as buffer and one as source<br> +<p style="border-style: solid; border-width: 1px; padding: 3px; background-color: rgb(255,255,204);"> +<tt> + //create one IntBuffer as buffer and one as source<br> + //createIntBuffer is a utility method which allocates a direct ByteBuffer in native order<br> IntBuffer buffers = createIntBuffer(1);<br> IntBuffer sources = createIntBuffer(1);<br> <br> //generate buffers and sources<br> al.genBuffers(1, Sys.getDirectBufferAddress(buffers));<br> - al.genSources(1, Sys.getDirectBufferAddress(sources));</tt></p> -<p>There, all set for actually loading some sounddata into the buffer.<br> + al.genSources(1, Sys.getDirectBufferAddress(sources)); +</tt> </p> -<b>1.5 Loading sounddata and setting up a buffer</b><br> +<p>There, all set for actually loading some sound data into the buffer.<br> +</p> +<b>1.4 Loading sound data and setting up a buffer</b><br> Now that we have a buffer, we need to load some sound data into this buffer. This is done using the <tt>al.bufferData</tt> method. In our example we will "cheat" a bit, by using the <tt>WaveData</tt> class to load @@ -138,11 +96,11 @@ wavefile.dispose(); <br> </tt></p> Having loaded the data, we pass it to <tt>bufferData</tt>. Once the buffer -has been filled with sounddata, we unload it from the system using <tt>wavefile.dispose()</tt>. -Don't worry about deleting it this soon - the sounddata has been <b>copied</b> +has been filled with sound data, we unload it from the system using <tt>wavefile.dispose()</tt>. +Don't worry about deleting it this soon - the sound data has been <b>copied</b> to the buffer.<br> <br> -<b>1.6 Associating sources and buffers</b><br> +<b>1.5 Associating sources and buffers</b><br> To associate a source to a buffer we set the integer BUFFER attribute on the source, and assign it a value of the buffer to play:<br> <p @@ -150,7 +108,7 @@ //set up source input<br> al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0));</tt><tt><br> </tt></p> -<b>1.7 Setting source properties</b><br> +<b>1.6 Setting source properties</b><br> Having set up the source, it is time to set some attributes on the source - there are many that can be set, but in this example we only set the looping attribute to true by doing the following:<br> @@ -159,7 +117,7 @@ //loop source<br> al.sourcei(sources.get(0), AL.LOOPING, AL.TRUE);</tt><tt><br> </tt></p> -<b>1.8 Sound...<br> +<b>1.7 Sound...<br> </b>There, ready to play the sound, do this using the <tt>sourcePlay </tt>method of the <tt>AL </tt>class. to stop and pause use <tt>sourcePause </tt>and <tt>sourceStop </tt>respectively, and supply the source to affect:<br> @@ -177,12 +135,11 @@ <br> //stop source 0<br> al.sourceStop(sources.get(0));</tt></p> -<b>1.9 Cleaning up<br> +<b>1.8 Cleaning up<br> </b>Having had loads of fun playing a sound (!), it is now time to do some house chores. We need to clean up what we have created, this amounts to:<br> - deleting source and buffer<br> - - deleting context<br> - - closing devce<br> + - destroying AL<br> as is shown here:<b><br> </b> <p @@ -192,9 +149,9 @@ al.deleteBuffers(1, Sys.getDirectBufferAddress(buffers));<br> <br> //shutdown<br> - alc.makeContextCurrent(null);<br> - alc.destroyContext(context);<br> - alc.closeDevice(device);</tt></p> + al.destroy();<br> +</tt> +</p> There, all set. Now you should be able to play some basic sound!<br> This tutorial is rather short, and the above examples feature no error checking. For the complete source code, look at the classes in the <br> |
|
From: Brian M. <ma...@us...> - 2003-04-27 18:37:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1:/tmp/cvs-serv21877a/java/org/lwjgl/test/openal Modified Files: ALCTest.java ALTest.java BasicTest.java EAXTest.java MovingSoundTest.java OpenALCreationTest.java PlayTest.java PlayTestMemory.java SourceLimitTest.java StressTest.java Log Message: New OpenAL programming model: no context/device fiddling easier initialization Index: ALCTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ALCTest.java 6 Feb 2003 18:18:46 -0000 1.5 +++ ALCTest.java 27 Apr 2003 18:37:38 -0000 1.6 @@ -32,8 +32,6 @@ package org.lwjgl.test.openal; import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; import org.lwjgl.Sys; import java.nio.IntBuffer; @@ -47,102 +45,73 @@ * @version $Revision$ */ public class ALCTest extends BasicTest { - - /** - * Creates an instance of ALCTest - */ - public ALCTest() { - super(); - } - - /** - * Runs the actual test, using supplied arguments - */ - protected void execute(String[] args) { - //error stuff - int lastError = ALC.NO_ERROR; - - //create a device - device = alc.openDevice(null); - if(device == null) { - System.out.println("Unable to create device"); - System.exit(-1); - } - - //create attribute list for context creation - 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)); - if(context == null) { - System.out.println("Unable to create context"); - System.exit(-1); - } - - if((lastError = alc.getError(device)) != ALC.NO_ERROR) { - System.out.println("ALC Error: " + alc.getString(device, lastError)); - System.exit(-1); - } - - //make current - alc.makeContextCurrent(context); - - //process - alc.processContext(context); - //suspend - // alc.suspendContext(context); - - //query - System.out.println("DEFAULT_DEVICE_SPECIFIER: " + alc.getString(device, ALC.DEFAULT_DEVICE_SPECIFIER)); - System.out.println("DEVICE_SPECIFIER: " + alc.getString(device, ALC.DEVICE_SPECIFIER)); - System.out.println("EXTENSIONS: " + alc.getString(device, ALC.EXTENSIONS)); - - //mo query - buffer.rewind(); - alc.getIntegerv(device, ALC.MAJOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)); - alc.getIntegerv(device, ALC.MINOR_VERSION, 4, Sys.getDirectBufferAddress(buffer)+4); + /** instance of alc */ + private ALC alc; - 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 + /** + * Creates an instance of ALCTest + */ + public ALCTest() { + super(); + alc = al.getALC(); + } - //check current context - ALCcontext currentContext = alc.getCurrentContext(); - if(context.context != currentContext.context) { - System.out.println("Serious error! - context copy != current context"); - System.exit(-1); - } + /** + * Runs the actual test, using supplied arguments + */ + protected void execute(String[] args) { + //error stuff + int lastError = ALC.NO_ERROR; - //check contexts device - ALCdevice currentDevice = alc.getContextsDevice(context); - if(device.device != currentDevice.device) { - System.out.println("Serious error! - device copy != current contexts device"); - System.exit(-1); - } - - //get an enumerstion value - System.out.println("Value of ALC_MAJOR_VERSION: " + alc.getEnumValue(device, "ALC_MAJOR_VERSION")); - - alExit(); - } - - /** - * main entry point - * - * @param args String array containing arguments - */ - public static void main(String[] args) { - ALCTest alcTest = new ALCTest(); - alcTest.execute(args); - } + //create attribute list for context creation + IntBuffer buffer = createIntBuffer(7); + + if ((lastError = alc.getError()) != ALC.NO_ERROR) { + System.out.println("ALC Error: " + alc.getString(lastError)); + System.exit(-1); + } + + //query + System.out.println( + "DEFAULT_DEVICE_SPECIFIER: " + + alc.getString(ALC.DEFAULT_DEVICE_SPECIFIER)); + System.out.println( + "DEVICE_SPECIFIER: " + alc.getString(ALC.DEVICE_SPECIFIER)); + System.out.println("EXTENSIONS: " + alc.getString(ALC.EXTENSIONS)); + + //mo query + buffer.rewind(); + alc.getIntegerv( + ALC.MAJOR_VERSION, + 4, + Sys.getDirectBufferAddress(buffer)); + alc.getIntegerv( + ALC.MINOR_VERSION, + 4, + Sys.getDirectBufferAddress(buffer) + 4); + + 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 + + //get an enumerstion value + System.out.println( + "Value of ALC_MAJOR_VERSION: " + + alc.getEnumValue("ALC_MAJOR_VERSION")); + + alExit(); + } + + /** + * main entry point + * + * @param args String array containing arguments + */ + public static void main(String[] args) { + ALCTest alcTest = new ALCTest(); + alcTest.execute(args); + } } Index: ALTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ALTest.java 24 Mar 2003 11:56:04 -0000 1.5 +++ ALTest.java 27 Apr 2003 18:37:38 -0000 1.6 @@ -33,8 +33,6 @@ import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; import org.lwjgl.openal.eax.EAX; import org.lwjgl.openal.eax.EAXBufferProperties; import org.lwjgl.openal.eax.EAXListenerProperties; @@ -280,8 +278,6 @@ String szFnName; int ch = -1; int error; - ALCcontext context; - ALCdevice device; FloatBuffer listenerPos = createFloatBuffer(3); listenerPos.put(new float[] {0.0f, 0.0f, 0.0f}); @@ -296,17 +292,6 @@ System.out.print("=======================\n\n"); // Initialize Open AL manually - //Open device - device = alc.openDevice(null); - if (device == null) { - System.out.println("Could not create ALC device"); - System.exit(-1); - } - //Create context(s) - context = alc.createContext(device, 0); - //Set active context - alc.makeContextCurrent(context); - // Clear Error Code al.getError(); @@ -518,16 +503,16 @@ System.out.print("\nQ to quit\n\n\n"); try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); eatInput(); } catch (IOException ioe) { } switch (ch) { - case 'A': + case 'a': fullAutoTests(); break; - case 'B': + case 'b': semiAutoTests(); break; case '1': @@ -567,7 +552,7 @@ default: break; } - } while (ch != 'Q'); + } while (ch != 'q'); } protected void fullAutoTests() { @@ -963,7 +948,7 @@ while (true) { ch = CRToContinue(); - if ((ch == 'S') || (ch == 's')) { + if (ch == 's') { return 0; } if (ch == 10) { @@ -976,7 +961,7 @@ int current = -1; try { //read one, and eat the rest - current = System.in.read(); + current = Character.toLowerCase((char) System.in.read()); eatInput(); } catch (Exception e) { } @@ -1004,11 +989,7 @@ String tempString; - ALCcontext pContext; - ALCdevice pDevice; - pContext = alc.getCurrentContext(); - pDevice = alc.getContextsDevice(pContext); - tempString = alc.getString(pDevice, ALC.DEVICE_SPECIFIER); + tempString = alc.getString(ALC.DEVICE_SPECIFIER); System.out.print("OpenAL Context Device Specifier is '" + tempString + "'\n"); tempString = al.getString(AL.RENDERER); System.out.print("OpenAL Renderer is '" + tempString + "'\n"); @@ -1869,7 +1850,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -1895,7 +1876,7 @@ displayALError("alSourceStop source 1 : ", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Release resources al.sourceStopv(2, Sys.getDirectBufferAddress(source)); @@ -2006,7 +1987,7 @@ System.out.print("\nSource 0 : Not looping Source 1 : Not looping\n"); do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -2056,7 +2037,7 @@ al.sourcei(source.get(1), AL.LOOPING, bLooping1); break; } - } while (ch != 'Q'); + } while (ch != 'q'); System.out.print("\n"); @@ -2171,12 +2152,12 @@ System.out.print("Press '8' to remove occlusion from source 0 (DEFERRED)\n"); System.out.print("Press '9' to obstruct source 1 (IMMEDIATE)\n"); System.out.print("Press '0' to remove obstruction from source 1 (IMMEDIATE)\n"); - System.out.print("Press 'c' to COMMIT EAX settings\n"); - System.out.print("Press 'q' to quit\n\n"); + System.out.print("Press 'C' to COMMIT EAX settings\n"); + System.out.print("Press 'Q' to quit\n\n"); do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } switch (ch) { @@ -2244,7 +2225,7 @@ displayALError("eaxSet EAXBUFFER_OBSTRUCTION : \n", error); break; - case 'C': + case 'c': // Commit settings on source 0 eax.eaxSet(EAX.BUFFER_GUID, EAXBufferProperties.COMMITDEFERREDSETTINGS, source.get(0), 0, 0); @@ -2258,7 +2239,7 @@ displayALError("eaxSet EAXLISTENER_COMMITDEFERREDSETTINGSENVIRONMENT : \n", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // reset EAX level Room.put(0, -10000); @@ -2363,7 +2344,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } switch (ch) { @@ -2423,7 +2404,7 @@ if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourceQueueBuffers 1 (buffer 0) : ", error); break; - case 'A': + case 'a': // Unqueue first Buffer al.sourceUnqueueBuffers(source.get(0), 1, Sys.getDirectBufferAddress(buffersremoved)); @@ -2446,7 +2427,7 @@ System.out.print("\nRemoved Buffer " + buffersremoved.get(0) + " from queue\n"); } break; - case 'B': + case 'b': // Unqueue first 2 Buffers al.sourceUnqueueBuffers(source.get(0), 2, Sys.getDirectBufferAddress(buffersremoved)); @@ -2472,7 +2453,7 @@ System.out.print("\nRemoved Buffers " + buffersremoved.get(0) + " and " + buffersremoved.get(1) + " from queue\n"); } break; - case 'C': + case 'c': // Unqueue first 3 Buffers al.sourceUnqueueBuffers(source.get(0), 3, Sys.getDirectBufferAddress(buffersremoved)); if ((error = al.getError()) != AL.NO_ERROR) @@ -2499,7 +2480,7 @@ buffersremoved.get(2) +" from queue\n"); } break; - case 'D': + case 'd': // Unqueue first 4 Buffers al.sourceUnqueueBuffers(source.get(0), 4, Sys.getDirectBufferAddress(buffersremoved)); @@ -2529,7 +2510,7 @@ " from queue\n"); } break; - case 'E': + case 'e': // Unqueue first 5 Buffers al.sourceUnqueueBuffers(source.get(0), 5, Sys.getDirectBufferAddress(buffersremoved)); @@ -2560,7 +2541,7 @@ " from queue\n"); } break; - case 'F': + case 'f': al.sourcei(source.get(0), AL.BUFFER, 0); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSource AL_BUFFER NULL : ", error); @@ -2593,7 +2574,7 @@ BuffersInQueue.clear(); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Release resources al.sourceStop(source.get(0)); @@ -2650,7 +2631,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -2690,7 +2671,7 @@ displayALError("alSourceStop 0 : ", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Release resources al.sourceStopv(1, Sys.getDirectBufferAddress(source)); @@ -2751,7 +2732,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -2773,7 +2754,7 @@ displayALError("alSourcef source 0 AL PITCH 0.5: ", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Release resources al.sourceStopv(1, Sys.getDirectBufferAddress(source)); @@ -2824,7 +2805,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -2964,7 +2945,7 @@ break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Release resources al.sourceStop(source.get(0)); @@ -3066,7 +3047,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } @@ -3111,28 +3092,28 @@ if ((error = al.getError()) != AL.NO_ERROR) displayALError("alSourcef 0 AL_GAIN 0.0 : \n", error); break; - case 'A': + case 'a': al.listenerf(AL.GAIN,1.0f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alListenerf AL_GAIN 1.0 : \n", error); break; - case 'B': + case 'b': al.listenerf(AL.GAIN,0.5f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alListenerf AL_GAIN 0.5 : \n", error); break; - case 'C': + case 'c': al.listenerf(AL.GAIN,0.25f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alListenerf AL_GAIN 0.25 : \n", error); break; - case 'D': + case 'd': al.listenerf(AL.GAIN,0.0f); if ((error = al.getError()) != AL.NO_ERROR) displayALError("alListenerf AL_GAIN 0.0 : \n", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Reset & Release resources al.listenerf(AL.GAIN,1.0f); @@ -3207,7 +3188,7 @@ do { try { - ch = System.in.read(); + ch = Character.toLowerCase((char) System.in.read()); } catch (IOException ioe) { } switch (ch) { @@ -3227,7 +3208,7 @@ displayALError("alSourceStopv : ", error); break; } - } while (ch != 'Q'); + } while (ch != 'q'); // Delete the Sources al.deleteSources(numSources, Sys.getDirectBufferAddress(Sources)); Index: BasicTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BasicTest.java 21 Dec 2002 12:37:20 -0000 1.4 +++ BasicTest.java 27 Apr 2003 18:37:38 -0000 1.5 @@ -33,8 +33,6 @@ import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -53,79 +51,27 @@ /** OpenAL instance */ protected AL al; - /** OpenAL Context instance */ + /** OpenALC instance */ protected ALC alc; - - /** OpenAL context */ - protected ALCcontext context; - - /** OpenAL device */ - protected ALCdevice device; - + /** * Creates an instance of PlayTest */ public BasicTest() { - al = new AL(); + al = new AL(null, 44100, 40, false); try { al.create(); } catch (Exception e) { e.printStackTrace(); return; - } - - alc = new ALC(); - try { - alc.create(); - } catch (Exception e) { - e.printStackTrace(); - return; } } /** - * Initializes OpenAL - */ - protected void alInitialize() { - - //get default device - device = alc.openDevice(null); - if(device == null) { - throw new RuntimeException("Error creating device"); - } - - //create context (no attributes specified) - context = alc.createContext(device, 0); - if(context == null) { - throw new RuntimeException("Error creating context"); - } - - //make context current - alc.makeContextCurrent(context); - if(alc.getError(device) != ALC.NO_ERROR) { - throw new RuntimeException("An error occurred while making context current"); - } - } - - /** * Shutdowns OpenAL */ protected void alExit() { - - //Get active context - context = alc.getCurrentContext(); - - //Get device for active context - device = alc.getContextsDevice(context); - - //Disable context - alc.makeContextCurrent(null); - - //Release context(s) - alc.destroyContext(context); - - //Close device - alc.closeDevice(device); + al.destroy(); } /** Index: EAXTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/EAXTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- EAXTest.java 21 Dec 2002 12:37:20 -0000 1.4 +++ EAXTest.java 27 Apr 2003 18:37:38 -0000 1.5 @@ -54,8 +54,6 @@ * Runs the actual test, using supplied arguments */ protected void execute(String[] args) { - alInitialize(); - EAX eax = new EAX(); try { eax.create(); Index: MovingSoundTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- MovingSoundTest.java 28 Mar 2003 22:12:43 -0000 1.8 +++ MovingSoundTest.java 27 Apr 2003 18:37:38 -0000 1.9 @@ -83,10 +83,6 @@ IntBuffer Env = null; EAXBufferProperties eaxBufferProp = null; - - //initialize AL, using ALC - alInitialize(); - //initialize keyboard try { Keyboard.create(); Index: OpenALCreationTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- OpenALCreationTest.java 16 Mar 2003 22:52:35 -0000 1.1 +++ OpenALCreationTest.java 27 Apr 2003 18:37:38 -0000 1.2 @@ -35,8 +35,6 @@ import org.lwjgl.openal.AL; import org.lwjgl.openal.ALC; -import org.lwjgl.openal.ALCcontext; -import org.lwjgl.openal.ALCdevice; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -59,18 +57,11 @@ /** OpenAL Context instance */ protected ALC alc; - /** OpenAL context */ - protected ALCcontext context; - - /** OpenAL device */ - protected ALCdevice device; - /** * Creates an instance of OpenALCreationTest */ public OpenALCreationTest() { - al = new AL(); - alc = new ALC(); + al = new AL(null, 44100, 15, false); } public void alInitialize() { @@ -80,51 +71,9 @@ e.printStackTrace(); return; } - - try { - alc.create(); - } catch (Exception e) { - e.printStackTrace(); - return; - } - - // get default device - device = alc.openDevice(null); - if (device == null) { - throw new RuntimeException("Error creating device"); - } - - //create context (no attributes specified) - context = alc.createContext(device, 0); - if (context == null) { - throw new RuntimeException("Error creating context"); - } - - //make context current - alc.makeContextCurrent(context); - if (alc.getError(device) != ALC.NO_ERROR) { - throw new RuntimeException("An error occurred while making context current"); - } } public void alExit() { - //Get active context - context = alc.getCurrentContext(); - - //Get device for active context - device = alc.getContextsDevice(context); - - //Disable context - alc.makeContextCurrent(null); - - //Release context(s) - alc.destroyContext(context); - - //Close device - alc.closeDevice(device); - - // destroy al/c - alc.destroy(); al.destroy(); } Index: PlayTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- PlayTest.java 21 Dec 2002 12:37:20 -0000 1.4 +++ PlayTest.java 27 Apr 2003 18:37:38 -0000 1.5 @@ -64,10 +64,7 @@ } int lastError; - - //initialize AL, using ALC - alInitialize(); - + //create 1 buffer and 1 source IntBuffer buffers = createIntBuffer(1); IntBuffer sources = createIntBuffer(1); Index: PlayTestMemory.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- PlayTestMemory.java 21 Dec 2002 12:37:20 -0000 1.4 +++ PlayTestMemory.java 27 Apr 2003 18:37:38 -0000 1.5 @@ -71,9 +71,6 @@ int lastError; - //initialize AL, using ALC - alInitialize(); - //create 1 buffer and 1 source IntBuffer buffers = createIntBuffer(1); IntBuffer sources = createIntBuffer(1); Index: SourceLimitTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- SourceLimitTest.java 21 Dec 2002 12:37:20 -0000 1.4 +++ SourceLimitTest.java 27 Apr 2003 18:37:38 -0000 1.5 @@ -70,9 +70,6 @@ } } - //initialize AL - alInitialize(); - System.out.print("Creating " + sourcesToCreate + " in one go..."); CreateAllSources(); Index: StressTest.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- StressTest.java 22 Dec 2002 21:43:07 -0000 1.3 +++ StressTest.java 27 Apr 2003 18:37:38 -0000 1.4 @@ -63,8 +63,6 @@ */ protected void execute(String[] args) { - alInitialize(); - createSources(); createBuffers(); @@ -134,7 +132,7 @@ al.sourcei(sources.get(0), AL.BUFFER, buffers.get(0)); al.sourcePlay(sources.get(0)); - while (System.currentTimeMillis() - startTime < (60000 * 60)) { + while (System.currentTimeMillis() - startTime < (2000)) { randomBuffer = getRandomBuffer(); System.out.println("random:" + randomBuffer); @@ -175,6 +173,12 @@ System.out.println("========================"); } } + + //stop all sources + for (int i = 0; i < 4; i++) { + al.sourceStop(sources.get(i)); + System.out.println("Stopping source " + (i+1)); + } //test done - ask for user input try { @@ -188,10 +192,6 @@ } catch (Exception e) { } - //stop all sources - for (int i = 0; i < 4; i++) { - al.sourceStop(sources.get(i)); - } al.deleteSources(4, Sys.getDirectBufferAddress(sources)); al.deleteBuffers(10, Sys.getDirectBufferAddress(buffers)); } |
|
From: Brian M. <ma...@us...> - 2003-04-27 18:37:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv21877a/native/common Modified Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALC.h org_lwjgl_openal_BaseAL.h org_lwjgl_openal_CoreAL.h Log Message: New OpenAL programming model: no context/device fiddling easier initialization Index: org_lwjgl_openal_ALC.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_openal_ALC.cpp 24 Mar 2003 11:56:05 -0000 1.6 +++ org_lwjgl_openal_ALC.cpp 27 Apr 2003 18:37:38 -0000 1.7 @@ -74,11 +74,7 @@ * C Specification: * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_getString (JNIEnv *env, jobject obj, jobject device, jint token) { - jclass class_device = env->GetObjectClass(device); - jfieldID field_device = env->GetFieldID(class_device, "device", "I"); - jint deviceaddress = env->GetIntField(device, field_device); - +JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nGetString (JNIEnv *env, jobject obj, jint deviceaddress, jint token) { const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); if(alcString == NULL) { return NULL; @@ -96,11 +92,7 @@ * C Specification: * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_getIntegerv (JNIEnv *env, jobject obj, jobject device, jint token, jint size, jint dest) { - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv (JNIEnv *env, jobject obj, jint deviceaddress, jint token, jint size, jint dest) { alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, (ALint*) dest); CHECK_ALC_ERROR } @@ -157,11 +149,7 @@ * C Specification: * void alcCloseDevice( ALCdevice *dev ); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_closeDevice (JNIEnv *env, jobject obj, jobject device) { - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_closeDevice (JNIEnv *env, jobject obj, jint deviceaddress) { alcCloseDevice((ALCdevice*) deviceaddress); CHECK_ALC_ERROR } @@ -172,12 +160,7 @@ * C Specification: * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist ); */ -JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_createContext (JNIEnv *env, jobject obj, jobject device, jint attrlist) { - /* get device address */ - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_createContext (JNIEnv *env, jobject obj, jint deviceaddress, jint attrlist) { ALCcontext* context = alcCreateContext((ALCdevice*) deviceaddress, (ALint*) attrlist); /* if error - get out */ @@ -207,16 +190,10 @@ * C Specification: * ALCboolean alcMakeContextCurrent(ALCcontext *context); */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_makeContextCurrent (JNIEnv *env, jobject obj, jobject context) { - if(context == NULL) { +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_makeContextCurrent (JNIEnv *env, jobject obj, jint contextaddress) { + if(contextaddress == NULL) { return alcMakeContextCurrent(NULL); } - - /* get context address */ - jclass context_class = env->GetObjectClass(context); - jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(context, context_field); - return alcMakeContextCurrent((ALCcontext*) contextaddress); } @@ -226,12 +203,7 @@ * C Specification: * void alcProcessContext(ALCcontext *context); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_processContext (JNIEnv *env, jobject obj, jobject context) { - /* get context address */ - jclass context_class = env->GetObjectClass(context); - jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(context, context_field); - +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nProcessContext (JNIEnv *env, jobject obj, jint contextaddress) { alcProcessContext((ALCcontext*) contextaddress); } @@ -269,12 +241,7 @@ * C Specification: * ALCdevice* alcGetContextsDevice(ALCcontext *context); */ -JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_getContextsDevice (JNIEnv *env, jobject obj, jobject context) { - - /* get context address */ - jclass context_class = env->GetObjectClass(context); - jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(context, context_field); +JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_getContextsDevice (JNIEnv *env, jobject obj, jint contextaddress) { ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); if(device == NULL) { @@ -302,12 +269,7 @@ * C Specification: * void alcSuspendContext(ALCcontext *context); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_suspendContext (JNIEnv *env, jobject obj, jobject context) { - /* get context address */ - jclass context_class = env->GetObjectClass(context); - jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(context, context_field); - +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_suspendContext (JNIEnv *env, jobject obj, jint contextaddress) { alcSuspendContext((ALCcontext*) contextaddress); } @@ -317,12 +279,7 @@ * C Specification: * void alcDestroyContext(ALCcontext *context); */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_destroyContext (JNIEnv *env, jobject obj, jobject context) { - /* get context address */ - jclass context_class = env->GetObjectClass(context); - jfieldID context_field = env->GetFieldID(context_class, "context", "I"); - jint contextaddress = env->GetIntField(context, context_field); - +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_destroyContext (JNIEnv *env, jobject obj, jint contextaddress) { alcDestroyContext((ALCcontext*) contextaddress); } @@ -332,12 +289,7 @@ * C Specification: * ALCenum alcGetError(ALCdevice *device); */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getError (JNIEnv *env, jobject obj, jobject device) { - /* get device address */ - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetError (JNIEnv *env, jobject obj, jint deviceaddress) { jint result = alcGetError((ALCdevice*) deviceaddress); CHECK_ALC_ERROR return result; @@ -349,12 +301,7 @@ * C Specification: * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_isExtensionPresent (JNIEnv *env, jobject obj, jobject device, jstring extName) { - /* get device address */ - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nIsExtensionPresent (JNIEnv *env, jobject obj, jint deviceaddress, jstring extName) { /* get extension */ ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(extName, 0)); @@ -372,12 +319,7 @@ * C Specification: * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName); */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getEnumValue (JNIEnv *env, jobject obj, jobject device, jstring enumName) { - /* get device address */ - jclass device_class = env->GetObjectClass(device); - jfieldID device_field = env->GetFieldID(device_class, "device", "I"); - jint deviceaddress = env->GetIntField(device, device_field); - +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetEnumValue (JNIEnv *env, jobject obj, jint deviceaddress, jstring enumName) { /* get extension */ ALubyte* enumerationname = (ALubyte*) (env->GetStringUTFChars(enumName, 0)); Index: org_lwjgl_openal_ALC.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_openal_ALC.h 6 Sep 2002 23:36:34 -0000 1.3 +++ org_lwjgl_openal_ALC.h 27 Apr 2003 18:37:38 -0000 1.4 @@ -1,3 +1,35 @@ +/* + * Copyright (c) 2002 Lightweight Java Game Library Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'Lightweight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + /* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> /* Header for class org_lwjgl_openal_ALC */ @@ -7,6 +39,45 @@ #ifdef __cplusplus extern "C" { #endif +/* Inaccessible static: created */ +#undef org_lwjgl_openal_ALC_INVALID +#define org_lwjgl_openal_ALC_INVALID -1L +#undef org_lwjgl_openal_ALC_FALSE +#define org_lwjgl_openal_ALC_FALSE 0L +#undef org_lwjgl_openal_ALC_TRUE +#define org_lwjgl_openal_ALC_TRUE 1L +#undef org_lwjgl_openal_ALC_NO_ERROR +#define org_lwjgl_openal_ALC_NO_ERROR 0L +#undef org_lwjgl_openal_ALC_MAJOR_VERSION +#define org_lwjgl_openal_ALC_MAJOR_VERSION 4096L +#undef org_lwjgl_openal_ALC_MINOR_VERSION +#define org_lwjgl_openal_ALC_MINOR_VERSION 4097L +#undef org_lwjgl_openal_ALC_ATTRIBUTES_SIZE +#define org_lwjgl_openal_ALC_ATTRIBUTES_SIZE 4098L +#undef org_lwjgl_openal_ALC_ALL_ATTRIBUTES +#define org_lwjgl_openal_ALC_ALL_ATTRIBUTES 4099L +#undef org_lwjgl_openal_ALC_DEFAULT_DEVICE_SPECIFIER +#define org_lwjgl_openal_ALC_DEFAULT_DEVICE_SPECIFIER 4100L +#undef org_lwjgl_openal_ALC_DEVICE_SPECIFIER +#define org_lwjgl_openal_ALC_DEVICE_SPECIFIER 4101L +#undef org_lwjgl_openal_ALC_EXTENSIONS +#define org_lwjgl_openal_ALC_EXTENSIONS 4102L +#undef org_lwjgl_openal_ALC_FREQUENCY +#define org_lwjgl_openal_ALC_FREQUENCY 4103L +#undef org_lwjgl_openal_ALC_REFRESH +#define org_lwjgl_openal_ALC_REFRESH 4104L +#undef org_lwjgl_openal_ALC_SYNC +#define org_lwjgl_openal_ALC_SYNC 4105L +#undef org_lwjgl_openal_ALC_INVALID_DEVICE +#define org_lwjgl_openal_ALC_INVALID_DEVICE 40961L +#undef org_lwjgl_openal_ALC_INVALID_CONTEXT +#define org_lwjgl_openal_ALC_INVALID_CONTEXT 40962L +#undef org_lwjgl_openal_ALC_INVALID_ENUM +#define org_lwjgl_openal_ALC_INVALID_ENUM 40963L +#undef org_lwjgl_openal_ALC_INVALID_VALUE +#define org_lwjgl_openal_ALC_INVALID_VALUE 40964L +#undef org_lwjgl_openal_ALC_OUT_OF_MEMORY +#define org_lwjgl_openal_ALC_OUT_OF_MEMORY 40965L /* * Class: org_lwjgl_openal_ALC * Method: nCreate @@ -25,19 +96,19 @@ /* * Class: org_lwjgl_openal_ALC - * Method: getString - * Signature: (Lorg/lwjgl/openal/ALCdevice;I)Ljava/lang/String; + * Method: nGetString + * Signature: (II)Ljava/lang/String; */ -JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_getString - (JNIEnv *, jobject, jobject, jint); +JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_nGetString + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_ALC - * Method: getIntegerv - * Signature: (Lorg/lwjgl/openal/ALCdevice;III)V + * Method: nGetIntegerv + * Signature: (IIII)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_getIntegerv - (JNIEnv *, jobject, jobject, jint, jint, jint); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nGetIntegerv + (JNIEnv *, jobject, jint, jint, jint, jint); /* * Class: org_lwjgl_openal_ALC @@ -50,34 +121,34 @@ /* * Class: org_lwjgl_openal_ALC * Method: closeDevice - * Signature: (Lorg/lwjgl/openal/ALCdevice;)V + * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_closeDevice - (JNIEnv *, jobject, jobject); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC * Method: createContext - * Signature: (Lorg/lwjgl/openal/ALCdevice;I)Lorg/lwjgl/openal/ALCcontext; + * Signature: (II)Lorg/lwjgl/openal/ALCcontext; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_createContext - (JNIEnv *, jobject, jobject, jint); + (JNIEnv *, jobject, jint, jint); /* * Class: org_lwjgl_openal_ALC * Method: makeContextCurrent - * Signature: (Lorg/lwjgl/openal/ALCcontext;)Z + * Signature: (I)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_makeContextCurrent - (JNIEnv *, jobject, jobject); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC - * Method: processContext - * Signature: (Lorg/lwjgl/openal/ALCcontext;)V + * Method: nProcessContext + * Signature: (I)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_processContext - (JNIEnv *, jobject, jobject); +JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nProcessContext + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC @@ -90,50 +161,50 @@ /* * Class: org_lwjgl_openal_ALC * Method: getContextsDevice - * Signature: (Lorg/lwjgl/openal/ALCcontext;)Lorg/lwjgl/openal/ALCdevice; + * Signature: (I)Lorg/lwjgl/openal/ALCdevice; */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_getContextsDevice - (JNIEnv *, jobject, jobject); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC * Method: suspendContext - * Signature: (Lorg/lwjgl/openal/ALCcontext;)V + * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_suspendContext - (JNIEnv *, jobject, jobject); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC * Method: destroyContext - * Signature: (Lorg/lwjgl/openal/ALCcontext;)V + * Signature: (I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_destroyContext - (JNIEnv *, jobject, jobject); + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC - * Method: getError - * Signature: (Lorg/lwjgl/openal/ALCdevice;)I + * Method: nGetError + * Signature: (I)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getError - (JNIEnv *, jobject, jobject); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetError + (JNIEnv *, jobject, jint); /* * Class: org_lwjgl_openal_ALC - * Method: isExtensionPresent - * Signature: (Lorg/lwjgl/openal/ALCdevice;Ljava/lang/String;)Z + * Method: nIsExtensionPresent + * Signature: (ILjava/lang/String;)Z */ -JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_isExtensionPresent - (JNIEnv *, jobject, jobject, jstring); +JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nIsExtensionPresent + (JNIEnv *, jobject, jint, jstring); /* * Class: org_lwjgl_openal_ALC - * Method: getEnumValue - * Signature: (Lorg/lwjgl/openal/ALCdevice;Ljava/lang/String;)I + * Method: nGetEnumValue + * Signature: (ILjava/lang/String;)I */ -JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getEnumValue - (JNIEnv *, jobject, jobject, jstring); +JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_nGetEnumValue + (JNIEnv *, jobject, jint, jstring); #ifdef __cplusplus } Index: org_lwjgl_openal_BaseAL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseAL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseAL.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_openal_BaseAL.h 22 Mar 2003 23:17:11 -0000 1.2 +++ org_lwjgl_openal_BaseAL.h 27 Apr 2003 18:37:38 -0000 1.3 @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project +/* + * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * 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 + * 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. */ @@ -43,7 +43,7 @@ /* * Class: org_lwjgl_openal_BaseAL * Method: nCreate - * Signature: ()Z + * Signature: ([Ljava/lang/String;)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseAL_nCreate (JNIEnv *, jobject, jobjectArray); 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.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_openal_CoreAL.h 19 Nov 2002 16:39:57 -0000 1.8 +++ org_lwjgl_openal_CoreAL.h 27 Apr 2003 18:37:38 -0000 1.9 @@ -1,31 +1,31 @@ -/* - * Copyright (c) 2002 Light Weight Java Game Library Project +/* + * Copyright (c) 2002 Lightweight Java Game Library Project * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are + * modification, are permitted provided that the following conditions are * met: - * - * * Redistributions of source code must retain the above copyright + * + * * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of + * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * 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 + * 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. */ @@ -39,6 +39,7 @@ #ifdef __cplusplus extern "C" { #endif +/* Inaccessible static: created */ /* * Class: org_lwjgl_openal_CoreAL * Method: enable |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal In directory sc8-pr-cvs1:/tmp/cvs-serv21877a/java/org/lwjgl/openal Modified Files: AL.java ALC.java ALCcontext.java ALCdevice.java BaseAL.java BaseALConstants.java CoreAL.java Log Message: New OpenAL programming model: no context/device fiddling easier initialization Index: AL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/AL.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- AL.java 21 Dec 2002 12:37:19 -0000 1.4 +++ AL.java 27 Apr 2003 18:37:37 -0000 1.5 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,7 +29,9 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; + +import org.lwjgl.Sys; /** * $Id$ @@ -40,10 +42,69 @@ * @version $Revision$ */ public class AL extends CoreAL { + + /** ALC instance. */ + protected ALC alc; + + /** ALCdevice instance. */ + protected ALCdevice device; + + /** Current ALCcontext. */ + protected ALCcontext context; + + /** + * String that requests a certain device or device configuration. + * If null is specified, the implementation will provide an + * implementation specific default. */ + protected String deviceArguments; + + /** Frequency for mixing output buffer, in units of Hz. */ + protected int contextFrequency; + + /** Refresh intervalls, in units of Hz. */ + protected int contextRefresh; + + /** Flag, indicating a synchronous context. */ + protected int contextSynchronized; + + /** + * Creates an OpenAL instance + * + * @param deviceArguments Arguments supplied to native device + * @param contextFrequency Frequency for mixing output buffer, in units of Hz (Common values include 11025, 22050, and 44100). + * @param contextRefresh Refresh intervalls, in units of Hz. + * @param contextSynchronized Flag, indicating a synchronous context.* + */ + public AL(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized) { + this.deviceArguments = deviceArguments; + this.contextFrequency = contextFrequency; + this.contextRefresh = contextRefresh; + this.contextSynchronized = contextSynchronized ? ALC.TRUE : ALC.FALSE; + } + + + /** + * @see org.lwjgl.openal.BaseAL#create() + */ + public void create() throws OpenALException { + super.create(); - /** - * Nothing to se here - please move along - */ - public AL() { - } + alc = new ALC(this); + alc.create(); + + device = alc.openDevice(deviceArguments); + + context = alc.createContext(device.device, + Sys.getDirectBufferAddress( + ALCcontext.createAttributeList(contextFrequency, contextRefresh, contextSynchronized))); + + alc.makeContextCurrent(context.context); + } + + /** + * Retrieves the AL Context class + */ + public ALC getALC() { + return alc; + } } Index: ALC.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALC.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- ALC.java 21 Dec 2002 12:37:19 -0000 1.6 +++ ALC.java 27 Apr 2003 18:37:37 -0000 1.7 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -42,230 +42,251 @@ */ public class ALC { /** Has the ALC object been created? */ - protected static boolean created; - - /** Bad value */ - public static final int INVALID = -1; - - /** Boolean False */ - public static final int FALSE = 0; - - /** Boolean True */ - public static final int TRUE = 1; - - /** Errors: No Error */ - public static final int NO_ERROR = FALSE; - - public static final int MAJOR_VERSION = 0x1000; - public static final int MINOR_VERSION = 0x1001; - public static final int ATTRIBUTES_SIZE = 0x1002; - public static final int ALL_ATTRIBUTES = 0x1003; - - public static final int DEFAULT_DEVICE_SPECIFIER = 0x1004; - public static final int DEVICE_SPECIFIER = 0x1005; - public static final int EXTENSIONS = 0x1006; - - public static final int FREQUENCY = 0x1007; - public static final int REFRESH = 0x1008; - public static final int SYNC = 0x1009; - - /** The device argument does not name a valid device */ - public static final int INVALID_DEVICE = 0xA001; - - /** The context argument does not name a valid context */ - public static final int INVALID_CONTEXT = 0xA002; - - /** - * A function was called at inappropriate time, or in an inappropriate way, - * causing an illegal state. This can be an incompatible ALenum, object ID, - * and/or function. - */ - public static final int INVALID_ENUM = 0xA003; - - /** - * Illegal value passed as an argument to an AL call. - * Applies to parameter values, but not to enumerations. - */ - public static final int INVALID_VALUE = 0xA004; - - /** - * A function could not be completed, because there is not enough - * memory available. - */ - public static final int OUT_OF_MEMORY = 0xA005; - + protected static boolean created; + + /** Parent AL instance */ + protected AL al = null; + + /** Bad value */ + public static final int INVALID = -1; + + /** Boolean False */ + public static final int FALSE = 0; + + /** Boolean True */ + public static final int TRUE = 1; + + /** Errors: No Error */ + public static final int NO_ERROR = FALSE; + + public static final int MAJOR_VERSION = 0x1000; + public static final int MINOR_VERSION = 0x1001; + public static final int ATTRIBUTES_SIZE = 0x1002; + public static final int ALL_ATTRIBUTES = 0x1003; + + public static final int DEFAULT_DEVICE_SPECIFIER = 0x1004; + public static final int DEVICE_SPECIFIER = 0x1005; + public static final int EXTENSIONS = 0x1006; + + public static final int FREQUENCY = 0x1007; + public static final int REFRESH = 0x1008; + public static final int SYNC = 0x1009; + + /** The device argument does not name a valid device */ + public static final int INVALID_DEVICE = 0xA001; + + /** The context argument does not name a valid context */ + public static final int INVALID_CONTEXT = 0xA002; + + /** + * A function was called at inappropriate time, or in an inappropriate way, + * causing an illegal state. This can be an incompatible ALenum, object ID, + * and/or function. + */ + public static final int INVALID_ENUM = 0xA003; + + /** + * Illegal value passed as an argument to an AL call. + * Applies to parameter values, but not to enumerations. + */ + public static final int INVALID_VALUE = 0xA004; + + /** + * A function could not be completed, because there is not enough + * memory available. + */ + public static final int OUT_OF_MEMORY = 0xA005; + static { initialize(); } - - /** Creates a new instance of ALC */ - public ALC() { - } - - /** - * Override to provide any initialization code after creation. - */ + + /** Creates a new instance of ALC */ + protected ALC(AL al) { + this.al = al; + } + + /** + * Override to provide any initialization code after creation. + */ protected void init() { } - + /** * Static initialization */ private static void initialize() { System.loadLibrary(org.lwjgl.Sys.getLibraryName()); } - - /** - * Creates the ALC instance - * - * @throws Exception if a failiure occured in the ALC creation process - */ - public void create() throws Exception { + + /** + * Creates the ALC instance + * + * @throws Exception if a failiure occured in the ALC creation process + */ + protected void create() throws OpenALException { if (created) { return; - } - + } + if (!nCreate()) { - throw new Exception("ALC instance could not be created."); - } - created = true; - init(); + throw new OpenALException("ALC instance could not be created."); + } + init(); + created = true; } - + /** * Native method to create ALC instance * * @return true if the ALC creation process succeeded */ protected native boolean nCreate(); - + /** * Calls whatever destruction rutines that are needed */ - public void destroy() { + protected void destroy() { if (!created) { return; - } - created = false; - nDestroy(); + } + created = false; + nDestroy(); } - + /** * Native method the destroy the ALC */ - protected native void nDestroy(); - - /** - * Returns strings related to the context. - * - * @param device ALCdevice to query - * @param pname Property to get - * @return String property from device - */ - public native String getString(ALCdevice device, int pname); - - /** - * Returns integers related to the context. - * - * @param device ALCdevice to query - * @param pname Property to get - * @param size Size of destination buffer provided - * @param integerdata address of ByteBuffer to write integers to - */ - public native void getIntegerv(ALCdevice device, int pname, int size, int integerdata); - - /** - * Opens the named device. If null is specied, the implementation will - * provide an implementation specic default. - * - * @param devicename name of device to open - * @return opened device, or null - */ - public native ALCdevice openDevice(String devicename); - - /** - * Closes the supplied device. - * - * @param device ALCdevice to close - */ - public native void closeDevice(ALCdevice device); - - /** - * Creates a context using a specified device. - * - * @param device ALCdevice to associate context to - * @param attrList address of ByteBuffer to read attributes from - * @return New context, or null if creation failed - */ - public native ALCcontext createContext(ALCdevice device, int attrList); - - /** - * Makes the supplied context the current one - * - * @param context ALCcontext to make current - * @return true if successfull, false if not - */ - public native boolean makeContextCurrent(ALCcontext context); - - /** - * Tells a context to begin processing. - * - * @param context context that should begin processing - */ - public native void processContext(ALCcontext context); - - /** - * Gets the current context - * - * @return Current ALCcontext - */ - public native ALCcontext getCurrentContext(); - - /** - * Retrives the device associated with the supplied context - * - * @param context ALCcontext to get device for - * @param ALCdevice associated with context - */ - public native ALCdevice getContextsDevice(ALCcontext context); - - /** - * Suspends processing on supplied context - * - * @param context ALCcontext to suspend - */ - public native void suspendContext(ALCcontext context); - - /** - * Destroys supplied context - * - * @param context ALCcontext to Destroy - */ - public native void destroyContext(ALCcontext context); - - /** - * Retrieves the current context error state. - * - * @param device ALDdevice associated with context - * @return Errorcode from ALC statemachine - */ - public native int getError(ALCdevice device); - - /** - * Query if a specified context extension is available. - * - * @param device device to query for extension - * @param extName name of extension to find - * @return true if extension is available, false if not - */ - public native boolean isExtensionPresent(ALCdevice device, String extName); + protected native void nDestroy(); + + /** + * Returns strings related to the context. + * + * @param pname Property to get + * @return String property from device + */ + public String getString(int pname) { + return nGetString(al.device.device, pname); + } + + native String nGetString(int device, int pname); + + /** + * Returns integers related to the context. + * + * @param pname Property to get + * @param size Size of destination buffer provided + * @param integerdata address of ByteBuffer to write integers to + */ + public void getIntegerv(int pname, int size, int integerdata) { + nGetIntegerv(al.device.device, pname, size, integerdata); + } - /** - * retrieves the enum value for a specified enumeration name. - * - * @param device Device to query - * @param enumName name of enum to find - * @return value of enumeration - */ - public native int getEnumValue(ALCdevice device, String enumName); + native void nGetIntegerv(int device, int pname, int size, int integerdata); + + /** + * Opens the named device. If null is specied, the implementation will + * provide an implementation specic default. + * + * @param devicename name of device to open + * @return opened device, or null + */ + native ALCdevice openDevice(String devicename); + + /** + * Closes the supplied device. + * + * @param device address of native device to close + */ + native void closeDevice(int device); + + /** + * Creates a context using a specified device. + * + * @param device address of device to associate context to + * @param attrList address of ByteBuffer to read attributes from + * @return New context, or null if creation failed + */ + native ALCcontext createContext(int device, int attrList); + + /** + * Makes the supplied context the current one + * + * @param context address of context to make current + * @return true if successfull, false if not + */ + native boolean makeContextCurrent(int context); + + /** + * Tells a context to begin processing. + */ + public void processContext() { + nProcessContext(al.context.context); + } + + native void nProcessContext(int context); + + /** + * Gets the current context + * + * @return Current ALCcontext + */ + native ALCcontext getCurrentContext(); + + /** + * Retrives the device associated with the supplied context + * + * @param context address of context to get device for + * @param ALCdevice associated with context + */ + native ALCdevice getContextsDevice(int context); + + /** + * Suspends processing on supplied context + * + * @param context address of context to suspend + */ + native void suspendContext(int context); + + /** + * Destroys supplied context + * + * @param context address of context to Destroy + */ + native void destroyContext(int context); + + /** + * Retrieves the current context error state. + * + * @return Errorcode from ALC statemachine + */ + public int getError() { + return nGetError(al.device.device); + } + + native int nGetError(int device); + + /** + * Query if a specified context extension is available. + * + * @param extName name of extension to find + * @return true if extension is available, false if not + */ + public boolean isExtensionPresent(String extName) { + return nIsExtensionPresent(al.device.device, extName); + } + + native boolean nIsExtensionPresent(int device, String extName); + + /** + * retrieves the enum value for a specified enumeration name. + * + * @param enumName name of enum to find + * @return value of enumeration + */ + public int getEnumValue(String enumName) { + return nGetEnumValue(al.device.device, enumName); + } + + native int nGetEnumValue(int device, String enumName); } Index: ALCcontext.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALCcontext.java 21 Dec 2002 12:37:19 -0000 1.2 +++ ALCcontext.java 27 Apr 2003 18:37:37 -0000 1.3 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,7 +29,10 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; /** * $Id$ @@ -39,7 +42,7 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -public class ALCcontext { +class ALCcontext { /** address of actual context */ public final int context; @@ -51,5 +54,19 @@ */ public ALCcontext(int context) { this.context = context; - } -} + } + + public static ByteBuffer createAttributeList(int contextFrequency, int contextRefresh, int contextSynchronized) { + ByteBuffer attribList = ByteBuffer.allocateDirect(7*4).order(ByteOrder.nativeOrder()); + + attribList.putInt(ALC.FREQUENCY); + attribList.putInt(contextFrequency); + attribList.putInt(ALC.REFRESH); + attribList.putInt(contextRefresh); + attribList.putInt(ALC.SYNC); + attribList.putInt(contextSynchronized); + attribList.putInt(0); //terminating int + + return attribList; + } +} \ No newline at end of file Index: ALCdevice.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ALCdevice.java 21 Dec 2002 12:37:19 -0000 1.2 +++ ALCdevice.java 27 Apr 2003 18:37:37 -0000 1.3 @@ -13,7 +13,7 @@ * 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 + * * Neither the name of 'Lightweight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -29,7 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - package org.lwjgl.openal; +package org.lwjgl.openal; /** * $Id$ @@ -39,7 +39,7 @@ * @author Brian Matzon <br...@ma...> * @version $Revision$ */ -public class ALCdevice { +class ALCdevice { /** address of actual device */ public final int device; @@ -52,4 +52,4 @@ public ALCdevice(int device) { this.device = device; } -} +} \ No newline at end of file Index: BaseAL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseAL.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- BaseAL.java 7 Apr 2003 15:21:09 -0000 1.8 +++ BaseAL.java 27 Apr 2003 18:37:37 -0000 1.9 @@ -47,83 +47,87 @@ * @version $Revision$ */ public abstract class BaseAL { - /** Has the ALC object been created? */ - protected static boolean created; - - static { - initialize(); - } - - /** - * Override to provide any initialization code after creation. - */ - protected void init() throws Exception { - } - - /** - * Static initialization - */ - private static void initialize() { - System.loadLibrary(org.lwjgl.Sys.getLibraryName()); - } - - /** - * Creates the AL instance - * - * @throws Exception if a failiure occured in the AL creation process - */ - public void create() throws Exception { - if (created) { - return; - } - - // need to pass path of possible locations of OAL to native side - String libpath = System.getProperty("java.library.path"); - String seperator = System.getProperty("path.separator"); - String libname; - - // libname is hardcoded atm - this will change in a near future... - libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) ? "libopenal.so" : "OpenAL32.dll"; - - StringTokenizer st = new StringTokenizer(libpath, seperator); - - //create needed string array - String[] oalPaths = new String[st.countTokens() + 1]; + /** Have we been created? */ + protected static boolean created; + + static { + initialize(); + } + + /** + * Override to provide any initialization code after creation. + */ + protected void init() throws OpenALException { + } + + /** + * Static initialization + */ + private static void initialize() { + System.loadLibrary(org.lwjgl.Sys.getLibraryName()); + } + + /** + * Creates the AL instance + * + * @throws Exception if a failiure occured in the AL creation process + */ + public void create() throws OpenALException { + if (created) { + return; + } - //build paths - for (int i = 0; i < oalPaths.length - 1; i++) { - oalPaths[i] = st.nextToken() + File.separator + libname; - } + // need to pass path of possible locations of OAL to native side + String libpath = System.getProperty("java.library.path"); + String seperator = System.getProperty("path.separator"); + String libname; - //add cwd path - oalPaths[oalPaths.length - 1] = libname; - if (!nCreate(oalPaths)) { - throw new Exception("AL instance could not be created."); - } - init(); - created = true; - } + // libname is hardcoded atm - this will change in a near future... + libname = (System.getProperty("os.name").toLowerCase().indexOf("windows") == -1) + ? "libopenal.so" + : "OpenAL32.dll"; - /** - * Native method to create AL instance - * - * @return true if the AL creation process succeeded - */ - protected native boolean nCreate(String[] oalPaths); + StringTokenizer st = new StringTokenizer(libpath, seperator); + + //create needed string array + String[] oalPaths = new String[st.countTokens()+1]; - /** - * Calls whatever destruction rutines that are needed - */ - public void destroy() { - if (!created) { - return; - } - created = false; - nDestroy(); - } + //build paths + for(int i=0;i<oalPaths.length - 1;i++) { + oalPaths[i] = st.nextToken() + File.separator + libname; + } - /** - * Native method the destroy the AL - */ - protected native void nDestroy(); -} + //add cwd path + oalPaths[oalPaths.length-1] = libname; + if (!nCreate(oalPaths)) { + throw new OpenALException("AL instance could not be created."); + } + + init(); + created = true; + } + + /** + * Native method to create AL instance + * + * @param oalPaths Array of strings containing paths to search for OpenAL library + * @return true if the AL creation process succeeded + */ + protected native boolean nCreate(String[] oalPaths); + + /** + * Calls whatever destruction rutines that are needed + */ + public void destroy() { + if (!created) { + return; + } + created = false; + nDestroy(); + } + + /** + * Native method the destroy the AL + */ + protected native void nDestroy(); +} \ No newline at end of file Index: BaseALConstants.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseALConstants.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/openal/BaseALConstants.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- BaseALConstants.java 21 Dec 2002 12:37:19 -0000 1.4 +++ BaseALConstants.java 27 Apr 2003 18:37:37 -0000 1.5 @@ -81,7 +81,7 @@ /** * Specify the pitch to be applied, either at source, - * or on mixer results, at listener. + * or on mixer results, at listener. * Range: [0.5-2.0] * Default: 1.0 */ @@ -90,11 +90,11 @@ /** * Specify the current location in three dimensional space. * OpenAL, like OpenGL, uses a right handed coordinate system, - * where in a frontal default view X (thumb) points right, - * Y points up (index finger), and Z points towards the - * viewer/camera (middle finger). + * where in a frontal default view X (thumb) points right, + * Y points up (index finger), and Z points towards the + * viewer/camera (middle finger). * To switch from a left handed coordinate system, flip the - * sign on the Z coordinate. + * sign on the Z coordinate. * Listener position is always in the world coordinate system. */ public static final int POSITION = 0x1004; @@ -128,8 +128,8 @@ * Each division by 2 equals an attenuation of -6dB. * Each multiplicaton with 2 equals an amplification of +6dB. * A value of 0.0 is meaningless with respect to a logarithmic - * scale; it is interpreted as zero volume - the channel - * is effectively disabled. + * scale; it is interpreted as zero volume - the channel + * is effectively disabled. */ public static final int GAIN = 0x100A; @@ -179,8 +179,8 @@ * Each division by 2 equals an attenuation of -6dB. * Each multiplicaton with 2 equals an amplification of +6dB. * A value of 0.0 is meaningless with respect to a logarithmic - * scale; it is interpreted as zero volume - the channel - * is effectively disabled. + * scale; it is interpreted as zero volume - the channel + * is effectively disabled. */ public static final int CONE_OUTER_GAIN = 0x1022; @@ -234,40 +234,40 @@ /** * Sound buffers: frequency, in units of Hertz [Hz]. * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * sample frequency marks the maximum significant + * frequency component. */ public static final int FREQUENCY = 0x2001; /** * Sound buffers: frequency, in units of Hertz [Hz]. * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * sample frequency marks the maximum significant + * frequency component. */ public static final int BITS = 0x2002; /** * Sound buffers: frequency, in units of Hertz [Hz]. * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * sample frequency marks the maximum significant + * frequency component. */ public static final int CHANNELS = 0x2003; /** * Sound buffers: frequency, in units of Hertz [Hz]. * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * sample frequency marks the maximum significant + * frequency component. */ public static final int SIZE = 0x2004; /** * Sound buffers: frequency, in units of Hertz [Hz]. * This is the number of samples per second. Half of the - * sample frequency marks the maximum significant - * frequency component. + * sample frequency marks the maximum significant + * frequency component. */ public static final int DATA = 0x2005; @@ -295,14 +295,10 @@ /** Errors: No Error. */ public static final int NO_ERROR = FALSE; - /** - * Illegal name passed as an argument to an AL call. - */ + /** Illegal name passed as an argument to an AL call. */ public static final int INVALID_NAME = 0xA001; - /** - * Illegal enum passed as an argument to an AL call. - */ + /** Illegal enum passed as an argument to an AL call. */ public static final int INVALID_ENUM = 0xA002; /** @@ -337,19 +333,13 @@ /** Context strings: Extensions */ public static final int EXTENSIONS = 0xB004; - /** - * Doppler scale. Default 1.0 - */ + /** Doppler scale. Default 1.0 */ public static final int DOPPLER_FACTOR = 0xC000; - /** - * Doppler velocity. Default 1.0 - */ + /** Doppler velocity. Default 1.0 */ public static final int DOPPLER_VELOCITY = 0xC001; - /** - * Distance model. Default INVERSE_DISTANCE_CLAMPED - */ + /** Distance model. Default INVERSE_DISTANCE_CLAMPED */ public static final int DISTANCE_MODEL = 0xD000; /** Distance model */ 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.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CoreAL.java 21 Dec 2002 12:37:19 -0000 1.11 +++ CoreAL.java 27 Apr 2003 18:37:37 -0000 1.12 @@ -41,444 +41,455 @@ * @version $Revision$ */ public class CoreAL extends BaseAL implements BaseALConstants { - - /** Creates a new instance of CoreAL */ - public CoreAL() { - } - - /** - * Enables a feature of the OpenAL driver. - * - * @param capability name of a capability to enable - */ - public native void enable(int capability); - /** - * Disables a feature of the OpenAL driver. - * - * @param capability name of a capability to disable - */ - public native void disable(int capability); - - /** - * Checks if a specific feature is enabled in the OpenAL driver. - * - * @param capability name of a capability to check - * @return true if named feature is enabled - */ - public native boolean isEnabled(int capability); - - /** - * Hinting for implementation - * NOTE: This method is a NOP, but is provided for completeness. - * - * @param target FIXME - * @param mode FIXME - */ - public native void hint(int target, int mode); - - /** - * Returns a boolean OpenAL state. - * - * @param parameter state to be queried - * @return boolean state described by pname will be returned. - */ - public native boolean getBoolean(int pname); - - /** - * Returns an int OpenAL state. - * - * @param parameter state to be queried - * @return int state described by pname will be returned. - */ - public native int getInteger(int pname); - - /** - * Returns a float OpenAL state. - * - * @param parameter state to be queried - * @return float state described by pname will be returned. - */ - public native float getFloat(int pname); - - /** - * Returns a double OpenAL state. - * - * @param parameter state to be queried - * @return double state described by pname will be returned. - */ - public native double getDouble(int pname); - - /** - * Returns a boolean OpenAL state. - * - * @param parameter state to be queried - * @param data address of ByteBuffer to place the booleans in - */ - public native void getBooleanv(int pname, int data); - - /** - * Returns an integer OpenAL state. - * - * @param parameter state to be queried - * @param data address of ByteBuffer to place the integers in - */ - public native void getIntegerv(int pname, int data); - - /** - * Returns a floating point OpenAL state. - * - * @param parameter state to be queried - * @param data address of ByteBuffer to place the floats in - */ - public native void getFloatv(int pname, int data); - - /** - * Returns a double OpenAL state. - * - * @param parameter state to be queried - * @param data address of ByteBuffer to place the floats in - */ - public native void getDoublev(int pname, int data); - - /** - * Retrieve an OpenAL string property. - * - * @param pname The property to be returned - * @return OpenAL String property - */ - public native String getString(int pname); - - /** - * Retrieve the current error state and then clears the error state. - * - * @return current error state - */ - public native int getError(); + /** Creates a new instance of CoreAL */ + public CoreAL() { + super(); + } - /** - * Test if a specific extension is available for the OpenAL driver. - * - * @param fname String describing the desired extension - * @return true if extension is available, false if not - */ - public native boolean isExtensionPresent(String fname); - - /** - * Returns the enumeration value of an OpenAL enum described by a string. - * - * @param ename String describing an OpenAL enum - * @return Actual int for the described enumeration name - */ - public native int getEnumValue(String ename); - - /** - * Sets an integer property of the listener - * - * @param pname name of the attribute to be set - * @param integer value to set the attribute to - */ - public native void listeneri(int pname, int value); - - /** - * Sets a floating point property of the listener - * - * @param pname name of the attribute to be set - * @param value floating point value to set the attribute to - */ - public native void listenerf(int pname, float value); - - /** - * Sets a floating point property of the listener - * - * @param pname name of the attribute to be set - * @param v1 value value 1 - * @param v2 value value 2 - * @param v3 float value 3 - */ - public native void listener3f(int pname, float v1, float v2, float v3); - - /** - * Sets a floating point vector property of the listener - * - * @param pname name of the attribute to be set - * @param floatdata bytebuffer address to read floats from - */ - public native void listenerfv(int pname, int floatdata); - - /** - * Gets an integer property of the listener. - * - * @param pname name of the attribute to be retrieved - * @param integerdata bytebuffer address to write integer to - */ - public native void getListeneri(int pname, int integerdata); - - /** - * Gets a floating point property of the listener. - * - * @param pname name of the attribute to be retrieved - * @param floatdata bytebuffer address to write float to - */ - public native void getListenerf(int pname, int floatdata); - - /** - * Retrieves a set of three floating point values from a - * property of the listener. - * - * @param pname name of the attribute to be retrieved - * @param v1 bytebuffer address to write float 1 to - * @param v2 bytebuffer address to write float 2 to - * @param v3 bytebuffer address to write float 3 to - */ - public native void getListener3f(int pname, int v1, int v2, int v3); - - /** - * Retrieves a floating point vector property of the listener. - * - * @param pname name of the attribute to be retrieved - * @param floatdata bytebuffer address to write floats to - */ - public native void getListenerfv(int pname, int floatdata); - - /** - * Generate one or more sources. - * - * @param n number of sources to generate - * @param sources array holding sources - */ - public native void genSources(int n, int sources); - - /** - * Delete one or more sources. - * - * @param n Number of sources to delete - * @param source Source array to delete from - */ - public native void deleteSources(int n, int source); + /** + * Enables a feature of the OpenAL driver. + * + * @param capability name of a capability to enable + */ + public native void enable(int capability); - /** - * Tests if a source is valid. - * - * @param id id of source to be testes for validity - * @return true if id is valid, false if not - */ - public native boolean isSource(int id); - - /** - * Set an integer property of a source. - * - * @param source Source to det property on - * @param pname property to set - * @param value value of property - */ - public native void sourcei(int source, int pname, int value); - - /** - * Set a floating point property of a source. - * - * @param source Source to det property on - * @param pname property to set - * @param value value of property - */ - public native void sourcef(int source, int pname, float value); - - /** - * Sets a source property requiring three floating point values. - * - * @param source Source to set property on - * @param pname property to set - * @param v1 value 1 of property - * @param v2 value 2 of property - * @param v3 value 3 of property - */ - public native void source3f(int source, int pname, float v1, float v2, float v3); - - /** - * Sets a floating point vector property of a source. - * - * @param source source whichs attribute is being set - * @param pname name of the attribute being set - * @param floatdata bytebuffer address to read floats from - */ - public native void sourcefv(int source, int pname, int floatdata); - - /** - * Retrieves an integer property of a source. - * - * @param source source to get property from - * @param pname name of property - * @param integerdata bytebuffer address to write integer to - */ - public native void getSourcei(int source, int pname, int integerdata); - - /** - * Retrieves a floating point property of a source. - * - * @param source source to get property from - * @param pname name of property - * @param floatdata bytebuffer address to write float to - */ - public native void getSourcef(int source, int pname, int floatdata); - - /** - * Gets a floating point vector property from a Source object. - * - * @param source Source to get property from - * @param pname property to get - * @param floatdata bytebuffer address to write floats to - */ - public native void getSourcefv(int source, int pname, int floatdata); - - /** - * Plays a set of sources. - * - * @param n number of sources to play - * @param source array of sources to play - */ - public native void sourcePlayv(int n, int sources); + /** + * Disables a feature of the OpenAL driver. + * + * @param capability name of a capability to disable + */ + public native void disable(int capability); - /** - * Pauses a set of sources. - * - * @param n number of sources to pause - * @param source array of sources to pause - */ - public native void sourcePausev(int n, int sources); + /** + * Checks if a specific feature is enabled in the OpenAL driver. + * + * @param capability name of a capability to check + * @return true if named feature is enabled + */ + public native boolean isEnabled(int capability); - /** - * Stops a set of sources. - * - * @param n number of sources to stop - * @param source array of sources to stop - */ - public native void sourceStopv(int n, int sources); - - /** - * Rewinds a set of sources. - * - * @param n number of sources to rewind - * @param source array of sources to rewind - */ - public native void sourceRewindv(int n, int sources); - - /** - * Play a source. - * - * @param source Source to play - */ - public native void sourcePlay(int source); + /** + * Hinting for implementation + * NOTE: This method is a NOP, but is provided for completeness. + * + * @param target FIXME + * @param mode FIXME + */ + public native void hint(int target, int mode); - /** - * Pauses a source. - * - * @param source Source to pause - */ - public native void sourcePause(int source); - - /** - * Stops a source. - * - * @param source Source to stop - */ - public native void sourceStop(int source); - - /** - * Rewinds a source. - * - * @param source Source to rewind - */ - public native void sourceRewind(int source); + /** + * Returns a boolean OpenAL state. + * + * @param parameter state to be queried + * @return boolean state described by pname will be returned. + */ + public native boolean getBoolean(int pname); - /** - * Generate one or more buffers. - * - * @param n number of buffers to generate - * @param buffers array holding buffers - */ - public native void genBuffers(int n, int buffers); - - /** - * Delete one or more buffers. - * - * @param n Number of buffers to delete - * @param buffers Buffer array to delete from - */ - public native void deleteBuffers(int n, int buffers); - - /** - * Tests if buffer is valid. - * - * @param buffer buffer to be tested for validity - * @return true if supplied buffer is valid, false if not - */ - public native boolean isBuffer(int buffer); - - /** - * Fill a buffer with audio data. - * - * @param buffer Buffer to fill - * @param format format sound data is in - * @param data location of data (pointer) - * @param size size of data segment - * @param freq frequency of data - */ - public native void bufferData(int buffer, int format, int data, int size, int freq); - - /** - * Retrieves an integer property from a buffer. - * - * @param buffer buffer to get property from - * @param pname name of property to retrieve - * @param integerdata bytebuffer address to write integer to - */ - public native void getBufferi(int buffer, int pname, int integerdata); + /** + * Returns an int OpenAL state. + * + * @param parameter state to be queried + * @return int state described by pname will be returned. + */ + public native int getInteger(int pname); - /** - * Retrieves a floating point property from a buffer. - * - * @param buffer buffer to get property from - * @param pname name of property to retrieve - * @param floatdata bytebuffer address to write float to - */ - public native void getBufferf(int buffer, int pname, int floatdata); - - /** - * Queues a set of buffers on a source. - * - * @param source source to queue buffers onto - * @param n number of buffers to be queued - * @param buffers buffers to be queued - */ - public native void sourceQueueBuffers(int source, int n, int buffers); - - /** - * Unqueues a set of buffers attached to a source. - * - * @param source source to unqueue buffers from - * @param n number of buffers to be unqueued - * @param buffers buffers to be unqueued - */ - public native void sourceUnqueueBuffers(int source, int n, int buffers); - - /** - * Selects the OpenAL distance model. - * - * @param value distance model to be set - */ - public native void distanceModel(int value); - - /** - * Selects the OpenAL Doppler factor value. - * - * @param value Doppler scale value to set - */ - public native void dopplerFactor(float value); - - /** - * Selects the OpenAL Doppler velocity value. - * - * @param value Doppler velocity value to set - */ - public native void dopplerVelocity(float value); + /** + * Returns a float OpenAL state. + * + * @param parameter state to be queried + * @return float state described by pname will be returned. + */ + public native float getFloat(int pname); + + /** + * Returns a double OpenAL state. + * + * @param parameter state to be queried + * @return double state described by pname will be returned. + */ + public native double getDouble(int pname); + + /** + * Returns a boolean OpenAL state. + * + * @param parameter state to be queried + * @param data address of ByteBuffer to place the booleans in + */ + public native void getBooleanv(int pname, int data); + + /** + * Returns an integer OpenAL state. + * + * @param parameter state to be queried + * @param data address of ByteBuffer to place the integers in + */ + public native void getIntegerv(int pname, int data); + + /** + * Returns a floating point OpenAL state. + * + * @param parameter state to be queried + * @param data address of ByteBuffer to place the floats in + */ + public native void getFloatv(int pname, int data); + + /** + * Returns a double OpenAL state. + * + * @param parameter state to be queried + * @param data address of ByteBuffer to place the floats in + */ + public native void getDoublev(int pname, int data); + + /** + * Retrieve an OpenAL string property. + * + * @param pname The property to be returned + * @return OpenAL String property + */ + public native String getString(int pname); + + /** + * Retrieve the current error state and then clears the error state. + * + * @return current error state + */ + public native int getError(); + + /** + * Test if a specific extension is available for the OpenAL driver. + * + * @param fname String describing the desired extension + * @return true if extension is available, false if not + */ + public native boolean isExtensionPresent(String fname); + + /** + * Returns the enumeration value of an OpenAL enum described by a string. + * + * @param ename String describing an OpenAL enum + * @return Actual int for the described enumeration name + */ + public native int getEnumValue(String ename); + + /** + * Sets an integer property of the listener + * + * @param pname name of the attribute to be set + * @param integer value to set the attribute to + */ + public native void listeneri(int pname, int value); + + /** + * Sets a floating point property of the listener + * + * @param pname name of the attribute to be set + * @param value floating point value to set the attribute to + */ + public native void listenerf(int pname, float value); + + /** + * Sets a floating point property of the listener + * + * @param pname name of the attribute to be set + * @param v1 value value 1 + * @param v2 value value 2 + * @param v3 float value 3 + */ + public native void listener3f(int pname, float v1, float v2, float v3); + + /** + * Sets a floating point vector property of the listener + * + * @param pname name of the attribute to be set + * @param floatdata bytebuffer address to read floats from + */ + public native void listenerfv(int pname, int floatdata); + + /** + * Gets an integer property of the listener. + * + * @param pname name of the attribute to be retrieved + * @param integerdata bytebuffer address to write integer to + */ + public native void getListeneri(int pname, int integerdata); + + /** + * Gets a floating point property of the listener. + * + * @param pname name of the attribute to be retrieved + * @param floatdata bytebuffer address to write float to + */ + public native void getListenerf(int pname, int floatdata); + + /** + * Retrieves a set of three floating point values from a + * property of the listener. + * + * @param pname name of the attribute to be retrieved + * @param v1 bytebuffer address to write float 1 to + * @param v2 bytebuffer address to write float 2 to + * @param v3 bytebuffer address to write float 3 to + */ + public native void getListener3f(int pname, int v1, int v2, int v3); + + /** + * Retrieves a floating point vector property of the listener. + * + * @param pname name of the attribute to be retrieved + * @param floatdata bytebuffer address to write floats to + */ + public native void getListenerfv(int pname, int floatdata); + + /** + * Generate one or more sources. + * + * @param n number of sources to generate + * @param sources array holding sources + */ + public native void genSources(int n, int sources); + + /** + * Delete one or more sources. + * + * @param n Number of sources to delete + * @param source Source array to delete from + */ + public native void deleteSources(int n, int source); + + /** + * Tests if a source is valid. + * + * @param id id of source to be testes for validity + * @return true if id is valid, false if not + */ + public native boolean isSource(int id); + + /** + * Set an integer property of a source. + * + * @param source Source to det property on + * @param pname property to set + * @param value value of property + */ + public native void sourcei(int source, int pname, int value); + + /** + * Set a floating point property of a source. + * + * @param source Source to det property on + * @param pname property to set + * @param value value of property + */ + public native void sourcef(int source, int pname, float value); + + /** + * Sets a source property requiring three floating point values. + * + * @param source Source to set property on + * @param pname property to set + * @param v1 value 1 of property + * @param v2 value 2 of property + * @param v3 value 3 of property + */ + public native void source3f( + int source, + int pname, + float v1, + float v2, + float v3); + + /** + * Sets a floating point vector property of a source. + * + * @param source source whichs attribute is being set + * @param pname name of the attribute being set + * @param floatdata bytebuffer address to read floats from + */ + public native void sourcefv(int source, int pname, int floatdata); + + /** + * Retrieves an integer property of a source. + * + * @param source source to get property from + * @param pname name of property + * @param integerdata bytebuffer address to write integer to + */ + public native void getSourcei(int source, int pname, int integerdata); + + /** + * Retrieves a floating point property of a source. + * + * @param source source to get property from + * @param pname name of property + * @param floatdata bytebuffer address to write float to + */ + public native void getSourcef(int source, int pname, int floatdata); + + /** + * Gets a floating point vector property from a Source object. + * + * @param source Source to get property from + * @param pname property to get + * @param floatdata bytebuffer address to write floats to + */ + public native void getSourcefv(int source, int pname, int floatdata); + + /** + * Plays a set of sources. + * + * @param n number of sources to play + * @param source array of sources to play + */ + public native void sourcePlayv(int n, int sources); + + /** + * Pauses a set of sources. + * + * @param n number of sources to pause + * @param source array of sources to pause + */ + public native void sourcePausev(int n, int sources); + + /** + * Stops a set of sources. + * + * @param n number of sources to stop + * @param source array of sources to stop + */ + public native void sourceStopv(int n, int sources); + + /** + * Rewinds a set of sources. + * + * @param n number of sources to rewind + * @param source array of sources to rewind + */ + public native void sourceRewindv(int n, int sources); + + /** + * Play a source. + * + * @param source Source to play + */ + public native void sourcePlay(int source); + + /** + * Pauses a source. + * + * @param source Source to pause + */ + public native void sourcePause(int source); + + /** + * Stops a source. + * + * @param source Source to stop + */ + public native void sourceStop(int source); + + /** + * Rewinds a source. + * + * @param source Source to rewind + */ + public native void sourceRewind(int source); + + /** + * Generate one or more buffers. + * + * @param n number of buffers to generate + * @param buffers array holding buffers + */ + public native void genBuffers(int n, int buffers); + + /** + * Delete one or more buffers. + * + * @param n Number of buffers to delete + * @param buffers Buffer array to delete from + */ + public native void deleteBuffers(int n, int buffers); + + /** + * Tests if buffer is valid. + * + * @param buffer buffer to be tested for validity + * @return true if supplied buffer is valid, false if not + */ + public native boolean isBuffer(int buffer); + + /** + * Fill a buffer with audio data. + * + * @param buffer Buffer to fill + * @param format format sound data is in + * @param data location of data (pointer) + * @param size size of data segment + * @param freq frequency of data + */ + public native void bufferData( + int buffer, + int format, + int data, + int size, + int freq); + + /** + * Retrieves an integer property from a buffer. + * + * @param buffer buffer to get property from + * @param pname name of property to retrieve + * @param integerdata bytebuffer address to write integer to + */ + public native void getBufferi(int buffer, int pname, int integerdata); + + /** + * Retrieves a floating point property from a buffer. + * + * @param buffer buffer to get property from + * @param pname name of property to retrieve + * @param floatdata bytebuffer address to write float to + */ + public native void getBufferf(int buffer, int pname, int floatdata); + + /** + * Queues a set of buffers on a source. + * + * @param source source to queue buffers onto + * @param n number of buffers to be queued + * @param buffers buffers to be queued + */ + public native void sourceQueueBuffers(int source, int n, int buffers); + + /** + * Unqueues a set of buffers attached to a source. + * + * @param source source to unqueue buffers from + * @param n number of buffers to be unqueued + * @param buffers buffers to be unqueued + */ + public native void sourceUnqueueBuffers(int source, int n, int buffers); + + /** + * Selects the OpenAL distance model. + * + * @param value distance model to be set + */ + public native void distanceModel(int value); + + /** + * Selects the OpenAL Doppler factor value. + * + * @param value Doppler scale value to set + */ + public native void dopplerFactor(float value); + + /** + * Selects the OpenAL Doppler velocity value. + * + * @param value Doppler velocity value to set + */ + public native void dopplerVelocity(float value); } |
|
From: Elias N. <eli...@us...> - 2003-04-26 06:54:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv20054/src/native/win32 Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Removed makeContexCurrent and releaseContext Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- org_lwjgl_opengl_BaseGL.cpp 30 Mar 2003 19:40:35 -0000 1.19 +++ org_lwjgl_opengl_BaseGL.cpp 26 Apr 2003 06:54:32 -0000 1.20 @@ -218,25 +218,3 @@ { SwapBuffers(wglGetCurrentDC()); } - -/* - * Class: org_lwjgl_opengl_BaseGL - * Method: nMakeCurrent - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent - (JNIEnv * env, jobject obj) -{ - wglMakeCurrent(hdc, hglrc); -} - -/* - * * Class: org_lwjgl_opengl_BaseGL - * * Method: nFreeContext - * * Signature: ()V - * */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext - (JNIEnv *, jobject) -{ - wglMakeCurrent(NULL, NULL); -} |
|
From: Elias N. <eli...@us...> - 2003-04-26 06:54:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv20054/src/native/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Removed makeContexCurrent and releaseContext Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- org_lwjgl_opengl_BaseGL.cpp 30 Mar 2003 19:40:35 -0000 1.14 +++ org_lwjgl_opengl_BaseGL.cpp 26 Apr 2003 06:54:31 -0000 1.15 @@ -184,25 +184,3 @@ { glXSwapBuffers(getCurrentDisplay(), getCurrentWindow()); } - -/* - * Class: org_lwjgl_opengl_BaseGL - * Method: nMakeCurrent - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent - (JNIEnv * env, jobject obj) -{ - makeCurrent(); -} - -/* - * Class: org_lwjgl_opengl_BaseGL - * Method: nFreeContext - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext - (JNIEnv *, jobject) -{ - releaseContext(); -} |
|
From: Elias N. <eli...@us...> - 2003-04-26 06:54:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv20054/src/java/org/lwjgl/opengl Modified Files: BaseGL.java Log Message: Removed makeContexCurrent and releaseContext Index: BaseGL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- BaseGL.java 30 Mar 2003 19:40:35 -0000 1.16 +++ BaseGL.java 26 Apr 2003 06:54:31 -0000 1.17 @@ -169,15 +169,4 @@ * Natively destroy any GL-related stuff */ private native void nDestroyGL(); - - /** - * Make the GL context current to the current thread - */ - public native void makeContextCurrent(); - - /** - * Release the GL context - */ - public native void releaseContext(); - } |
|
From: Elias N. <eli...@us...> - 2003-04-26 06:54:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv20054/src/native/common Modified Files: org_lwjgl_opengl_BaseGL.h Log Message: Removed makeContexCurrent and releaseContext Index: org_lwjgl_opengl_BaseGL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_opengl_BaseGL.h 30 Mar 2003 19:40:35 -0000 1.8 +++ org_lwjgl_opengl_BaseGL.h 26 Apr 2003 06:54:31 -0000 1.9 @@ -32,22 +32,6 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroyGL (JNIEnv *, jobject); -/* - * Class: org_lwjgl_opengl_BaseGL - * Method: makeContextCurrent - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_makeContextCurrent - (JNIEnv *, jobject); - -/* - * Class: org_lwjgl_opengl_BaseGL - * Method: releaseContext - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_releaseContext - (JNIEnv *, jobject); - #ifdef __cplusplus } #endif |
|
From: Elias N. <eli...@us...> - 2003-04-16 20:28:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv15887/org/lwjgl/opengl Modified Files: GL.java Log Message: Merged cfmdobbie's gl version checking Index: GL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL.java,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- GL.java 3 Apr 2003 11:32:26 -0000 1.23 +++ GL.java 16 Apr 2003 20:28:20 -0000 1.24 @@ -1582,6 +1582,7 @@ public boolean SGIS_generate_mipmap; public boolean SGIX_shadow; public boolean SGIX_depth_texture; + public boolean OpenGL10; public boolean OpenGL11; public boolean OpenGL12; public boolean OpenGL13; @@ -1628,15 +1629,21 @@ int i = version.indexOf("1."); if (i > -1) { char c = version.charAt(i + 2); - if (c == '2') { - OpenGL12 = true; - } else if (c == '3') { - OpenGL12 = true; - OpenGL13 = true; - } else if (c == '4') { - OpenGL12 = true; - OpenGL13 = true; - OpenGL14 = true; + // Each case intentionally falls through! + switch (c) { + case '4': + OpenGL14 = true; + case '3': + OpenGL13 = true; + case '2': + OpenGL12 = true; + case '1': + OpenGL11 = true; + case '0': + OpenGL10 = true; + break ; + default: + // Unexpected character - ignore } } } |
|
From: Brian M. <ma...@us...> - 2003-04-14 18:17:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv21564 Modified Files: org_lwjgl_Display.cpp Log Message: Using EnumDisplaySettingsEx now, to force monitor comparing Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_Display.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- org_lwjgl_Display.cpp 29 Mar 2003 21:52:13 -0000 1.37 +++ org_lwjgl_Display.cpp 14 Apr 2003 18:17:29 -0000 1.38 @@ -67,7 +67,7 @@ if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { #ifdef _DEBUG - printf("Selecting NT display mode check"); + printf("Selecting NT display mode check\n"); #endif return GetAvailableDisplayModesNT(env); } @@ -93,13 +93,16 @@ //enumerate all displays, and all of their displaymodes while(EnumDisplayDevices(NULL, i++, &DisplayDevice, 0) != 0) { - while(EnumDisplaySettings(DisplayDevice.DeviceName, j++, &DevMode) != 0) { +#ifdef _DEBUG + printf("Querying %s device\n", DisplayDevice.DeviceString); +#endif + while(EnumDisplaySettingsEx(DisplayDevice.DeviceName, j++, &DevMode, 0) != 0) { if (DevMode.dmBitsPerPel > 8) { AvailableModes++; } } } - + #ifdef _DEBUG printf("Found %d displaymodes\n", AvailableModes); #endif @@ -113,7 +116,7 @@ i = 0, j = 0, n = 0; while(EnumDisplayDevices(NULL, i++, &DisplayDevice, 0) != 0) { - while(EnumDisplaySettings(DisplayDevice.DeviceName, j++, &DevMode) != 0) { + while(EnumDisplaySettingsEx(DisplayDevice.DeviceName, j++, &DevMode, 0) != 0) { // Filter out indexed modes if (DevMode.dmBitsPerPel > 8) { jobject displayMode; @@ -140,7 +143,7 @@ DevMode.dmSize = sizeof(DEVMODE); //enumerate all displaymodes - while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) { + while(EnumDisplaySettingsEx(NULL, j++, &DevMode, 0) != 0) { if (DevMode.dmBitsPerPel > 8) { AvailableModes++; } @@ -158,7 +161,7 @@ jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V"); i = 0, j = 0, n = 0; - while(EnumDisplaySettings(NULL, j++, &DevMode) != 0) { + while(EnumDisplaySettingsEx(NULL, j++, &DevMode, 0) != 0) { // Filter out indexed modes if (DevMode.dmBitsPerPel > 8) { jobject displayMode; |
|
From: Elias N. <eli...@us...> - 2003-04-13 09:28:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv1077/common Modified Files: extgl.c Log Message: Corrected a linux gl lib loading bug Index: extgl.c CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extgl.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extgl.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- extgl.c 3 Apr 2003 11:32:27 -0000 1.11 +++ extgl.c 13 Apr 2003 09:28:01 -0000 1.12 @@ -3275,7 +3275,7 @@ lib_gl_handle = dlopen("libGL.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_gl_handle == NULL) return 1; - lib_glu_handle = dlopen("libGLU.so", RTLD_LAZY | RTLD_GLOBAL); + lib_glu_handle = dlopen("libGLU.so.1", RTLD_LAZY | RTLD_GLOBAL); if (lib_glu_handle == NULL) return 1; return 0; |
|
From: Elias N. <eli...@us...> - 2003-04-09 15:24:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector In directory sc8-pr-cvs1:/tmp/cvs-serv15200/java/org/lwjgl/vector Modified Files: Vector3f.java Log Message: Removed superflous Vector3f.magnitude() Index: Vector3f.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/vector/Vector3f.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- Vector3f.java 20 Feb 2003 12:16:49 -0000 1.10 +++ Vector3f.java 9 Apr 2003 15:24:27 -0000 1.11 @@ -215,15 +215,6 @@ } /** - * Get the magnitude of of the vector - * @return the magnitude of the vector - */ - public float magnitude() - { - return Math.sqrt( (x * x) + (y * y) + (z * z) ); - } - - /** * The dot product of two vectors is calculated as * v1.x * v2.x + v1.y * v2.y + v1.z * v2.z * @param left The LHS vector |