diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/java/net/java/games/joal/ALCImpl.java | 3 | ||||
-rw-r--r-- | src/java/net/java/games/joal/util/ALut.java | 5 | ||||
-rw-r--r-- | src/native/alcbind.c | 22 |
3 files changed, 24 insertions, 6 deletions
diff --git a/src/java/net/java/games/joal/ALCImpl.java b/src/java/net/java/games/joal/ALCImpl.java index 3edfd7e..a2ce1e8 100644 --- a/src/java/net/java/games/joal/ALCImpl.java +++ b/src/java/net/java/games/joal/ALCImpl.java @@ -53,7 +53,8 @@ final class ALCImpl implements ALC { Device result = null; int pointer = openDeviceNative(deviceName); if(pointer != 0) { - result = new Device(openDeviceNative(deviceName)); + System.out.println("Device Pointer = " + pointer); + result = new Device(pointer); } return result; } diff --git a/src/java/net/java/games/joal/util/ALut.java b/src/java/net/java/games/joal/util/ALut.java index 7f0772f..5bb13f9 100644 --- a/src/java/net/java/games/joal/util/ALut.java +++ b/src/java/net/java/games/joal/util/ALut.java @@ -55,6 +55,7 @@ public final class ALut { private ALut() { } public static void alutInit() { + System.out.println("Entering alutInit()"); ALFactory.initialize(); alc = ALFactory.getALC(); String deviceName = null; @@ -67,8 +68,9 @@ public final class ALut { */ ALC.Context context; ALC.Device device; - + System.out.println("In alutInit(): Device Name = " + deviceName); device = alc.alcOpenDevice(deviceName); + System.out.println("In alutInit(): Device = " + device); context = alc.alcCreateContext(device, null); alc.alcMakeContextCurrent(context); /* @@ -82,6 +84,7 @@ public final class ALut { + "for the inconvenience."); } */ + System.out.println("Exiting alutInit()"); } public static void alutLoadWAVFile( diff --git a/src/native/alcbind.c b/src/native/alcbind.c index d35f292..c598b04 100644 --- a/src/native/alcbind.c +++ b/src/native/alcbind.c @@ -43,15 +43,29 @@ JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetErrorNative JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative (JNIEnv *env, jobject obj, jstring deviceName) { + printf("Entering openDeviceNative()\n"); + printf("In openDeviceNative() test 1\n"); jint result; - ALubyte *str = NULL; + ALubyte *str; + ALCdevice *device; if(deviceName != NULL) { str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL); + device = alcOpenDevice(str); + printf("In openDeviceNative() test 2a -- %s - %i\n", str, (jint)device); + } else { + device = alcOpenDevice(NULL); + printf("In openDeviceNative() test 2b -- NULL - %i\n", (jint)device); + } + printf("In openDeviceNative() test 3\n"); + if(deviceName != NULL) { + (*env)->ReleaseStringUTFChars(env,deviceName,str); + printf("In openDeviceNative() test 4a\n"); + } else { + printf("In openDeviceNative() test 4b\n"); } - ALCdevice *device; - device = alcOpenDevice(str); - (*env)->ReleaseStringUTFChars(env,deviceName,str); result = (jint)device; + printf("In openDeviceNative() test 5\n"); + printf("Exiting openDeviceNative()\n"); return result; } |