|
From: <ma...@us...> - 2007-04-19 22:23:06
|
Revision: 2779
http://svn.sourceforge.net/java-game-lib/?rev=2779&view=rev
Author: matzon
Date: 2007-04-19 15:23:04 -0700 (Thu, 19 Apr 2007)
Log Message:
-----------
updated to ALC10 instead of ALC
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java
trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java
Modified: trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java 2007-04-19 22:22:18 UTC (rev 2778)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java 2007-04-19 22:23:04 UTC (rev 2779)
@@ -34,7 +34,8 @@
import java.nio.IntBuffer;
import org.lwjgl.BufferUtils;
-import org.lwjgl.openal.ALC;
+import org.lwjgl.openal.AL;
+import org.lwjgl.openal.ALC10;
/**
*
@@ -58,29 +59,29 @@
*/
protected void execute(String[] args) {
//error stuff
- int lastError = ALC.ALC_NO_ERROR;
+ int lastError = ALC10.ALC_NO_ERROR;
//create attribute list for context creation
IntBuffer buffer = BufferUtils.createIntBuffer(7);
- if ((lastError = ALC.alcGetError()) != ALC.ALC_NO_ERROR) {
- System.out.println("ALC Error: " + ALC.alcGetString(lastError));
+ if ((lastError = ALC10.alcGetError(AL.getDevice())) != ALC10.ALC_NO_ERROR) {
+ System.out.println("ALC Error: " + ALC10.alcGetString(AL.getDevice(), lastError));
System.exit(-1);
}
//query
System.out.println(
"DEFAULT_DEVICE_SPECIFIER: "
- + ALC.alcGetString(ALC.ALC_DEFAULT_DEVICE_SPECIFIER));
+ + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
System.out.println(
- "DEVICE_SPECIFIER: " + ALC.alcGetString(ALC.ALC_DEVICE_SPECIFIER));
- System.out.println("EXTENSIONS: " + ALC.alcGetString(ALC.ALC_EXTENSIONS));
+ "DEVICE_SPECIFIER: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_DEVICE_SPECIFIER));
+ System.out.println("EXTENSIONS: " + ALC10.alcGetString(AL.getDevice(), ALC10.ALC_EXTENSIONS));
//mo query
buffer.rewind();
buffer.position(0);
- ALC.alcGetInteger(ALC.ALC_MAJOR_VERSION, buffer);
- ALC.alcGetInteger(ALC.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MAJOR_VERSION, buffer);
+ ALC10.alcGetInteger(AL.getDevice(), ALC10.ALC_MINOR_VERSION, (IntBuffer) buffer.position(1));
System.out.println("ALC_MAJOR_VERSION: " + buffer.get(0));
System.out.println("ALC_MINOR_VERSION: " + buffer.get(1));
@@ -91,7 +92,7 @@
//get an enumerstion value
System.out.println(
"Value of ALC_MAJOR_VERSION: "
- + ALC.alcGetEnumValue("ALC_MAJOR_VERSION"));
+ + ALC10.alcGetEnumValue(AL.getDevice(), "ALC_MAJOR_VERSION"));
alExit();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java 2007-04-19 22:22:18 UTC (rev 2778)
+++ trunk/LWJGL/src/java/org/lwjgl/test/openal/BasicTest.java 2007-04-19 22:23:04 UTC (rev 2779)
@@ -36,6 +36,7 @@
import org.lwjgl.BufferUtils;
import org.lwjgl.openal.AL;
import org.lwjgl.openal.AL10;
+import org.lwjgl.openal.ALC10;
import org.lwjgl.opengl.DisplayMode;
/**
@@ -53,23 +54,21 @@
*/
public BasicTest() {
try {
- String[] imps = AL.getImplementations();
- if(imps.length > 0) {
- System.out.println("Available devices: ");
- for(int i=0; i<imps.length; i++) {
- System.out.println(" " + i + ": " + imps[i]);
- }
- }
+ AL.create();
+
+ System.out.println("Default device: " + ALC10.alcGetString(null, ALC10.ALC_DEFAULT_DEVICE_SPECIFIER));
+
+ if(ALC10.alcIsExtensionPresent(null, "ALC_ENUMERATION_EXT")) {
+ String[] devices = ALC10.alcGetString(null, ALC10.ALC_DEVICE_SPECIFIER).split("\0");
+ System.out.println("Available devices: ");
+ for(int i=0; i<devices.length; i++) {
+ System.out.println(i +": " + devices[i]);
+ }
+ }
} catch (Exception e) {
- System.out.println("Unable to query available devices: " + e.getMessage());
+ System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
+ return;
}
-
- try {
- AL.create();
- } catch (Exception e) {
- System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e);
- return;
- }
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|