wrong text for user

changed behaviour
This commit is contained in:
Brian Matzon 2003-12-27 12:28:10 +00:00
parent e854c27358
commit 828f61a3aa
1 changed files with 85 additions and 60 deletions

View File

@ -9,10 +9,9 @@ import org.lwjgl.opengl.*;
import org.lwjgl.input.*;
/**
* $Id$
* <br>
* This test demonstrates OpenAL positioning
* Based on the example by Chad Armstrong (http://www.edenwaith.com/products/pige/tutorials/openal.php)
* $Id$<br>This test
* demonstrates OpenAL positioning Based on the example by Chad Armstrong
* (http://www.edenwaith.com/products/pige/tutorials/openal.php)
*
* @author Brian Matzon <brian@matzon.dk>
* @version $Revision$
@ -50,14 +49,14 @@ public class PositionTest extends BasicTest {
private IntBuffer soundSources = createIntBuffer(3);
/** Position of listener */
private FloatBuffer listenerPosition = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 2.0f });
private FloatBuffer listenerPosition = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f });
/** Velocity of listener */
private FloatBuffer listenerVelocity = createFloatBuffer(3).put(new float[] { 0.0f, 0.0f, 0.0f });
/** Orientation of listener */
private FloatBuffer listenerOrientation =
createFloatBuffer(6).put(new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f });
createFloatBuffer(6).put(new float[] { 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f });
/** Position of left sound */
private FloatBuffer leftPosition = createFloatBuffer(3).put(new float[] { -2.0f, 0.0f, 0.0f });
@ -197,7 +196,7 @@ public class PositionTest extends BasicTest {
AL.alSourcei(soundSources.get(RIGHT), AL.AL_BUFFER, soundBuffers.get(RIGHT));
AL.alSourcei(soundSources.get(RIGHT), AL.AL_LOOPING, AL.AL_TRUE);
Sys.log("Soundfiles loaded successfully, initializing OpenAL environment");
Sys.log("Soundfiles loaded successfully");
// -----------------------------------------------------
// Setup Keyboard
@ -212,13 +211,28 @@ public class PositionTest extends BasicTest {
* Runs the actual demonstration
*/
private void run() {
boolean firstRun = true;
System.out.println("Press 1/4 (left), 2/5 (center) or 3/6 (right) to toggle sound");
System.out.println("Press LEFT/RIGHT to move along x axis");
System.out.println("Press SHIFT and either LEFT/RIGHT to move along y axis");
System.out.println("Press SHIFT and either UP/DOWN to move along y axis");
System.out.println("Press UP/DOWN to move along z axis");
System.out.println("Press ESC to exit demo");
Sys.log(
"Listener position: "
+ listenerPosition.get(0)
+ ", "
+ listenerPosition.get(1)
+ ", "
+ listenerPosition.get(2));
Sys.log(
"Left position: " + leftPosition.get(0) + ", " + leftPosition.get(1) + ", " + leftPosition.get(2));
Sys.log(
"Center position: " + centerPosition.get(0) + ", " + centerPosition.get(1) + ", " + centerPosition.get(2));
Sys.log(
"Right position: " + rightPosition.get(0) + ", " + rightPosition.get(1) + ", " + rightPosition.get(2));
while (!finished) {
// handle any input
handleInput();
@ -231,6 +245,19 @@ public class PositionTest extends BasicTest {
// paint the content and flip buffer
Window.paint();
// start sound after first paint, since we don't want
// the delay before something is painted on the screen
if (firstRun) {
firstRun = false;
// start sounds with delays
AL.alSourcePlay(soundSources.get(LEFT));
pause(300);
AL.alSourcePlay(soundSources.get(CENTER));
pause(500);
AL.alSourcePlay(soundSources.get(RIGHT));
}
}
}
@ -381,7 +408,8 @@ public class PositionTest extends BasicTest {
/**
* main entry point
*
* @param args String array containing arguments
* @param args
* String array containing arguments
*/
public static void main(String[] args) {
PositionTest positionTest = new PositionTest();
@ -389,18 +417,16 @@ public class PositionTest extends BasicTest {
}
/**
* Minute implementation of GLUT:
* <br>
* COPYRIGHT:
* Minute implementation of GLUT: <br>COPYRIGHT:
*
* The OpenGL Utility Toolkit distribution for Win32 (Windows NT &
* Windows 95) contains source code modified from the original source
* code for GLUT version 3.3 which was developed by Mark J. Kilgard. The
* original source code for GLUT is Copyright 1997 by Mark J. Kilgard.
* GLUT for Win32 is Copyright 1997 by Nate Robins and is not in the
* public domain, but it is freely distributable without licensing fees.
* It is provided without guarantee or warrantee expressed or implied.
* It was ported with the permission of Mark J. Kilgard by Nate Robins.
* The OpenGL Utility Toolkit distribution for Win32 (Windows NT & Windows
* 95) contains source code modified from the original source code for GLUT
* version 3.3 which was developed by Mark J. Kilgard. The original source
* code for GLUT is Copyright 1997 by Mark J. Kilgard. GLUT for Win32 is
* Copyright 1997 by Nate Robins and is not in the public domain, but it is
* freely distributable without licensing fees. It is provided without
* guarantee or warrantee expressed or implied. It was ported with the
* permission of Mark J. Kilgard by Nate Robins.
*
* THIS SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@ -425,7 +451,6 @@ public class PositionTest extends BasicTest {
};
float v[][] = new float[8][3];
public void glutWireCube(float size) {
drawBox(size, GL.GL_LINE_LOOP);
}