aboutsummaryrefslogtreecommitdiffstats
path: root/src/native
diff options
context:
space:
mode:
authorathomas <[email protected]>2003-06-07 00:24:00 +0000
committerathomas <[email protected]>2003-06-07 00:24:00 +0000
commit5f9e58c5b1a23119a63dfb1e76e73349858439db (patch)
tree15dd6447e3a3d51aa527a75d2640a20537c1adde /src/native
parent52acaea03c9dd7512fcc17f4ce16d1e86f4512eb (diff)
Initial check-in of project files
git-svn-id: file:///home/mbien/NetBeansProjects/JOGAMP/joal-sync/git-svn/../svn-server-sync/joal/trunk@21 03bf7f67-59de-4072-a415-9a990d468a3f
Diffstat (limited to 'src/native')
-rw-r--r--src/native/albind.c720
-rw-r--r--src/native/albind.h703
-rw-r--r--src/native/alcbind.c140
-rw-r--r--src/native/alcbind.h148
-rw-r--r--src/native/alfactory.c47
-rw-r--r--src/native/alfactory.h66
-rw-r--r--src/native/build.xml71
-rw-r--r--src/native/eaxbind.c85
-rw-r--r--src/native/eaxbind.h63
-rw-r--r--src/native/eaxfactory.c50
-rw-r--r--src/native/eaxfactory.h58
-rw-r--r--src/native/extal.c416
-rw-r--r--src/native/extal.h315
13 files changed, 2882 insertions, 0 deletions
diff --git a/src/native/albind.c b/src/native/albind.c
new file mode 100644
index 0000000..023f235
--- /dev/null
+++ b/src/native/albind.c
@@ -0,0 +1,720 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+#include "albind.h"
+#include "extal.h"
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numBuffers, jobject buffers) {
+ if(buffers == 0) {
+
+ }
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers);
+ alGenBuffers((ALsizei)numBuffers,p);
+}
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__I_3I
+ (JNIEnv *env, jobject obj, jint numBuffers, jintArray buffers) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0);
+ if(p) {
+ alGenBuffers((ALsizei)numBuffers,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numBuffers, jobject buffers) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers);
+ if(p) {
+ alDeleteBuffers((ALsizei)numBuffers,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__I_3I
+ (JNIEnv *env, jobject obj, jint numBuffers, jintArray buffers) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0);
+ if(p) {
+ alDeleteBuffers((ALsizei)numBuffers,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0);
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsBuffer
+ (JNIEnv *env, jobject obj, jint bufferName) {
+ jboolean result;
+ result = alIsBuffer((ALuint)bufferName);
+ return result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__IILjava_nio_ByteBuffer_2II
+ (JNIEnv *env,
+ jobject obj,
+ jint bufferName,
+ jint format,
+ jobject data,
+ jint size,
+ jint frequency) {
+ ALvoid *p = (ALvoid*)(*env)->GetDirectBufferAddress(env,data);
+ if(p) {
+ alBufferData((ALuint)bufferName,
+ (ALenum)format,
+ p,
+ (ALsizei)size,
+ (ALsizei)frequency);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__II_3BII
+ (JNIEnv *env,
+ jobject obj,
+ jint bufferName,
+ jint format,
+ jbyteArray data,
+ jint size,
+ jint frequency) {
+ ALvoid *p = (ALvoid*)(*env)->GetPrimitiveArrayCritical(env,data,0);
+ if(p) {
+ alBufferData((ALuint)bufferName,
+ (ALenum)format,
+ p,
+ (ALsizei)size,
+ (ALsizei)frequency);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,data,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__II_3F
+ (JNIEnv *env, jobject obj, jint buffer, jint pname, jfloatArray rv) {
+ ALfloat *result = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0);
+ alGetBufferf((ALuint)buffer, (ALenum)pname, result);
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,result,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint buffer, jint pname, jobject rv) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,rv);
+ if(p) {
+ alGetBufferf((ALuint)buffer, (ALenum)pname, p);
+ }
+}
+
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetBufferf__II
+ (JNIEnv *env, jobject obj, jint buffer, jint pname) {
+ jfloat result;
+ alGetBufferf((ALuint)buffer, (ALenum)pname, &result);
+ return result;
+}
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__II_3I
+ (JNIEnv *env, jobject obj, jint buffer, jint pname, jintArray rv) {
+ ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,rv,0);
+ if(p) {
+ alGetBufferi((ALuint)buffer, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint buffer, jint pname, jobject rv) {
+ ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,rv);
+ if(p) {
+ alGetBufferi((ALuint)buffer, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetBufferi__II
+ (JNIEnv *env, jobject obj, jint buffer, jint pname) {
+ ALint result;
+ alGetBufferi((ALuint)buffer, (ALenum)pname, &result);
+ return (jint)result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alGenSources((ALsizei)numSources,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alGenSources((ALsizei)numSources,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alDeleteSources((ALsizei)numSources, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alDeleteSources
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alDeleteSources((ALsizei)numSources, p);
+ }
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsSource
+ (JNIEnv *env, jobject obj, jint sourceName) {
+ alIsSource((ALuint)sourceName);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcei
+ (JNIEnv *env, jobject obj, jint source, jint pname, jint value) {
+ alSourcei((ALuint)source,(ALenum)pname, (ALint)value);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcef
+ (JNIEnv *env, jobject obj, jint source, jint pname, jfloat value) {
+ alSourcef((ALuint)source,(ALenum)pname, (ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative__II_3F
+ (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray value) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alSourcefv((ALuint)source, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alSourcefv
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint pname, jobject value) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value);
+ alSourcefv((ALuint)source, (ALenum)pname, p);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSource3f
+ (JNIEnv *env,
+ jobject obj,
+ jint source,
+ jint pname,
+ jfloat v1,
+ jfloat v2,
+ jfloat v3) {
+ alSource3f((ALuint)source,
+ (ALenum)pname,
+ (ALfloat)v1,
+ (ALfloat)v2,
+ (ALfloat)v3);
+}
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__II_3F
+ (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray rv) {
+ ALfloat *p = (*env)->GetPrimitiveArrayCritical(env,rv,0);
+ if(p) {
+ alGetSourcef((ALuint)source, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetSourcef
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint pname, jobject rv) {
+ ALfloat *p = (*env)->GetDirectBufferAddress(env,rv);
+ if(p) {
+ alGetSourcef((ALuint)source, (ALenum)pname, p);
+ }
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetSourcef
+ * Signature: (II)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetSourcef__II
+ (JNIEnv *env, jobject obj, jint source, jint pname) {
+ jfloat result;
+ alGetSourcef((ALuint)source, (ALenum)pname, &result);
+ return result;
+}
+
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint pname, jobject value) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetSourcefv((ALuint)source, (ALenum)pname, p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__II_3F
+ (JNIEnv *env, jobject obj, jint source, jint pname, jfloatArray value) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetSourcefv((ALuint)source, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__II_3I
+ (JNIEnv *env, jobject obj, jint source, jint pname, jintArray rv) {
+ ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,rv,0);
+ if(p) {
+ alGetSourcei((ALuint)source, (ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetSourcei
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint pname, jobject rv) {
+ ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,rv);
+ if(p) {
+ alGetSourcei((ALuint)source, (ALenum)pname, p);
+ }
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetSourcei
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetSourcei__II
+ (JNIEnv *env, jobject obj, jint source, jint pname) {
+ ALint result;
+ alGetSourcei((ALuint)source, (ALenum)pname, &result);
+ return (jint)result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlay
+ (JNIEnv *env, jobject obj, jint source) {
+ alSourcePlay((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alSourcePlayv((ALsizei)numSources,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alSourcePlayv((ALsizei)numSources,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePause
+ (JNIEnv *env, jobject obj, jint source) {
+ alSourcePause((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alSourcePausev((ALsizei)numSources,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alSourcePausev((ALsizei)numSources,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStop
+ (JNIEnv *env, jobject obj, jint source) {
+ alSourceStop((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alSourceStopv((ALsizei)numSources,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alSourceStopv((ALsizei)numSources,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewind
+ (JNIEnv *env, jobject obj, jint source) {
+ alSourceRewind((ALuint)source);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__I_3I
+ (JNIEnv *env, jobject obj, jint numSources, jintArray sources) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,sources,0);
+ if(p) {
+ alSourceRewindv((ALsizei)numSources,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,sources,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint numSources, jobject sources) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,sources);
+ if(p) {
+ alSourceRewindv((ALsizei)numSources,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint numBuffers, jobject buffers) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers);
+ if(p) {
+ alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__II_3I
+ (JNIEnv *env, jobject obj, jint source, jint numBuffers, jintArray buffers) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0);
+ if(p) {
+ alSourceQueueBuffers((ALuint)source, (ALsizei)numBuffers, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__II_3I
+ (JNIEnv *env, jobject obj, jint source, jint numBuffers, jintArray buffers) {
+ ALuint *p = (ALuint*)(*env)->GetPrimitiveArrayCritical(env,buffers,0);
+ if(p) {
+ alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,buffers,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint source, jint numBuffers, jobject buffers) {
+ ALuint *p = (ALuint*)(*env)->GetDirectBufferAddress(env,buffers);
+ if(p) {
+ alSourceUnqueueBuffers((ALuint)source, (ALsizei)numBuffers, p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerf
+ (JNIEnv *env, jobject obj, jint pname, jfloat value) {
+ alListenerf((ALenum)pname,(ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListener3f
+ (JNIEnv *env, jobject obj, jint pname, jfloat v1, jfloat v2, jfloat v3) {
+ alListener3f((ALenum)pname, (ALfloat)v1, (ALfloat)v2, (ALfloat)v3);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfvNative__I_3F
+ (JNIEnv *env, jobject obj, jint pname, jfloatArray rv) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0);
+ alListenerfv((ALenum)pname, p);
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfvNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value);
+ alListenerfv((ALenum)pname, p);
+}
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__I_3F
+ (JNIEnv *env, jobject obj, jint pname, jfloatArray rv) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,rv,0);
+ if(p) {
+ alGetListenerf((ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,rv,p,0);
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetListenerf
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject rv) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,rv);
+ if(p) {
+ alGetListenerf((ALenum)pname, p);
+ }
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetListenerf
+ * Signature: (I)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetListenerf__I
+ (JNIEnv *env, jobject object, jint pname) {
+ jfloat result;
+ alGetListenerf((ALenum)pname, &result);
+ return result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__I_3F_3F_3F
+ (JNIEnv *env, jobject obj, jint pname, jfloatArray v1, jfloatArray v2, jfloatArray v3) {
+ ALfloat *p1 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v1,0);
+ ALfloat *p2 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v2,0);
+ ALfloat *p3 = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,v3,0);
+ if(p1 && p2 && p3) {
+ alGetListener3f((ALenum)pname, p1, p2, p3);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,v3,p3,0);
+ (*env)->ReleasePrimitiveArrayCritical(env,v2,p2,0);
+ (*env)->ReleasePrimitiveArrayCritical(env,v1,p1,0);
+}
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__ILjava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject v1, jobject v2, jobject v3) {
+ ALfloat *p1 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v1);
+ ALfloat *p2 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v2);
+ ALfloat *p3 = (ALfloat*)(*env)->GetDirectBufferAddress(env,v3);
+ if(p1 && p2 && p3) {
+ alGetListener3f((ALenum)pname, p1, p2, p3);
+ }
+}
+
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__I_3F
+ (JNIEnv *env, jobject obj, jint pname, jfloatArray value) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetListenerfv((ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetListenerfv((ALenum)pname, p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__I_3I
+ (JNIEnv *env, jobject obj, jint pname, jintArray value) {
+ ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetListeneri((ALenum)pname, p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetListeneri
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetListeneri((ALenum)pname, p);
+ }
+}
+
+/*
+ * Class: net_java_games_joal_AL
+ * Method: alGetListeneri
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetListeneri__I
+ (JNIEnv *env, jobject obj, jint pname) {
+ ALint result;
+ alGetListeneri((ALenum)pname, &result);
+ return (jint)result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alEnable
+ (JNIEnv *env, jobject obj, jint capability) {
+ alEnable((ALenum)capability);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDisable
+ (JNIEnv *env, jobject obj, jint capability) {
+ alDisable((ALenum)capability);
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsEnabled
+ (JNIEnv *env, jobject obj, jint pname) {
+ return alIsEnabled((ALenum)pname);
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alGetBoolean
+ (JNIEnv *env, jobject obj, jint pname) {
+ return alGetBoolean((ALenum)pname);
+}
+
+JNIEXPORT jdouble JNICALL Java_net_java_games_joal_ALImpl_alGetDouble
+ (JNIEnv *env, jobject obj, jint pname) {
+ return alGetDouble((ALenum)pname);
+}
+
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetFloat
+ (JNIEnv *env, jobject obj, jint pname) {
+ return alGetFloat((ALenum)pname);
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetInteger
+ (JNIEnv *env, jobject obj, jint pname) {
+ return alGetInteger((ALenum)pname);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__I_3D
+ (JNIEnv *env, jobject obj, jint pname, jdoubleArray value) {
+ ALdouble *p = (ALdouble*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetDoublev((ALenum)pname,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__ILjava_nio_DoubleBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALdouble *p = (ALdouble*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetDoublev((ALenum)pname,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__I_3F
+ (JNIEnv *env, jobject obj, jint pname, jfloatArray value) {
+ ALfloat *p = (ALfloat*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetFloatv((ALenum)pname,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALfloat *p = (ALfloat*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetFloatv((ALenum)pname,p);
+ }
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__I_3I
+ (JNIEnv *env, jobject obj, jint pname, jintArray value) {
+ ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,value,0);
+ if(p) {
+ alGetIntegerv((ALenum)pname,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,value,p,0);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *env, jobject obj, jint pname, jobject value) {
+ ALint *p = (ALint*)(*env)->GetDirectBufferAddress(env,value);
+ if(p) {
+ alGetIntegerv((ALenum)pname,p);
+ }
+}
+
+
+JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALImpl_alGetString
+ (JNIEnv *env, jobject obj, jint pname) {
+ ALubyte* p = alGetString((ALenum)pname);
+ return (*env)->NewStringUTF(env, p);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDistanceModel
+ (JNIEnv *env, jobject obj, jint value) {
+ alDistanceModel((ALenum)value);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerFactor
+ (JNIEnv *env, jobject obj, jfloat value) {
+ alDopplerFactor((ALfloat)value);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerVelocity
+ (JNIEnv *env, jobject obj, jfloat value) {
+ alDopplerVelocity((ALfloat)value);
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetError
+ (JNIEnv *env, jobject obj) {
+ return alGetError();
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsExtensionPresent
+ (JNIEnv *env, jobject obj, jstring extName) {
+ ALubyte *str;
+ str = (ALubyte*)(*env)->GetStringUTFChars(env, extName, NULL);
+ if(!str) {
+ return 0;
+ }
+ return alIsExtensionPresent(str);
+}
diff --git a/src/native/albind.h b/src/native/albind.h
new file mode 100644
index 0000000..fd64846
--- /dev/null
+++ b/src/native/albind.h
@@ -0,0 +1,703 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_java_games_joal_ALImpl */
+
+#ifndef _Included_net_java_games_joal_ALImpl
+#define _Included_net_java_games_joal_ALImpl
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGenBuffersNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGenBuffersNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenBuffersNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDeleteBuffersNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDeleteBuffersNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteBuffersNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alIsBuffer
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsBuffer
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alBufferDataNative
+ * Signature: (II[BII)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__II_3BII
+ (JNIEnv *, jobject, jint, jint, jbyteArray, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alBufferDataNative
+ * Signature: (IILjava/nio/ByteBuffer;II)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alBufferDataNative__IILjava_nio_ByteBuffer_2II
+ (JNIEnv *, jobject, jint, jint, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferfNative
+ * Signature: (II[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__II_3F
+ (JNIEnv *, jobject, jint, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferfNative
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferfNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferf
+ * Signature: (II)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetBufferf
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferiNative
+ * Signature: (II[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__II_3I
+ (JNIEnv *, jobject, jint, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferiNative
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetBufferiNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBufferi
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetBufferi
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGenSourcesNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGenSourcesNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGenSourcesNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDeleteSourcesNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDeleteSourcesNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDeleteSourcesNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alIsSource
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsSource
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcei
+ * Signature: (III)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcei
+ (JNIEnv *, jobject, jint, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcef
+ * Signature: (IIF)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcef
+ (JNIEnv *, jobject, jint, jint, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcefv
+ * Signature: (II[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefv
+ (JNIEnv *, jobject, jint, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcefvNative
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcefvNative
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSource3f
+ * Signature: (IIFFF)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSource3f
+ (JNIEnv *, jobject, jint, jint, jfloat, jfloat, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcefNative
+ * Signature: (II[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__II_3F
+ (JNIEnv *, jobject, jint, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcefNative
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcef
+ * Signature: (II)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetSourcef
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcefvNative
+ * Signature: (IILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__IILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcefvNative
+ * Signature: (II[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourcefvNative__II_3F
+ (JNIEnv *, jobject, jint, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourceiNative
+ * Signature: (II[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__II_3I
+ (JNIEnv *, jobject, jint, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourceiNative
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetSourceiNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetSourcei
+ * Signature: (II)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetSourcei
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePlay
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlay
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePlayvNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePlayvNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePlayvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePause
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePause
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePausevNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourcePausevNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourcePausevNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceStop
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStop
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceStopvNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceStopvNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceStopvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceRewind
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewind
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceRewindvNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceRewindvNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceRewindvNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceQueueBuffersNative
+ * Signature: (II[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__II_3I
+ (JNIEnv *, jobject, jint, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceQueueBuffersNative
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceQueueBuffersNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceUnqueueBuffersNative
+ * Signature: (II[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__II_3I
+ (JNIEnv *, jobject, jint, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alSourceUnqueueBuffersNative
+ * Signature: (IILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alSourceUnqueueBuffersNative__IILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alListenerf
+ * Signature: (IF)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerf
+ (JNIEnv *, jobject, jint, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alListener3f
+ * Signature: (IFFF)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListener3f
+ (JNIEnv *, jobject, jint, jfloat, jfloat, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alListenerfv
+ * Signature: (I[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfv__I_3F
+ (JNIEnv *, jobject, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alListenerfv
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListenerfv__ILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alListeneri
+ * Signature: (II)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alListeneri
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListenerfNative
+ * Signature: (I[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__I_3F
+ (JNIEnv *, jobject, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListenerfNative
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListenerf
+ * Signature: (I)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetListenerf
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListener3fNative
+ * Signature: (ILjava/nio/FloatBuffer;Ljava/nio/FloatBuffer;Ljava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__ILjava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2Ljava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jobject, jobject, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListener3fNative
+ * Signature: (I[F[F[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListener3fNative__I_3F_3F_3F
+ (JNIEnv *, jobject, jint, jfloatArray, jfloatArray, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListenerfvNative
+ * Signature: (I[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__I_3F
+ (JNIEnv *, jobject, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListenerfvNative
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListenerfvNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListeneriNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListeneriNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetListeneriNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetListeneri
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetListeneri
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alEnable
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alEnable
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDisable
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDisable
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alIsEnabled
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsEnabled
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetBoolean
+ * Signature: (I)Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alGetBoolean
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetDouble
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_net_java_games_joal_ALImpl_alGetDouble
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetFloat
+ * Signature: (I)F
+ */
+JNIEXPORT jfloat JNICALL Java_net_java_games_joal_ALImpl_alGetFloat
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetInteger
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetInteger
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetDoublevNative
+ * Signature: (I[D)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__I_3D
+ (JNIEnv *, jobject, jint, jdoubleArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetDoublevNative
+ * Signature: (ILjava/nio/DoubleBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetDoublevNative__ILjava_nio_DoubleBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetFloatvNative
+ * Signature: (I[F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__I_3F
+ (JNIEnv *, jobject, jint, jfloatArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetFloatvNative
+ * Signature: (ILjava/nio/FloatBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetFloatvNative__ILjava_nio_FloatBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetIntegervNative
+ * Signature: (I[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__I_3I
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetIntegervNative
+ * Signature: (ILjava/nio/IntBuffer;)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alGetIntegervNative__ILjava_nio_IntBuffer_2
+ (JNIEnv *, jobject, jint, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetString
+ * Signature: (I)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALImpl_alGetString
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDistanceModel
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDistanceModel
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDopplerFactor
+ * Signature: (F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerFactor
+ (JNIEnv *, jobject, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alDopplerVelocity
+ * Signature: (F)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALImpl_alDopplerVelocity
+ (JNIEnv *, jobject, jfloat);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetError
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetError
+ (JNIEnv *, jobject);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alIsExtensionPresent
+ * Signature: (Ljava/lang/String;)Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALImpl_alIsExtensionPresent
+ (JNIEnv *, jobject, jstring);
+
+/*
+ * Class: net_java_games_joal_ALImpl
+ * Method: alGetEnumValue
+ * Signature: (Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALImpl_alGetEnumValue
+ (JNIEnv *, jobject, jstring);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/alcbind.c b/src/native/alcbind.c
new file mode 100644
index 0000000..e9a64a8
--- /dev/null
+++ b/src/native/alcbind.c
@@ -0,0 +1,140 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+#include "alcbind.h"
+#include "extal.h"
+
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative
+ (JNIEnv *env, jobject obj, jstring deviceName) {
+ jint result;
+ ALubyte *str;
+ str = (ALubyte*)(*env)->GetStringUTFChars(env,deviceName,NULL);
+ ALCdevice *device;
+ device = alcOpenDevice(str);
+ (*env)->ReleaseStringUTFChars(env,deviceName,str);
+ result = (jint)device;
+ return result;
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_closeDeviceNative
+ (JNIEnv *env, jobject obj, jint pointer) {
+ ALCdevice* device = (ALCdevice*)pointer;
+ alcCloseDevice(device);
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_createContextNative
+ (JNIEnv *env, jobject obj, jint pointer, jintArray attrs) {
+ ALCdevice* device = (ALCdevice*)pointer;
+ 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;
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_makeContextCurrentNative
+ (JNIEnv *env, jobject obj, jint pointer) {
+ ALvoid* alcHandle = (ALvoid*)pointer;
+ alcMakeContextCurrent(alcHandle);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_processContextNative
+ (JNIEnv *env, jobject obj, jint pointer) {
+ ALvoid* alcHandle = (ALvoid*)pointer;
+ alcProcessContext(alcHandle);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_suspendContextNative
+ (JNIEnv *env, jobject obj, jint pointer) {
+ ALvoid* alcHandle = (ALvoid*)pointer;
+ alcSuspendContext(alcHandle);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_destroyContextNative
+ (JNIEnv *env, jobject obj, jint pointer) {
+ ALvoid* alcHandle = (ALvoid*)pointer;
+ alcDestroyContext(alcHandle);
+}
+/*
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getError
+ (JNIEnv *env, jobject obj) {
+ jint result = 0;
+// result = alcGetError();
+ return result;
+}
+*/
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getCurrentContextNative
+ (JNIEnv *env, jobject obj) {
+ jint result;
+ result = (jint)alcGetCurrentContext();
+ return result;
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getEnumValueNative
+ (JNIEnv *env, jobject obj, jint pointer, jstring enumName) {
+ jint result;
+ ALCdevice* device = (ALCdevice*)pointer;
+ ALubyte* str;
+ str = (ALubyte*)(*env)->GetStringUTFChars(env,enumName,NULL);
+ result = alcGetEnumValue(device, str);
+ (*env)->ReleaseStringUTFChars(env,enumName,str);
+ return result;
+}
+
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getContextsDeviceNative
+ (JNIEnv *env, jobject obj, jint ptr) {
+ jint result;
+ ALvoid* alcHandle = (ALvoid*)ptr;
+ result = (jint)alcGetContextsDevice(alcHandle);
+ return result;
+}
+JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALCImpl_alcGetStringNative
+ (JNIEnv *env, jobject obj, jint ptr, jint pname) {
+ ALCdevice *device = (ALCdevice*)ptr;
+ ALubyte* p = alcGetString(device,(ALenum)pname);
+ return (*env)->NewStringUTF(env, p);
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_alcGetIntegervNative
+ (JNIEnv *env, jobject obj, jint ptr, jint pname, jint size, jintArray data) {
+ ALint *p = (ALint*)(*env)->GetPrimitiveArrayCritical(env,data,0);
+ ALCdevice *device = (ALCdevice*)ptr;
+ if(p) {
+ alcGetIntegerv(device,(ALenum)pname,(ALsizei)size,p);
+ }
+ (*env)->ReleasePrimitiveArrayCritical(env,data,p,0);
+}
diff --git a/src/native/alcbind.h b/src/native/alcbind.h
new file mode 100644
index 0000000..27ceffe
--- /dev/null
+++ b/src/native/alcbind.h
@@ -0,0 +1,148 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+#include <jni.h>
+/* Header for class net_java_games_joal_ALCImpl */
+
+#ifndef _Included_net_java_games_joal_ALCImpl
+#define _Included_net_java_games_joal_ALCImpl
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: openDeviceNative
+ * Signature: (Ljava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_openDeviceNative
+ (JNIEnv *, jobject, jstring);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: closeDeviceNative
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_closeDeviceNative
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: createContextNative
+ * Signature: (I[I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_createContextNative
+ (JNIEnv *, jobject, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: makeContextCurrentNative
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_makeContextCurrentNative
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: processContextNative
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_processContextNative
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: suspendContextNative
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_suspendContextNative
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: destroyContextNative
+ * Signature: (I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_destroyContextNative
+ (JNIEnv *, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: alcGetError
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_alcGetError
+ (JNIEnv *, jobject);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: getCurrentContextNative
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getCurrentContextNative
+ (JNIEnv *, jobject);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: getEnumValueNative
+ * Signature: (ILjava/lang/String;)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getEnumValueNative
+ (JNIEnv *, jobject, jint, jstring);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: alcGetStringNative
+ * Signature: (II)Ljava/lang/String;
+ */
+JNIEXPORT jstring JNICALL Java_net_java_games_joal_ALCImpl_alcGetStringNative
+ (JNIEnv *, jobject, jint, jint);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: alcGetIntegervNative
+ * Signature: (III[I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_ALCImpl_alcGetIntegervNative
+ (JNIEnv *, jobject, jint, jint, jint, jintArray);
+
+/*
+ * Class: net_java_games_joal_ALCImpl
+ * Method: getContextDeviceNative
+ * Signature: (I)I
+ */
+JNIEXPORT jint JNICALL Java_net_java_games_joal_ALCImpl_getContextDeviceNative
+ (JNIEnv *, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/alfactory.c b/src/native/alfactory.c
new file mode 100644
index 0000000..f38f358
--- /dev/null
+++ b/src/native/alfactory.c
@@ -0,0 +1,47 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+#include "alfactory.h"
+#include "extal.h"
+#include <jni.h>
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_init
+ (JNIEnv *env , jclass clazz, jobjectArray oalPaths) {
+ return InitializeOpenAL(env,oalPaths);
+}
+
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_deinitialize
+ (JNIEnv *env, jclass clazz) {
+ DeInitializeOpenAL();
+ return 1;
+}
diff --git a/src/native/alfactory.h b/src/native/alfactory.h
new file mode 100644
index 0000000..48c301c
--- /dev/null
+++ b/src/native/alfactory.h
@@ -0,0 +1,66 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_java_games_joal_ALFactory */
+
+#ifndef _Included_net_java_games_joal_ALFactory
+#define _Included_net_java_games_joal_ALFactory
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* Inaccessible static: isInitialized */
+/* Inaccessible static: al */
+/* Inaccessible static: alc */
+/*
+ * Class: net_java_games_joal_ALFactory
+ * Method: initialize
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_init
+ (JNIEnv *, jclass, jobjectArray);
+
+/*
+ * Class: net_java_games_joal_ALFactory
+ * Method: deinitialize
+ * Signature: ()Z
+ */
+JNIEXPORT jboolean JNICALL Java_net_java_games_joal_ALFactory_deinitialize
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/build.xml b/src/native/build.xml
new file mode 100644
index 0000000..531da19
--- /dev/null
+++ b/src/native/build.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0"?>
+
+<!--
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+-->
+
+
+<project name="Sun Games Initiative Client Technologies" basedir="." default="all">
+
+ <target name="init">
+ <property name="cc" value ="gcc"/>
+ <property name="no_cygwin" value="-mno-cygwin"/>
+ <property name="include" value="-I${jdk.home}/include -I${jdk.home}/include/win32 -I'${openal.home}'/include" />
+ <property name="compilerflags" value ="-O3 -Wl,--add-stdcall-alias -shared"/>
+ <property name="output" value="../../lib/joal.dll"/>
+ <property name="sources" value="extal.c eaxfactory.c eaxbind.c alfactory.c alcbind.c albind.c"/>
+ <property name="specs" value="-specs='./specs.new'"/>
+ </target>
+
+ <target name="compile" depends="init">
+ <exec executable="${cc}" os="Windows 2000, Windows XP">
+ <arg line=" ${no_cygwin}"/>
+ <arg line=" ${include}"/>
+ <arg line=" ${compilerflags}"/>
+ <arg line=" -o ${output}"/>
+ <arg line=" ${sources}"/>
+ </exec>
+ </target>
+
+ <target name="javadoc" depends="init">
+ <ant dir="src/java" target="javadoc"/>
+ </target>
+
+
+ <target name="all" depends="init,compile" description="Build everything.">
+ <echo message="Application built."/>
+ </target>
+
+ <target name="clean" description="Clean all build products.">
+ <delete file="../../bin/joal.dll" />
+ </target>
+</project>
diff --git a/src/native/eaxbind.c b/src/native/eaxbind.c
new file mode 100644
index 0000000..da1b285
--- /dev/null
+++ b/src/native/eaxbind.c
@@ -0,0 +1,85 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+#include "eaxbind.h"
+#include "extal.h"
+#ifdef _WIN32
+const GUID DSPROPSETID_EAX20_ListenerProperties
+ = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } };
+
+const GUID DSPROPSETID_EAX20_BufferProperties
+ = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } };
+#endif
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAX_EAXSet
+ (JNIEnv *env,
+ jobject obj,
+ jint gflag,
+ jint pname,
+ jint source,
+ jobject buff,
+ jint size) {
+#ifdef _WIN32
+ ALvoid* p = (ALvoid*)(*env)->GetDirectBufferAddress(env,buff);
+
+ const GUID* guid = (gflag == 0 ? &DSPROPSETID_EAX20_ListenerProperties :
+ &DSPROPSETID_EAX20_BufferProperties);
+ eaxSet(guid,
+ (ALuint) pname,
+ (ALuint)source,
+ p,
+ (ALuint)size);
+#endif
+}
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAX_EAXGet
+ (JNIEnv *env,
+ jobject obj,
+ jint gflag,
+ jint pname,
+ jint source,
+ jobject buff,
+ jint size) {
+#ifdef _WIN32
+ ALvoid* p = (ALvoid*)(*env)->GetDirectBufferAddress(env,buff);
+ const GUID* guid = (gflag == 0 ? &DSPROPSETID_EAX20_ListenerProperties :
+ &DSPROPSETID_EAX20_BufferProperties);
+ eaxGet(guid,
+ (ALuint) pname,
+ (ALuint) source,
+ p,
+ (ALuint) size);
+#endif
+}
+
diff --git a/src/native/eaxbind.h b/src/native/eaxbind.h
new file mode 100644
index 0000000..9450313
--- /dev/null
+++ b/src/native/eaxbind.h
@@ -0,0 +1,63 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_java_games_joal_eax_EAX */
+
+#ifndef _Included_net_java_games_joal_eax_EAX
+#define _Included_net_java_games_joal_eax_EAX
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class: net_java_games_joal_eax_EAX
+ * Method: _eaxSet
+ * Signature: (IIILjava/nio/ByteBuffer;I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAX_EAXSet
+ (JNIEnv *, jobject, jint, jint, jint, jobject, jint);
+
+/*
+ * Class: net_java_games_joal_eax_EAX
+ * Method: _eaxGet
+ * Signature: (IIILjava/nio/ByteBuffer;I)V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAX_EAXGet
+ (JNIEnv *, jobject, jint, jint, jint, jobject, jint);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/eaxfactory.c b/src/native/eaxfactory.c
new file mode 100644
index 0000000..708ddda
--- /dev/null
+++ b/src/native/eaxfactory.c
@@ -0,0 +1,50 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+#include "eaxfactory.h"
+#include "extal.h"
+
+/*
+ * had some problems getting this from extal.h
+ */
+
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAXFactory_init
+ (JNIEnv *env, jclass clazz) {
+#ifdef _WIN32
+ if(alIsExtensionPresent("EAX2.0")) {
+ eaxSet = alGetProcAddress((ALubyte*)"EAXSet");
+ eaxGet = alGetProcAddress((ALubyte*)"EAXGet");
+ }
+#endif
+}
diff --git a/src/native/eaxfactory.h b/src/native/eaxfactory.h
new file mode 100644
index 0000000..1a58cd8
--- /dev/null
+++ b/src/native/eaxfactory.h
@@ -0,0 +1,58 @@
+/**
+* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions are met:
+*
+* -Redistribution of source code must retain the above copyright notice,
+* this list of conditions and the following disclaimer.
+*
+* -Redistribution in binary form must reproduce the above copyright notice,
+* this list of conditions and the following disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* Neither the name of Sun Microsystems, Inc. or the names of contributors may
+* be used to endorse or promote products derived from this software without
+* specific prior written permission.
+*
+* This software is provided "AS IS," without a warranty of any kind.
+* ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING
+* ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
+* NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") AND ITS
+* LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A
+* RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
+* IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT
+* OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
+* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
+* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+*
+* You acknowledge that this software is not designed or intended for use in the
+* design, construction, operation or maintenance of any nuclear facility.
+*/
+
+
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class net_java_games_joal_eax_EAXFactory */
+
+#ifndef _Included_net_java_games_joal_eax_EAXFactory
+#define _Included_net_java_games_joal_eax_EAXFactory
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* Inaccessible static: SOURCE_GUID */
+/* Inaccessible static: LISTENER_GUID */
+/* Inaccessible static: eax */
+/*
+ * Class: net_java_games_joal_eax_EAXFactory
+ * Method: init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_net_java_games_joal_eax_EAXFactory_init
+ (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/native/extal.c b/src/native/extal.c
new file mode 100644
index 0000000..f7998cc
--- /dev/null
+++ b/src/native/extal.c
@@ -0,0 +1,416 @@
+/*
+ * Copyright (c) 2002 Light Weight Java Game Library Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'Light Weight Java Game Library' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <jni.h>
+#include "extal.h"
+
+#ifdef _X11
+#include <dlfcn.h>
+#endif
+
+/**
+ * $Id$
+ *
+ * This file contains the AL extension assigning mechanism
+ *
+ * @author Brian Matzon <[email protected]>
+ * @version $Revision$
+ */
+alEnablePROC alEnable = NULL;
+alDisablePROC alDisable = NULL;
+alIsEnabledPROC alIsEnabled = NULL;
+alHintPROC alHint = NULL;
+alGetBooleanPROC alGetBoolean = NULL;
+alGetIntegerPROC alGetInteger = NULL;
+alGetFloatPROC alGetFloat = NULL;
+alGetDoublePROC alGetDouble = NULL;
+alGetBooleanvPROC alGetBooleanv = NULL;
+alGetIntegervPROC alGetIntegerv = NULL;
+alGetFloatvPROC alGetFloatv = NULL;
+alGetDoublevPROC alGetDoublev = NULL;
+alGetStringPROC alGetString = NULL;
+alGetErrorPROC alGetError = NULL;
+alIsExtensionPresentPROC alIsExtensionPresent = NULL;
+alGetProcAddressPROC alGetProcAddress = NULL;
+alGetEnumValuePROC alGetEnumValue = NULL;
+alListeneriPROC alListeneri = NULL;
+alListenerfPROC alListenerf = NULL;
+alListener3fPROC alListener3f = NULL;
+alListenerfvPROC alListenerfv = NULL;
+alGetListeneriPROC alGetListeneri = NULL;
+alGetListenerfPROC alGetListenerf = NULL;
+alGetListener3fPROC alGetListener3f = NULL;
+alGetListenerfvPROC alGetListenerfv = NULL;
+alGenSourcesPROC alGenSources = NULL;
+alDeleteSourcesPROC alDeleteSources = NULL;
+alIsSourcePROC alIsSource = NULL;
+alSourceiPROC alSourcei = NULL;
+alSourcefPROC alSourcef = NULL;
+alSource3fPROC alSource3f = NULL;
+alSourcefvPROC alSourcefv = NULL;
+alGetSourceiPROC alGetSourcei = NULL;
+alGetSourcefPROC alGetSourcef = NULL;
+alGetSource3fPROC alGetSource3f = NULL;
+alGetSourcefvPROC alGetSourcefv = NULL;
+alSourcePlayvPROC alSourcePlayv = NULL;
+alSourcePausevPROC alSourcePausev = NULL;
+alSourceStopvPROC alSourceStopv = NULL;
+alSourceRewindvPROC alSourceRewindv = NULL;
+alSourcePlayPROC alSourcePlay = NULL;
+alSourcePausePROC alSourcePause = NULL;
+alSourceStopPROC alSourceStop = NULL;
+alSourceRewindPROC alSourceRewind = NULL;
+alGenBuffersPROC alGenBuffers = NULL;
+alDeleteBuffersPROC alDeleteBuffers = NULL;
+alIsBufferPROC alIsBuffer = NULL;
+alBufferDataPROC alBufferData = NULL;
+alGetBufferiPROC alGetBufferi = NULL;
+alGetBufferfPROC alGetBufferf = NULL;
+alSourceQueueBuffersPROC alSourceQueueBuffers = NULL;
+alSourceUnqueueBuffersPROC alSourceUnqueueBuffers = NULL;
+alDistanceModelPROC alDistanceModel = NULL;
+alDopplerFactorPROC alDopplerFactor = NULL;
+alDopplerVelocityPROC alDopplerVelocity = NULL;
+alcGetStringPROC alcGetString = NULL;
+alcGetIntegervPROC alcGetIntegerv = NULL;
+alcOpenDevicePROC alcOpenDevice = NULL;
+alcCloseDevicePROC alcCloseDevice = NULL;
+alcCreateContextPROC alcCreateContext = NULL;
+alcMakeContextCurrentPROC alcMakeContextCurrent = NULL;
+alcProcessContextPROC alcProcessContext = NULL;
+alcGetCurrentContextPROC alcGetCurrentContext = NULL;
+alcGetContextsDevicePROC alcGetContextsDevice = NULL;
+alcSuspendContextPROC alcSuspendContext = NULL;
+alcDestroyContextPROC alcDestroyContext = NULL;
+alcGetErrorPROC alcGetError = NULL;
+alcIsExtensionPresentPROC alcIsExtensionPresent = NULL;
+alcGetProcAddressPROC alcGetProcAddress = NULL;
+alcGetEnumValuePROC alcGetEnumValue = NULL;
+
+#ifdef _WIN32
+EAXSet eaxSet; // EAXSet function, ret$
+EAXGet eaxGet; // EAXGet function, ret$
+
+/* Handle to OpenAL Library */
+HMODULE handleOAL;
+#else
+void* handleOAL;
+#endif
+
+/* Loads OpenAL */
+void LoadOpenAL();
+
+/* Unloads OpenAL */
+void UnLoadOpenAL();
+
+/* Gets a pointer to the named function */
+void* GetFunctionPointer(const char* function);
+
+/* Loads OpenAL basic functions */
+int LoadAL();
+
+/* Loads OpenAL ALC functions */
+int LoadALC();
+
+/* Loads any extensions to OpenAL */
+int LoadALExtensions();
+
+/**
+ * Retrieves a pointer to the named function
+ *
+ * @param function Name of function
+ * @return pointer to named function, or NULL if not found
+ */
+void* GetFunctionPointer(const char* function) {
+#ifdef _WIN32
+ return GetProcAddress(handleOAL, function);
+#endif
+#ifdef _X11
+ return dlsym(handleOAL, function);
+#endif
+}
+
+/**
+ * Loads the OpenAL Library
+ */
+void LoadOpenAL(JNIEnv *env, jobjectArray oalPaths) {
+ jsize pathcount = (*env)->GetArrayLength(env,oalPaths);
+#ifdef _DEBUG
+ printf("Found %d OpenAL paths\n", pathcount);
+#endif
+ int i;
+ for(i=0;i<pathcount;i++) {
+ jstring path = (jstring) (*env)->GetObjectArrayElement(env,oalPaths, i);
+ const char *path_str = (*env)->GetStringUTFChars(env,path, NULL);
+#ifdef _DEBUG
+ printf("Testing '%s'\n", path_str);
+#endif
+#ifdef _WIN32
+ handleOAL = LoadLibrary(path_str);
+#endif
+#ifdef _X11
+ handleOAL = dlopen(path_str, RTLD_LAZY);
+#endif
+ if (handleOAL != NULL) {
+#ifdef _DEBUG
+ printf("Found OpenAL at '%s'\n", path_str);
+#endif
+ break;
+ }
+ (*env)->ReleaseStringUTFChars(env, path, path_str);
+ }
+}
+
+/**
+ * Unloads the OpenAL Library
+ */
+void UnLoadOpenAL() {
+#ifdef _WIN32
+ FreeLibrary(handleOAL);
+#endif
+#ifdef _X11
+ dlclose(handleOAL);
+#endif
+}
+
+/**
+ * Initializes OpenAL by loading the library
+ */
+int InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths) {
+ if(handleOAL != 0) {
+ return JNI_TRUE;
+ }
+
+ //load our library
+ LoadOpenAL(env, oalPaths);
+
+ // if we couldn't load the library, get out
+ if(handleOAL == 0) {
+ return JNI_FALSE;
+ }
+
+ //load basic OpenAL functions
+ if(!LoadAL()) {
+ return JNI_FALSE;
+ }
+
+ //load OpenAL context functions
+ if(!LoadALC()) {
+ return JNI_FALSE;
+ }
+
+ //load OpenAL extensions
+ if(!LoadALExtensions()) {
+ return JNI_FALSE;
+ }
+
+ return JNI_TRUE;
+}
+
+/**
+ * Called to deinitialize OpenAL
+ */
+void DeInitializeOpenAL() {
+ UnLoadOpenAL();
+ handleOAL = 0;
+}
+
+/**
+ * Loads the basic OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+int LoadAL() {
+ alEnable = (alEnablePROC) GetFunctionPointer("alEnable");
+ alDisable = (alDisablePROC) GetFunctionPointer("alDisable");
+ alIsEnabled = (alIsEnabledPROC) GetFunctionPointer("alIsEnabled");
+ //alHint = (alHintPROC) GetFunctionPointer("alHint");
+ alGetBoolean = (alGetBooleanPROC) GetFunctionPointer("alGetBoolean");
+ alGetInteger = (alGetIntegerPROC) GetFunctionPointer("alGetInteger");
+ alGetFloat = (alGetFloatPROC) GetFunctionPointer("alGetFloat");
+ alGetDouble = (alGetDoublePROC) GetFunctionPointer("alGetDouble");
+ alGetBooleanv = (alGetBooleanvPROC) GetFunctionPointer("alGetBooleanv");
+ alGetIntegerv = (alGetIntegervPROC) GetFunctionPointer("alGetIntegerv");
+ alGetFloatv = (alGetFloatvPROC) GetFunctionPointer("alGetFloatv");
+ alGetDoublev = (alGetDoublevPROC) GetFunctionPointer("alGetDoublev");
+ alGetString = (alGetStringPROC) GetFunctionPointer("alGetString");
+ alGetError = (alGetErrorPROC) GetFunctionPointer("alGetError");
+ alIsExtensionPresent = (alIsExtensionPresentPROC) GetFunctionPointer("alIsExtensionPresent");
+ alGetProcAddress = (alGetProcAddressPROC) GetFunctionPointer("alGetProcAddress");
+ alGetEnumValue = (alGetEnumValuePROC) GetFunctionPointer("alGetEnumValue");
+ alListeneri = (alListeneriPROC) GetFunctionPointer("alListeneri");
+ alListenerf = (alListenerfPROC) GetFunctionPointer("alListenerf");
+ alListener3f = (alListener3fPROC) GetFunctionPointer("alListener3f");
+ alListenerfv = (alListenerfvPROC) GetFunctionPointer("alListenerfv");
+ alGetListeneri = (alGetListeneriPROC) GetFunctionPointer("alGetListeneri");
+ alGetListenerf = (alGetListenerfPROC) GetFunctionPointer("alGetListenerf");
+ alGetListener3f = (alGetListener3fPROC) GetFunctionPointer("alGetListener3f");
+ alGetListenerfv = (alGetListenerfvPROC) GetFunctionPointer("alGetListenerfv");
+ alGenSources = (alGenSourcesPROC) GetFunctionPointer("alGenSources");
+ alDeleteSources = (alDeleteSourcesPROC) GetFunctionPointer("alDeleteSources");
+ alIsSource = (alIsSourcePROC) GetFunctionPointer("alIsSource");
+ alSourcei = (alSourceiPROC) GetFunctionPointer("alSourcei");
+ alSourcef = (alSourcefPROC) GetFunctionPointer("alSourcef");
+ alSource3f = (alSource3fPROC) GetFunctionPointer("alSource3f");
+ alSourcefv = (alSourcefvPROC) GetFunctionPointer("alSourcefv");
+ alGetSourcei = (alGetSourceiPROC) GetFunctionPointer("alGetSourcei");
+ alGetSourcef = (alGetSourcefPROC) GetFunctionPointer("alGetSourcef");
+ alGetSource3f = (alGetSource3fPROC) GetFunctionPointer("alGetSource3f");
+ alGetSourcefv = (alGetSourcefvPROC) GetFunctionPointer("alGetSourcefv");
+ alSourcePlayv = (alSourcePlayvPROC) GetFunctionPointer("alSourcePlayv");
+ alSourcePausev = (alSourcePausevPROC) GetFunctionPointer("alSourcePausev");
+ alSourceStopv = (alSourceStopvPROC) GetFunctionPointer("alSourceStopv");
+ alSourceRewindv = (alSourceRewindvPROC) GetFunctionPointer("alSourceRewindv");
+ alSourcePlay = (alSourcePlayPROC) GetFunctionPointer("alSourcePlay");
+ alSourcePause = (alSourcePausePROC) GetFunctionPointer("alSourcePause");
+ alSourceStop = (alSourceStopPROC) GetFunctionPointer("alSourceStop");
+ alSourceRewind = (alSourceRewindPROC) GetFunctionPointer("alSourceRewind");
+ alGenBuffers = (alGenBuffersPROC) GetFunctionPointer("alGenBuffers");
+ alDeleteBuffers = (alDeleteBuffersPROC) GetFunctionPointer("alDeleteBuffers");
+ alIsBuffer = (alIsBufferPROC) GetFunctionPointer("alIsBuffer");
+ alBufferData = (alBufferDataPROC) GetFunctionPointer("alBufferData");
+ alGetBufferi = (alGetBufferiPROC) GetFunctionPointer("alGetBufferi");
+ alGetBufferf = (alGetBufferfPROC) GetFunctionPointer("alGetBufferf");
+ alSourceQueueBuffers = (alSourceQueueBuffersPROC) GetFunctionPointer("alSourceQueueBuffers");
+ alSourceUnqueueBuffers = (alSourceUnqueueBuffersPROC) GetFunctionPointer("alSourceUnqueueBuffers");
+ alDistanceModel = (alDistanceModelPROC) GetFunctionPointer("alDistanceModel");
+ alDopplerFactor = (alDopplerFactorPROC) GetFunctionPointer("alDopplerFactor");
+ alDopplerVelocity = (alDopplerVelocityPROC) GetFunctionPointer("alDopplerVelocity");
+
+ return
+ alEnable != NULL &&
+ alDisable != NULL &&
+ alIsEnabled != NULL &&
+ //alHint != NULL &&
+ alGetBoolean != NULL &&
+ alGetInteger != NULL &&
+ alGetFloat != NULL &&
+ alGetDouble != NULL &&
+ alGetBooleanv != NULL &&
+ alGetIntegerv != NULL &&
+ alGetFloatv != NULL &&
+ alGetDoublev != NULL &&
+ alGetString != NULL &&
+ alGetError != NULL &&
+ alIsExtensionPresent != NULL &&
+ alGetProcAddress != NULL &&
+ alGetEnumValue != NULL &&
+ alListeneri != NULL &&
+ alListenerf != NULL &&
+ alListener3f != NULL &&
+ alListenerfv != NULL &&
+ alGetListeneri != NULL &&
+ alGetListenerf != NULL &&
+ alGetListener3f != NULL &&
+ alGetListenerfv != NULL &&
+ alGenSources != NULL &&
+ alDeleteSources != NULL &&
+ alIsSource != NULL &&
+ alSourcei != NULL &&
+ alSourcef != NULL &&
+ alSource3f != NULL &&
+ alSourcefv != NULL &&
+ alGetSourcei != NULL &&
+ alGetSourcef != NULL &&
+ alGetSource3f != NULL &&
+ alGetSourcefv != NULL &&
+ alSourcePlayv != NULL &&
+ alSourcePausev != NULL &&
+ alSourceStopv != NULL &&
+ alSourceRewindv != NULL &&
+ alSourcePlay != NULL &&
+ alSourcePause != NULL &&
+ alSourceStop != NULL &&
+ alSourceRewind != NULL &&
+ alGenBuffers != NULL &&
+ alDeleteBuffers != NULL &&
+ alIsBuffer != NULL &&
+ alBufferData != NULL &&
+ alGetBufferi != NULL &&
+ alGetBufferf != NULL &&
+ alSourceQueueBuffers != NULL &&
+ alSourceUnqueueBuffers != NULL &&
+ alDistanceModel != NULL &&
+ alDopplerFactor != NULL &&
+ alDopplerVelocity != NULL;
+}
+
+/**
+ * Loads the context OpenAL functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+int LoadALC() {
+ alcGetString = (alcGetStringPROC) GetFunctionPointer("alcGetString");
+ alcGetIntegerv = (alcGetIntegervPROC) GetFunctionPointer("alcGetIntegerv");
+ alcOpenDevice = (alcOpenDevicePROC) GetFunctionPointer("alcOpenDevice");
+ alcCloseDevice = (alcCloseDevicePROC) GetFunctionPointer("alcCloseDevice");
+ alcCreateContext = (alcCreateContextPROC) GetFunctionPointer("alcCreateContext");
+ alcMakeContextCurrent = (alcMakeContextCurrentPROC) GetFunctionPointer("alcMakeContextCurrent");
+ alcProcessContext = (alcProcessContextPROC) GetFunctionPointer("alcProcessContext");
+ alcGetCurrentContext = (alcGetCurrentContextPROC) GetFunctionPointer("alcGetCurrentContext");
+ alcGetContextsDevice = (alcGetContextsDevicePROC) GetFunctionPointer("alcGetContextsDevice");
+ alcSuspendContext = (alcSuspendContextPROC) GetFunctionPointer("alcSuspendContext");
+ alcDestroyContext = (alcDestroyContextPROC) GetFunctionPointer("alcDestroyContext");
+ alcGetError = (alcGetErrorPROC) GetFunctionPointer("alcGetError");
+ alcIsExtensionPresent = (alcIsExtensionPresentPROC) GetFunctionPointer("alcIsExtensionPresent");
+ alcGetProcAddress = (alcGetProcAddressPROC) GetFunctionPointer("alcGetProcAddress");
+ alcGetEnumValue = (alcGetEnumValuePROC) GetFunctionPointer("alcGetEnumValue");
+
+ return
+ alcGetString != NULL &&
+ alcGetIntegerv != NULL &&
+ alcOpenDevice != NULL &&
+ alcCloseDevice != NULL &&
+ alcCreateContext != NULL &&
+ alcMakeContextCurrent != NULL &&
+ alcProcessContext != NULL &&
+ alcGetCurrentContext != NULL &&
+ alcGetContextsDevice != NULL &&
+ alcSuspendContext != NULL &&
+ alcDestroyContext != NULL &&
+ alcGetError != NULL &&
+ alcIsExtensionPresent != NULL &&
+ alcGetProcAddress != NULL &&
+ alcGetEnumValue != NULL;
+}
+
+/**
+ * Loads the OpenAL extensions functions
+ *
+ * @return true if all methods were loaded, false if one of the methods could not be loaded
+ */
+int LoadALExtensions() {
+ return JNI_TRUE;
+}
+
diff --git a/src/native/extal.h b/src/native/extal.h
new file mode 100644
index 0000000..ae84ac8
--- /dev/null
+++ b/src/native/extal.h
@@ -0,0 +1,315 @@
+/*
+ * Copyright (c) 2002 Light Weight Java Game Library Project
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of 'Light Weight Java Game Library' nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _EXTAL_H
+#define _EXTAL_H
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#include <altypes.h>
+#include <alctypes.h>
+#include <jni.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef _WIN32
+ #ifdef _OPENAL32LIB
+ #define ALCAPI __declspec(dllexport)
+ #else
+ #define ALCAPI __declspec(dllimport)
+ #endif
+
+ typedef struct ALCdevice_struct ALCdevice;
+ typedef struct ALCcontext_struct ALCcontext;
+
+ #define ALCAPIENTRY __cdecl
+#else
+ #ifdef TARGET_OS_MAC
+ #if TARGET_OS_MAC
+
+ #pragma export on
+ #endif
+ #endif
+ #define ALCAPI
+ #define ALCAPIENTRY
+
+/** ALC boolean type. */
+typedef char ALCboolean;
+
+/** ALC 8bit signed byte. */
+typedef char ALCbyte;
+
+/** ALC 8bit unsigned byte. */
+typedef unsigned char ALCubyte;
+
+/** ALC 16bit signed short integer type. */
+typedef short ALCshort;
+
+/** ALC 16bit unsigned short integer type. */
+typedef unsigned short ALCushort;
+
+/** ALC 32bit unsigned integer type. */
+typedef unsigned ALCuint;
+
+/** ALC 32bit signed integer type. */
+typedef int ALCint;
+
+/** ALC 32bit floating point type. */
+typedef float ALCfloat;
+
+/** ALC 64bit double point type. */
+typedef double ALCdouble;
+
+/** ALC 32bit type. */
+typedef unsigned int ALCsizei;
+
+/** ALC void type */
+typedef void ALCvoid;
+
+#endif
+
+#ifdef _WIN32
+ #ifdef _OPENAL32LIB
+ #define ALAPI __declspec(dllexport)
+ #else
+ #define ALAPI __declspec(dllimport)
+ #endif
+ #define ALAPIENTRY __cdecl
+ #define AL_CALLBACK
+#else
+ #ifdef TARGET_OS_MAC
+ #if TARGET_OS_MAC
+ #pragma export on
+ #endif
+ #endif
+ #define ALAPI
+ #define ALAPIENTRY
+ #define AL_CALLBACK
+#endif
+#define INITGUID
+#define OPENAL
+
+#ifdef _WIN32
+/*
+* EAX 2.0 listener property set {0306A6A8-B224-11d2-99E5-0000E8D8C722}
+*/
+/*
+const GUID DSPROPSETID_EAX20_ListenerProperties
+ = { 0x306a6a8, 0xb224, 0x11d2, { 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } };
+
+const GUID DSPROPSETID_EAX20_BufferProperties
+ = { 0x306a6a7, 0xb224, 0x11d2, {0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22 } };
+*/
+#endif
+/*
+DEFINE_GUID(DSPROPSETID_EAX20_ListenerProperties,
+ 0x306a6a8,
+ 0xb224,
+ 0x11d2,
+ 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22);
+
+DEFINE_GUID(DSPROPSETID_EAX20_BufferProperties,
+ 0x306a6a7,
+ 0xb224,
+ 0x11d2,
+ 0x99, 0xe5, 0x0, 0x0, 0xe8, 0xd8, 0xc7, 0x22);
+*/
+void DeInitializeOpenAL();
+
+int InitializeOpenAL(JNIEnv *env, jobjectArray oalPaths);
+
+//alc
+typedef ALCubyte* (ALCAPIENTRY *alcGetStringPROC)(ALCdevice *device,ALCenum param);
+typedef ALCvoid (ALCAPIENTRY *alcGetIntegervPROC)(ALCdevice *device,ALCenum param,ALCsizei size,ALCint *data);
+typedef ALCdevice* (ALCAPIENTRY *alcOpenDevicePROC)(ALCubyte *deviceName);
+typedef ALCvoid (ALCAPIENTRY *alcCloseDevicePROC)(ALCdevice *device);
+typedef ALCcontext* (ALCAPIENTRY *alcCreateContextPROC)(ALCdevice *device,ALCint *attrList);
+typedef ALCboolean (ALCAPIENTRY *alcMakeContextCurrentPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcProcessContextPROC)(ALCcontext *context);
+typedef ALCcontext* (ALCAPIENTRY *alcGetCurrentContextPROC)(ALCvoid);
+typedef ALCdevice* (ALCAPIENTRY *alcGetContextsDevicePROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcSuspendContextPROC)(ALCcontext *context);
+typedef ALCvoid (ALCAPIENTRY *alcDestroyContextPROC)(ALCcontext *context);
+typedef ALCenum (ALCAPIENTRY *alcGetErrorPROC)(ALCdevice *device);
+typedef ALCboolean (ALCAPIENTRY *alcIsExtensionPresentPROC)(ALCdevice *device,ALCubyte *extName);
+typedef ALCvoid* (ALCAPIENTRY *alcGetProcAddressPROC)(ALCdevice *device,ALCubyte *funcName);
+typedef ALCenum (ALCAPIENTRY *alcGetEnumValuePROC)(ALCdevice *device,ALCubyte *enumName);
+
+//al
+typedef ALvoid (ALAPIENTRY *alEnablePROC)( ALenum capability );
+typedef ALvoid (ALAPIENTRY *alDisablePROC)( ALenum capability );
+typedef ALboolean (ALAPIENTRY *alIsEnabledPROC)( ALenum capability );
+typedef ALvoid (ALAPIENTRY *alHintPROC)( ALenum target, ALenum mode );
+typedef ALboolean (ALAPIENTRY *alGetBooleanPROC)( ALenum param );
+typedef ALint (ALAPIENTRY *alGetIntegerPROC)( ALenum param );
+typedef ALfloat (ALAPIENTRY *alGetFloatPROC)( ALenum param );
+typedef ALdouble (ALAPIENTRY *alGetDoublePROC)( ALenum param );
+typedef ALvoid (ALAPIENTRY *alGetBooleanvPROC)( ALenum param, ALboolean* data );
+typedef ALvoid (ALAPIENTRY *alGetIntegervPROC)( ALenum param, ALint* data );
+typedef ALvoid (ALAPIENTRY *alGetFloatvPROC)( ALenum param, ALfloat* data );
+typedef ALvoid (ALAPIENTRY *alGetDoublevPROC)( ALenum param, ALdouble* data );
+typedef ALubyte* (ALAPIENTRY *alGetStringPROC)( ALenum param );
+typedef ALenum (ALAPIENTRY *alGetErrorPROC)( ALvoid );
+typedef ALboolean (ALAPIENTRY *alIsExtensionPresentPROC)( ALubyte* fname );
+typedef ALvoid* (ALAPIENTRY *alGetProcAddressPROC)( ALubyte* fname );
+typedef ALenum (ALAPIENTRY *alGetEnumValuePROC)( ALubyte* ename );
+typedef ALvoid (ALAPIENTRY *alListeneriPROC)( ALenum param, ALint value );
+typedef ALvoid (ALAPIENTRY *alListenerfPROC)( ALenum param, ALfloat value );
+typedef ALvoid (ALAPIENTRY *alListener3fPROC)( ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 );
+typedef ALvoid (ALAPIENTRY *alListenerfvPROC)( ALenum param, ALfloat* values );
+typedef ALvoid (ALAPIENTRY *alGetListeneriPROC)( ALenum param, ALint* value );
+typedef ALvoid (ALAPIENTRY *alGetListenerfPROC)( ALenum param, ALfloat* value );
+typedef ALvoid (ALAPIENTRY *alGetListener3fPROC)( ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 );
+typedef ALvoid (ALAPIENTRY *alGetListenerfvPROC)( ALenum param, ALfloat* values );
+typedef ALvoid (ALAPIENTRY *alGenSourcesPROC)( ALsizei n, ALuint* sources );
+typedef ALvoid (ALAPIENTRY *alDeleteSourcesPROC)( ALsizei n, ALuint* sources );
+typedef ALboolean (ALAPIENTRY *alIsSourcePROC)( ALuint id );
+typedef ALvoid (ALAPIENTRY *alSourceiPROC)( ALuint source, ALenum param, ALint value );
+typedef ALvoid (ALAPIENTRY *alSourcefPROC)( ALuint source, ALenum param, ALfloat value );
+typedef ALvoid (ALAPIENTRY *alSource3fPROC)( ALuint source, ALenum param, ALfloat v1, ALfloat v2, ALfloat v3 );
+typedef ALvoid (ALAPIENTRY *alSourcefvPROC)( ALuint source, ALenum param, ALfloat* values );
+typedef ALvoid (ALAPIENTRY *alGetSourceiPROC)( ALuint source, ALenum param, ALint* value );
+typedef ALvoid (ALAPIENTRY *alGetSourcefPROC)( ALuint source, ALenum param, ALfloat* value );
+typedef ALvoid (ALAPIENTRY *alGetSource3fPROC)( ALuint source, ALenum param, ALfloat* v1, ALfloat* v2, ALfloat* v3 );
+typedef ALvoid (ALAPIENTRY *alGetSourcefvPROC)( ALuint source, ALenum param, ALfloat* values );
+typedef ALvoid (ALAPIENTRY *alSourcePlayvPROC)( ALsizei n, ALuint *sources );
+typedef ALvoid (ALAPIENTRY *alSourcePausevPROC)( ALsizei n, ALuint *sources );
+typedef ALvoid (ALAPIENTRY *alSourceStopvPROC)( ALsizei n, ALuint *sources );
+typedef ALvoid (ALAPIENTRY *alSourceRewindvPROC)(ALsizei n,ALuint *sources);
+typedef ALvoid (ALAPIENTRY *alSourcePlayPROC)( ALuint source );
+typedef ALvoid (ALAPIENTRY *alSourcePausePROC)( ALuint source );
+typedef ALvoid (ALAPIENTRY *alSourceStopPROC)( ALuint source );
+typedef ALvoid (ALAPIENTRY *alSourceRewindPROC)( ALuint source );
+typedef ALvoid (ALAPIENTRY *alGenBuffersPROC)( ALsizei n, ALuint* buffers );
+typedef ALvoid (ALAPIENTRY *alDeleteBuffersPROC)( ALsizei n, ALuint* buffers );
+typedef ALboolean (ALAPIENTRY *alIsBufferPROC)( ALuint buffer );
+typedef ALvoid (ALAPIENTRY *alBufferDataPROC)( ALuint buffer,
+ ALenum format,
+ ALvoid* data,
+ ALsizei size,
+ ALsizei freq );
+typedef ALvoid (ALAPIENTRY *alGetBufferiPROC)( ALuint buffer, ALenum param, ALint* value );
+typedef ALvoid (ALAPIENTRY *alGetBufferfPROC)( ALuint buffer, ALenum param, ALfloat* value );
+typedef ALvoid (ALAPIENTRY *alSourceQueueBuffersPROC)( ALuint source, ALsizei n, ALuint* buffers );
+typedef ALvoid (ALAPIENTRY *alSourceUnqueueBuffersPROC)( ALuint source, ALsizei n, ALuint* buffers );
+typedef ALvoid (ALAPIENTRY *alDistanceModelPROC)( ALenum value );
+typedef ALvoid (ALAPIENTRY *alDopplerFactorPROC)( ALfloat value );
+typedef ALvoid (ALAPIENTRY *alDopplerVelocityPROC)( ALfloat value );
+
+extern alcGetStringPROC alcGetString;
+extern alcGetIntegervPROC alcGetIntegerv;
+extern alcOpenDevicePROC alcOpenDevice;
+extern alcCloseDevicePROC alcCloseDevice;
+extern alcCreateContextPROC alcCreateContext;
+extern alcMakeContextCurrentPROC alcMakeContextCurrent;
+extern alcProcessContextPROC alcProcessContext;
+extern alcGetCurrentContextPROC alcGetCurrentContext;
+extern alcGetContextsDevicePROC alcGetContextsDevice;
+extern alcSuspendContextPROC alcSuspendContext;
+extern alcDestroyContextPROC alcDestroyContext;
+extern alcGetErrorPROC alcGetError;
+extern alcIsExtensionPresentPROC alcIsExtensionPresent;
+extern alcGetProcAddressPROC alcGetProcAddress;
+extern alcGetEnumValuePROC alcGetEnumValue;
+
+extern alEnablePROC alEnable;
+extern alDisablePROC alDisable;
+extern alIsEnabledPROC alIsEnabled;
+extern alHintPROC alHint;
+extern alGetBooleanPROC alGetBoolean;
+extern alGetIntegerPROC alGetInteger;
+extern alGetFloatPROC alGetFloat;
+extern alGetDoublePROC alGetDouble;
+extern alGetBooleanvPROC alGetBooleanv;
+extern alGetIntegervPROC alGetIntegerv;
+extern alGetFloatvPROC alGetFloatv;
+extern alGetDoublevPROC alGetDoublev;
+extern alGetStringPROC alGetString;
+extern alGetErrorPROC alGetError;
+extern alIsExtensionPresentPROC alIsExtensionPresent;
+extern alGetProcAddressPROC alGetProcAddress;
+extern alGetEnumValuePROC alGetEnumValue;
+extern alListeneriPROC alListeneri;
+extern alListenerfPROC alListenerf;
+extern alListener3fPROC alListener3f;
+extern alListenerfvPROC alListenerfv;
+extern alGetListeneriPROC alGetListeneri;
+extern alGetListenerfPROC alGetListenerf;
+extern alGetListener3fPROC alGetListener3f;
+extern alGetListenerfvPROC alGetListenerfv;
+extern alGenSourcesPROC alGenSources;
+extern alDeleteSourcesPROC alDeleteSources;
+extern alIsSourcePROC alIsSource;
+extern alSourceiPROC alSourcei;
+extern alSourcefPROC alSourcef;
+extern alSource3fPROC alSource3f;
+extern alSourcefvPROC alSourcefv;
+extern alGetSourceiPROC alGetSourcei;
+extern alGetSourcefPROC alGetSourcef;
+extern alGetSource3fPROC alGetSource3f;
+extern alGetSourcefvPROC alGetSourcefv;
+extern alSourcePlayvPROC alSourcePlayv;
+extern alSourcePausevPROC alSourcePausev;
+extern alSourceStopvPROC alSourceStopv;
+extern alSourceRewindvPROC alSourceRewindv;
+extern alSourcePlayPROC alSourcePlay;
+extern alSourcePausePROC alSourcePause;
+extern alSourceStopPROC alSourceStop;
+extern alSourceRewindPROC alSourceRewind;
+extern alGenBuffersPROC alGenBuffers;
+extern alDeleteBuffersPROC alDeleteBuffers;
+extern alIsBufferPROC alIsBuffer;
+extern alBufferDataPROC alBufferData;
+extern alGetBufferiPROC alGetBufferi;
+extern alGetBufferfPROC alGetBufferf;
+extern alSourceQueueBuffersPROC alSourceQueueBuffers;
+extern alSourceUnqueueBuffersPROC alSourceUnqueueBuffers;
+extern alDistanceModelPROC alDistanceModel;
+extern alDopplerFactorPROC alDopplerFactor;
+extern alDopplerVelocityPROC alDopplerVelocity;
+
+#ifdef _WIN32
+typedef ALenum (*EAXSet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint);
+typedef ALenum (*EAXGet)(const GUID*, ALuint, ALuint, ALvoid*, ALuint);
+
+extern EAXSet eaxSet;
+extern EAXGet eaxGet;
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif