diff options
author | athomas <[email protected]> | 2003-11-19 01:04:30 +0000 |
---|---|---|
committer | athomas <[email protected]> | 2003-11-19 01:04:30 +0000 |
commit | e67ea5cc93a476bfbd334fb5def5df5ef4e22885 (patch) | |
tree | c99ff66e2dc2bc12a0133471388a82ce32a8e079 | |
parent | e8d650a5cb1e3d80c266271d87788670718b895f (diff) |
Simplified alcOpenDeviceNative a little
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@61 03bf7f67-59de-4072-a415-9a990d468a3f
-rw-r--r-- | src/native/alcbind.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/native/alcbind.c b/src/native/alcbind.c index c598b04..c34e72f 100644 --- a/src/native/alcbind.c +++ b/src/native/alcbind.c @@ -52,19 +52,13 @@ JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL); device = alcOpenDevice(str); printf("In openDeviceNative() test 2a -- %s - %i\n", str, (jint)device); + (*env)->ReleaseStringUTFChars(env,deviceName,str); } 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"); - } result = (jint)device; - printf("In openDeviceNative() test 5\n"); + printf("In openDeviceNative() test 3\n"); printf("Exiting openDeviceNative()\n"); return result; } @@ -81,10 +75,13 @@ JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_createContextNative ALint* attrList = NULL; if(attrs != NULL) { attrList = (ALint*)(*env)->GetPrimitiveArrayCritical(env,attrs,0); + jint ctxPtr = (jint)alcCreateContext(device,attrList); + (*env)->ReleasePrimitiveArrayCritical(env,attrs,attrList,0); + return ctxPtr; + } else { + jint ctxPtr = (jint)alcCreateContext(device,NULL); + return ctxPtr; } - jint ctxPtr = (jint)alcCreateContext(device,attrList); - (*env)->ReleasePrimitiveArrayCritical(env,attrs,attrList,0); - return ctxPtr; } JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_makeContextCurrentNative |