aboutsummaryrefslogtreecommitdiffstats
path: root/src/native/alcbind.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/native/alcbind.c')
-rw-r--r--src/native/alcbind.c22
1 files changed, 18 insertions, 4 deletions
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;
}